Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Blender > Unity Rotation Fix

Discussion in 'External Tools' started by Mirgar, May 11, 2013.

  1. lohner

    lohner

    Joined:
    Jul 3, 2013
    Posts:
    4
    BRILLIANT!!! This was a problem I planned on tackling latter in development and I stumbled upon this. Thanks so much! BTW it works with Blender 2.7 & Unity 4.5.1f3
     
  2. bitoffdev

    bitoffdev

    Joined:
    Aug 12, 2013
    Posts:
    43
    This is very helpful and a huge time saver! I just tested it with Blender 2.7.1 and it worked great.
     
  3. Fritsl

    Fritsl

    Joined:
    Mar 10, 2013
    Posts:
    184
    I love you.
     
  4. Shaba1

    Shaba1

    Joined:
    Jan 21, 2010
    Posts:
    48
    I have a question. If I used this addon on a humanoid mesh that has an armature and animation in blender will not the animations be messed up. i.e if the character has a walking animation will he then not be walking up a wall in blender and in unity will he not be facing the right direction until you play an animation then be walking either away from the front view or up the unity global y axis?
     
  5. Mirgar

    Mirgar

    Joined:
    Aug 6, 2012
    Posts:
    21
    If you converting existing character that is rigged, you should only apply fix on armature, mesh should have no additional rotation. Animations works fine, and rig should be updated only if you use drivers.
     
  6. tomandjerry-tas

    tomandjerry-tas

    Joined:
    Feb 7, 2013
    Posts:
    23
    This is really helpful, thanks. :)
     
  7. Johannahe

    Johannahe

    Joined:
    Jan 31, 2015
    Posts:
    13
    Does this thread deal with this kind of problem that occurs to me while bringing an FBX from Blender to Unity?
    I am not really sure. It would be nice if somebody could tell me if that is actualy the problem that is being discussed here.
    Thank you.
     
  8. Mirgar

    Mirgar

    Joined:
    Aug 6, 2012
    Posts:
    21
    No, I don't think so. This plugin fixes rotation problem when your model lies on its face when imported from Blender to Unity. In Blender -Y axis is forward, script brute forces it to be +Z like in Unity.
     
  9. VectorSigma

    VectorSigma

    Joined:
    Dec 22, 2014
    Posts:
    3
    Great add-on. Saved me tons of time. Thank you.
     
  10. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    949
    It would be sure nice if this issue was resolved in Unity; but, here is another little workaround which some may like:
    1. Open model in Blender.
    2. Add empty object at origin.
    3. Save as .blend file.
    4. Import into Unity; rotation all good but redundant empty game object in scene. Delete, save as prefab :)
     
    Freezy likes this.
  11. Freezy

    Freezy

    Joined:
    Jul 15, 2012
    Posts:
    232
    I still prefer the script I posted on the previous page.
    But indeed it would be nice if Unity implemented a fix for something as silly as this issue.
    Or at least post a reason why it is not being fixed.
     
  12. cjdev

    cjdev

    Joined:
    Oct 30, 2012
    Posts:
    42
    This is perfect, just what I was looking for. Thanks for your work.
     
  13. dxb2010

    dxb2010

    Joined:
    Nov 5, 2013
    Posts:
    6
    I thought I was going mad till I did a search and found this utility. Thank you for sharing it!
     
  14. alecie

    alecie

    Joined:
    Sep 2, 2013
    Posts:
    73
    This is perfect, thank you!
     
  15. RobG88

    RobG88

    Joined:
    May 28, 2015
    Posts:
    18
    Wondering if anybody can help.
    I'm not a blender user and just a Unity beginner.
    I have installed, enabled and can see MISC, Unity Tools

    BUT

    After opening the blender file that I want to modify the MISC tab disappears.

    I can still see that the add-on is installed and enabled but there doesn't seem to be any way to get to it.

    I tried opening the script in the text editor and RUN SCRIPT but that didn't do anything for my either.

    Any help would be most appreciated - trying to fix this Unity/Blender issue is just horrible!
     

    Attached Files:

  16. unityISgarbage

    unityISgarbage

    Joined:
    Aug 26, 2015
    Posts:
    2
    could you walk me through the installation proccess, i dont seem to have any of the tabs or buttons youre mentioning in your instructions
     
  17. unityISgarbage

    unityISgarbage

    Joined:
    Aug 26, 2015
    Posts:
    2
    oH it works but i lost the mirrored work.
     
  18. Brosi91

    Brosi91

    Joined:
    Oct 23, 2015
    Posts:
    1
    Hey!
    I absolutely love the add-on, but I've got a little problem with it:
    I used it in blender 2.6ish version and it worked properly, but since I updated to 2.74 it just won't show. I even downloaded and reinstalled the file, and it gets shown as an add-on in the user-preferences, but it just won't show up in the Tool Shelf.
     
  19. VOTRUBEC

    VOTRUBEC

    Joined:
    Dec 17, 2014
    Posts:
    42
    Working with Blender 2.76b. Mirgar, thanks for this!
     
  20. Dabjulmaros

    Dabjulmaros

    Joined:
    Nov 23, 2015
    Posts:
    1
    Thanks. You saved me from a big headache.
     
  21. kennyk3n

    kennyk3n

    Joined:
    Dec 8, 2015
    Posts:
    1
    Thanks I was about to lose my mind trying to get the rotations right
     
  22. bluo100

    bluo100

    Joined:
    Apr 15, 2015
    Posts:
    4
    thank you, thank you, thank you, thank you, thank you, thank you, thank you! I can finally use Blender instead of expensive Maya! xD
     
  23. JamieG83

    JamieG83

    Joined:
    Feb 28, 2013
    Posts:
    1
    Script is working well for me, thanks very much for sharing. :)
     
  24. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    385
    Thanks dude! Blender should add this add-on to their offical release lol
    I can't believe this problem still exists after so many years though, thank you Unity : \
     
  25. abcNocturn

    abcNocturn

    Joined:
    Dec 16, 2016
    Posts:
    6
    Hey guys,
    can't find the menu point either :/
    Can anybody provide a simple screenhot maybe ?
     
  26. occulus1975

    occulus1975

    Joined:
    Jan 7, 2017
    Posts:
    4
    Had the same problem myself in Blender 2.78. After you install the plugin, make sure that there's a checkmark in the box for it under "Addons -> Object -> Object: Unity Tools" in user preferences AND THEN SAVE YOUR PREFS. If you don't save the prefs, it will vanish when you close Blender.

    Once you do that, it should be on the vertical toolbar under "Misc" at the far left of the Blender UI (it gets its own tab, among those which sit at the extreme far left of the Blender window).
     
  27. zt3ff3n

    zt3ff3n

    Joined:
    Feb 19, 2016
    Posts:
    17
    I am getting a Error message: “expected an indented blockon blender 2.76 osx, when trying to enable the addon.
     
  28. Garrom

    Garrom

    Joined:
    Oct 26, 2016
    Posts:
    45
    Ha, thanks for this awesome addon, my Blender => Unity3D imports using FBX aren't screwed anymore, thanks men.
    (Using Blender 2.78a and Unity3D 5.5.0f3)
     
  29. UziMonkey

    UziMonkey

    Joined:
    Nov 7, 2012
    Posts:
    206
    I've found the solution to this is actually really easy. I'm not sure if this works 100% of the time, but if you rotate your model by -90 degrees on X in Blender, apply rotations and rotate by 90 on X again it will appear correct in Blender and by 0 rotations in Unity. It takes 2 seconds to do, I haven't found the need for an addon or anything to solve this.
     
    n0ff likes this.
  30. mrflippy

    mrflippy

    Joined:
    Jan 21, 2017
    Posts:
    4
    This script fixes the local axis directions for me, but my objects end up facing backwards when I import into Unity. (local forward is opposite of global forward) Is this expected or am I doing something wrong? I guess it may not matter that much since I'll probably rotate the objects when placing them in scenes anyway.
     
  31. AutoRotate

    AutoRotate

    Joined:
    Aug 1, 2014
    Posts:
    133
    I know this is an old thread but wanted to say thank you very much (@Mirgar and @Freezy) for this! Saved me a lot of strained brain cells.

    Those who can't find the tool after installing the add-on, press T, and click misc tab. It is under Unity Tools. Simple rotation works perfectly for me. If you are having issues with scales (E.g. having random scales etc..), when exporting as FBX, be sure to Un-select the little button next to "Scale". If you mouse over it, it will say "Scale all data according to current blender..."
     
    Freezy likes this.
  32. Freezy

    Freezy

    Joined:
    Jul 15, 2012
    Posts:
    232
    It is really weird that Unity still has not fixed this issue XD
     
  33. planarbit

    planarbit

    Joined:
    Jul 22, 2016
    Posts:
    4
    Unfortunately didn't work for me (Blender 2.78). Perhaps doing something wrong.

    Here are things I tried (for Unity_tools.py):

    CASE 1:
    1. select object in object mode
    2. click "Simple rotation fix" / "Full rotation fix"
    3. nothing happens!
    CASE 2:
    1. run through Python console bpy.ops.object.unity_rotation_fix_x()
    2. getting error
      RuntimeError: Operator bpy.ops.object.unity_rotation_fix_x.poll() failed, context is incorrect
     
  34. unity_KJzEs-OtBSvRTg

    unity_KJzEs-OtBSvRTg

    Joined:
    Dec 5, 2017
    Posts:
    1
    I have no idea what your script does, but it does work ! Thanks a lot ! You're saving me much time.
     
  35. Dispa

    Dispa

    Joined:
    May 8, 2015
    Posts:
    3
    Doesnt work in unity 2017.3 with 2.79 blender :(
     
  36. Mirgar

    Mirgar

    Joined:
    Aug 6, 2012
    Posts:
    21
    I just tested it moment ago with newest versions of both Blender and Unity and it works correctly. Are you sure you're exporting your model correctly?
     
  37. Dispa

    Dispa

    Joined:
    May 8, 2015
    Posts:
    3
    wait a moment. so we should export the object to .fbx? i think it will fixed how unity synchronize with blender's axis
     
  38. Mirgar

    Mirgar

    Joined:
    Aug 6, 2012
    Posts:
    21
    I mainly use .fbx format but exporting using collada produces the same results for me too. Same with saving .blend directly in project's assets folder. If you're still having issues, can you describe how you export your models into your project?
     
  39. meat5000

    meat5000

    Joined:
    Mar 5, 2013
    Posts:
    118
    Last edited: Mar 7, 2018
  40. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    197
    for Blender 1.80 BETA here's the working fix
     

    Attached Files:

  41. AutoRotate

    AutoRotate

    Joined:
    Aug 1, 2014
    Posts:
    133
    I just updated to blender 2.79b and It seems like the scale problem is, well, no longer a problem. However, I still have to use that tool for rotations for grouped objects. It works fine if the model is one mesh and no grouping.
     
    Vincent13122 and the_motionblur like this.
  42. Casperthestoner

    Casperthestoner

    Joined:
    Nov 4, 2018
    Posts:
    1
    Thank you, this has solved the problem I was having.
     
  43. matthew798

    matthew798

    Joined:
    Feb 4, 2014
    Posts:
    5
    Thank you so much!!! It was so annoying to have to tweak rotation after importing literally ANYTHING from unity! I can confirm that using the "simple rotation fix" works perfectly on blender 2.79.
     
  44. jensen_305

    jensen_305

    Joined:
    May 15, 2018
    Posts:
    19
    I am so glad this page is still coming up when searching blender. This helped so much.
     
    dan_wipf likes this.
  45. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    197
    it’s a life saver :)
     
  46. Tymianek

    Tymianek

    Joined:
    May 16, 2015
    Posts:
    11
    Good addon, I recommend
     
    dan_wipf likes this.
  47. AlbertStr

    AlbertStr

    Joined:
    Feb 12, 2014
    Posts:
    13
    Heya guys!

    Here you have an updated version of the addon for Blender 2.8 Release Candidate
     

    Attached Files:

  48. CoughE

    CoughE

    Joined:
    Oct 26, 2015
    Posts:
    24
    Thanks a bunch! I had to delete the old add on and then install this one, otherwise it didn't seem to register the change in Blender 2.80
     
  49. Agoxandr

    Agoxandr

    Joined:
    Aug 16, 2014
    Posts:
    2
    Someone messed up here. Everything is upside down.
    Edit: Tried fixing it. No clue what to do. Didn't work
     
    Last edited: Aug 10, 2019
  50. TheGabmeister

    TheGabmeister

    Joined:
    Jun 4, 2015
    Posts:
    9
    Fixed the issue for the latest Blender 2.8 stable release. For the guys here who downloaded Unity Tools 280RC.rar above, you just need to reverse the rotation operations along the X-axis. Open the addon using a text editor and change the following code:

    Code (CSharp):
    1. value = -1.5708
    to
    Code (CSharp):
    1. value = 1.5708
    and then the other values
    Code (CSharp):
    1. value = 1.5708
    to
    Code (CSharp):
    1. value = -1.5708
    Hopefully the author uploads an update.
     
    CoughE and Griz like this.