Search Unity

Blender 2.59

Discussion in 'Asset Importing & Exporting' started by w00dn, Aug 13, 2011.

  1. w00dn

    w00dn

    Joined:
    Apr 28, 2010
    Posts:
    275
    Edit: Paulius from Unity just updated the official Blender 2.5 thread with the version of the .py script that currently works with Unity 3.4, will be shipped with Unity 3.5 and works with Blender 2.49, Blender 2.58 and Blender 2.59, so I suggest you get that one :)

    --------------------
    Old post below:

    Attached is a new Unity-BlenderToFBX.py file that works with the almost released Blender 2.59. It's a modified version of NSdesignGames's version from this thread.

    Backup and replace the original file in your ".../Unity/Editor/Data/Tools" directory and it should work.

    You can get a recent windows build of Blender 2.59 with some nice addons from graphicall.org.

    Edit: Or the now available official builds from blender.org.
     

    Attached Files:

    Last edited: Aug 17, 2011
  2. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    Does this mean we get easy animation support from Blender?
     
  3. w00dn

    w00dn

    Joined:
    Apr 28, 2010
    Posts:
    275
    What's easy animation support?
     
  4. zine92

    zine92

    Joined:
    Nov 13, 2010
    Posts:
    1,347
    Means it can export animation to Unity via FBX. I read on the forum that some people are having problem exporting their animation on fbx files. But thanks for the scripts. :D
     
  5. w00dn

    w00dn

    Joined:
    Apr 28, 2010
    Posts:
    275
    Well I had no problems testing, but I only tried direct .blend import and default fbx export with all actions included. Both worked.
     
  6. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    Really? Did it save the animations separately or as one animation that you had to separate out manually?

    I haven't tried since Blender 2.55.
     
  7. w00dn

    w00dn

    Joined:
    Apr 28, 2010
    Posts:
    275
    Unity splits the actions/animations by itself and creates a nice list of animation clips on the root object, just as it should be. Works both with .fbx and direct .blend import.
    The only problem I encountered was some weird Blender crashing on direct .blend import to Unity. It was related to old settings I merged from 2.57. I had to reset Blender 2.59 to factory defaults and redo my settings manually.

    proof attached :p
     

    Attached Files:

    Last edited: Aug 13, 2011
  8. SomeGuy22

    SomeGuy22

    Joined:
    Jun 3, 2011
    Posts:
    722
    Wow thanks!

    Now I must try!
     
  9. Dantus

    Dantus

    Joined:
    Oct 21, 2009
    Posts:
    5,667
    woodn, thank you very much! I hope Blender's api for the fbx export is going to be stable soon, such that it is not anymore necessary to provide those scripts. But until then it's very useful. Thanks!
     
  10. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,553
  11. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    @woodn - Does this script break 2.49 support?
     
  12. w00dn

    w00dn

    Joined:
    Apr 28, 2010
    Posts:
    275
    @bigkahuna: I don't think it'll break 2.49 support, but I haven't tested it, sorry. (there are some lines in the script specific to 2.49)
     
  13. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,664
    Woodn: Thanks for sharing. Works a treat.

    May I pry and ask why you are suggesting D/L'ing from graphicall.org? I usually D/L direct from blender.org.
     
  14. w00dn

    w00dn

    Joined:
    Apr 28, 2010
    Posts:
    275
    @Little Angel: The offical blender builds weren't yet available at the time, but now they are and I updated the original post. Still, the builds from graphicall.org often are further developed and include bugfixes and useful stuff earlier than the offical builds. Stuff like the uv-helpers or color palettes for vertex/weight painting or planet textures and other things that are not quite ready yet but still usable.
     
  15. temp_account

    temp_account

    Joined:
    Apr 24, 2011
    Posts:
    6
    Thank you for this, it works perfectly!
     
  16. jeanRicK

    jeanRicK

    Joined:
    Sep 23, 2010
    Posts:
    4
    This works! Thanks! :)
     
  17. saymoo

    saymoo

    Joined:
    May 19, 2009
    Posts:
    850
    what is this? i mean blender already supports fbx just fine ;)
     
  18. w00dn

    w00dn

    Joined:
    Apr 28, 2010
    Posts:
    275
    @saymoo It's a script for Unity to directly import .blend files located in your assets folder. It communicates with your Blender 2.59 installation in the background, exports the needed fbx automatically and stores them in Unity without cluttering your assets folder. It's amazingly convenient. But this script had to be updated quite a few times the last months because Blender had gone through a lot of Python API changes. This one works with the latest version of Blender 2.59. It is now obsolete, because Paulius from Unity released the official version of the script in this thread.
     
  19. rokstar234

    rokstar234

    Joined:
    Mar 29, 2011
    Posts:
    94
    tried with 2.59 Unity3.3 64bit so people who still have 3.3 should upgrade. the weird thing here is that, unity 3.3 supported 2.58 fine until recently. what could cause this? A System update?
     
  20. darek

    darek

    Joined:
    Jun 17, 2011
    Posts:
    9
    Both scripts (from this thread and Paulius'es) doesn't work properly. Some random objects looks okay in scene view, but disapears (or won't rotate) in game view.
    Mac, Unity 3.4f05, Blender 2.59 64bit

    edit: actually looks okay in "raw" game view, but resets to identity just after Play pressed.
     
    Last edited: Aug 25, 2011
  21. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    I just made a couple of models and created some basic animations with Blender 2.59 (official stable version download from Blender org). I ran the new unity conversion python and mostly works. There are however a couple issues I found:

    On certain animation, like walking with a robot, original animation from Blender is more 'realistic', The small rotation action on the end points (like foot) was able to show. Same animation I imported to Unity 3.4 only show very moderate action, seems like some frames were cut-out when I compare it to the Blender animation view. This happened even without keyframe reduction or compression. I did however, exported the fbx with the default keyframe optimizing.

    I also applied materials to designated mesh faces. Those got converted alright, no problem. However, I am having problem adding bump from Unity to the designated converted face area. I am not sure if this is related to the converter.

    Here is a youtube link showing the animation differences.

    http://www.youtube.com/watch?v=u2QBzqeeMJU
     
    Last edited: Aug 26, 2011
  22. cerebrate

    cerebrate

    Joined:
    Jan 8, 2010
    Posts:
    261
    your problem is that your armature is affecting the mesh twice. that is why the bones are not matching up with the mesh in blender.

    When it gets exported to unity, unity has the armature only affecting the animation once (as it should), and thusly the animation you are seeing is the animation that you _should_ be seeing in blender as well. Go to the mesh modifiers panel. You should see probably two different modifiers that are both of the 'armature' type. remove one of them. blender will now match up with unity.
     
  23. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    cerebrate,
    You are right, I got more than 1 armature modifier in Blender. I took them out and the animations seem reflecting in Unity correctly. Thanks for the reply and thanks for the new converter. I will further investigate the bump map issue.
     
  24. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,553
    Can anyone confirm this? Paulius' thread doesn't mention that the attached script works for Blender 2.59. His update seems to talk about 2.49

     
    Last edited: Sep 5, 2011
  25. tumitoto

    tumitoto

    Joined:
    Aug 14, 2011
    Posts:
    66
    I tried it with the 2.59 stable version and it works on mesh/animation/face materials and such. I haven't try the UV and texture yet.
     
  26. vortex69

    vortex69

    Joined:
    Feb 4, 2010
    Posts:
    92
    yes it does, look closer at the last post:

    Which means that the script attached to that post is the one that will ship with 3.5
     
  27. Twistedsheep

    Twistedsheep

    Joined:
    Mar 15, 2010
    Posts:
    5
    Hey Darek, The issue you're running in to is the blender to unity script by default exports an animation layer even if you haven't set any animation keys. To fix this, when you place the mesh object in your unity scene, check its attributes in the inspector and unless it's supposed to be animated, uncheck the Animation check box. This should stop your mesh from snapping back to its default location in the scene when you run the game scene.

    I wonder if the script could be modified to disable animation exporting unless something specific is done inside the scene, such as renaming the default animation layer name or something.
     
  28. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,553
    yes his post talks about unity 3.5 and blender 2.59. but I'm talking about unity 3.4 (what we have now) and blender 2.59. that's what got me confused.
     
  29. cerebrate

    cerebrate

    Joined:
    Jan 8, 2010
    Posts:
    261
    it works with 2.59. I'm using it right now.
     
  30. TehWut

    TehWut

    Joined:
    Jun 18, 2011
    Posts:
    1,577
    Works great thanks. Using Blender 2.59 with Unity 3.4
     
  31. d.eisenga

    d.eisenga

    Joined:
    Sep 14, 2011
    Posts:
    43
    Hey guys, I'm not new at 3D or Blender but I've only been using Unity for a short while and I've been pretty successful in importing an animated character, but there are a few things I am unable to solve by Googling them:

    1: When importing an animated model (either by exporting to FBX from Blender of by importing the .blend file directly into Unity) the model is animated just fine and it has the different animations separated properly, but the FBXImporter doesn't show me a list of animations with settings for each one, as seen on this page, even though my settings under Animation are the same.

    2: The imported animations all have an extra keyframe on the end that's not there in Blender, as if the Loop option was checked for each of them. Supposedly this could be fixed if #1 was solved, but if that's a problem that might require an update to blender's exporter it would be nice to have a solution to use until then.

    Thanks in advance!
     
  32. cerebrate

    cerebrate

    Joined:
    Jan 8, 2010
    Posts:
    261
    the reason you're not seeing those options is because you haven't added them yourself. what shows on that page is if you do all your animations in one really long animation, rather than as several separate actions. If you did this, then you would need to specify where the individual animations start and stop.
     
  33. d.eisenga

    d.eisenga

    Joined:
    Sep 14, 2011
    Posts:
    43
    Ugh, I can't believe I didn't see the little + there! Thanks for replying. Any idea what's causing the extra keyframe at the end or how to get rid of it?
     
  34. AndrewGrayGames

    AndrewGrayGames

    Joined:
    Nov 19, 2009
    Posts:
    3,821
    I'm having serious issues baking UV maps in Blender 2.59. I've created a human woman mesh, assigned textures to specific faces, unwrapped regions to a defined texture file, but EVERY TIME I try to bake a UV map, it won't do it.

    I've linked a copy of my .blend file here, because I've been trying to figure this out for two days. I needz halp!!!1

    Also, has anyone encountered something like this?
     
  35. d.eisenga

    d.eisenga

    Joined:
    Sep 14, 2011
    Posts:
    43
    Asvarduil: It seems all faces with the skin material (except the head) haven't been unwrapped, they all occupy your full UV layout.
     
  36. carlflor

    carlflor

    Joined:
    Oct 11, 2011
    Posts:
    2
    I have a problem with importing the animation too. Im using Unity v3.4.0f5 and Blender 2.59 (stable version) (both are in 32 bit)

    To import my mesh, I just place the .blend file in my assets folder and used it from there. It reads the two animations I made which are Idle and Move. When I tick 'Play Automatically' it plays whatever is on my 'Animation' property

    When I added Third Person Control and placed Idle and Move to the corresponding properties, it just played the animation that was on my 'Animation' property... so I unchecked the 'Play Automatically' but it didn't play any animation at all.

    The model on the left is the one with Play Automatically checked
    while the model on the right is the one unchecked. Please help me, Im new to Unity D: Thank you for your time!! :)


     
  37. carlflor

    carlflor

    Joined:
    Oct 11, 2011
    Posts:
    2
    I inserted the Idle animation to the Jump Pose Animation and it worked!!!!

    I have a new problem though.... after it jumped the animation for idle stopped moving... it seems stuck on its first frame.
    when I move, it changes animation but is also stuck on the first frame :(
     
  38. Azazeo

    Azazeo

    Joined:
    Oct 12, 2011
    Posts:
    23
    Still need help.
    Using different Blenders (2.59 from Blender.org and freshest release from Graphicall.org) and Paulius'es script I cannot import animations into Unity (3.4.1).
    Only one default animation seems to be exported. So I had to put all animations to one action and then split it in Unity. Please help, and sorry for my poor english