Search Unity

FBX Model importing in at -90 X rotation

Discussion in 'Editor & General Support' started by Disastercake, Sep 18, 2012.

  1. Disastercake

    Disastercake

    Joined:
    Apr 7, 2012
    Posts:
    317
    I have several (unskinned) models in 3DS Max. Whenever I import my models they come in at a X = -90 rotation. Resetting them to 0,0,0 makes them face down.

    I have exported my model using both Y axis and Z axis as the up. I have also reset the XForm.

    My modeler seems clueless as to why this is happening. Anyone have an idea?
     
  2. Kragh

    Kragh

    Joined:
    Jan 22, 2008
    Posts:
    657
    This is just how it is. Max and Unity uses two different coordinate systems, so some conversion will happen. If you want an object to be imported into Unity with no initial values on rotation, you'll have to make those initial values exist in 3ds Max:
    Push the "Affect Pivot only". Rotate X axis by 90 degrees, so that Y is pointing up.
    Then the object will have 0,0,0 as rotation values, when inported into Unity :)
    If your modeller make sure to always initiate modelling in top view in 3ds Max, local Y will be pointing upwards in Max automatically..
     
    gamecreatorc1 and Decordova360 like this.
  3. Disastercake

    Disastercake

    Joined:
    Apr 7, 2012
    Posts:
    317
    Thank you Kragh. I was going to actually do this, but I thought it might be a really sloppy hack around a deeper issue. Thanks for letting me know it's just more quirky 3D stuff.
     
  4. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I don't need to do any rotating in max. When exporting, I select "Y-UP" for axis, and it exports/imports fine. I always collapse transforms (etc) to clear up scaling, mirroring etc, though.
     
  5. Kragh

    Kragh

    Joined:
    Jan 22, 2008
    Posts:
    657
    Well, you don't need to set a rotation in max, and the model will come in just fine. But it will have a rotation in Unity on its x-axis at 270 degrees (-90). If you change this to 0, your model will be rotated compared to your max-scene. And that is just how it is. If you don't experience this, Jaimi, it's because you misunderstand what I speak about ;)
    So again; to have your model having 0,0,0 in your Unity transform rotation, you need to have it 90,0,0 in Max.
     
  6. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Ah, I see what you're saying. Everything looks correct, and the base game object is correct, but my biped is rotated at 270,90,0 just like you say.
     
  7. BrUnO-XaVIeR

    BrUnO-XaVIeR

    Joined:
    Dec 6, 2010
    Posts:
    1,687
    Maya rules! :) haha
     
  8. Mike4

    Mike4

    Joined:
    Oct 24, 2013
    Posts:
    92
    I cannot rotate at all my fbx exported from Blender. Any ideas?
     
  9. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    What do you mean by 'cannot rotate at all'? You cannot change the inspector values? You cannot rotate it via script?
     
  10. ekergraphics

    ekergraphics

    Joined:
    Feb 22, 2017
    Posts:
    257
    Old topic, but I also got stuck on this just now.

    In Blender, all transforms are at 0, and these exist FBX export options for choosing which axis should be forward and which should be up, but regardless of what I choose, the model comes into Unity rotate the wrong way.

    I need to wrap my head around this, but haven't managed yet. This must be a common problem with an easy solution? Both apps have coexisted for years now.

    The thing that's weirdest to me is that if I click on the model itself in the Project - Assets - Models list, before even adding it to the scene, I can see in the inspector that the X -90 rotation already there and greyed out! (And the model rotated the wrong way in the preview as well.)
     
    Last edited: May 15, 2017
    Tobin_ likes this.
  11. Drizzt128

    Drizzt128

    Joined:
    Mar 2, 2017
    Posts:
    1
    Hi, I had the same problem. It was very annoying! Finally, I was able to solve it making my 3D object as a child of a "empty" object making any transformation / rotation on it, not in the 3D imported model.
     
  12. zero_null

    zero_null

    Joined:
    Mar 11, 2014
    Posts:
    159
    that isn't really a solution. Everyone can do this. But there is no point of putting an empty game object when you can have your model exported correctly.
     
  13. rapidrunner

    rapidrunner

    Joined:
    Jun 11, 2008
    Posts:
    944
    Is still not possible to change transform when importing in Unity? I never got the reason why the transforms has to be locked; when they could be enabled and I would not need to go through EVERY single mesh I want to use, and correct the orientation.

    There are cases when you can't just generate a new empty object and place the mesh in it...
     
  14. io-games

    io-games

    Joined:
    Jun 2, 2016
    Posts:
    104
    zetingq and koikodo like this.
  15. Justin-Wasilenko

    Justin-Wasilenko

    Joined:
    Mar 10, 2015
    Posts:
    104
    @io-games Do you have a update version of this script that works with rigged models?
     
  16. io-games

    io-games

    Joined:
    Jun 2, 2016
    Posts:
    104
    sorry, no(
     
  17. Tony_T

    Tony_T

    Joined:
    Jul 4, 2018
    Posts:
    13
    I know it's probably a bit too late but I found a fix with 3ds max. Okay so I figured it out!
    1. In 3ds Max rotate your model -90 degrees on the axis that appears wrong within Unity. (For me it's the Z axis)
    2. Use reset XForm on the model in 3ds Max to reset it's rotation to 0.
    3. Rotate the model again 90 degrees in 3ds Max to bring it back to it's correct state.
    4. Export!
    For some reason Unity needs the model to have +90, if it doesn't it automatically rotates it... but if the model already has a +90 degrees rotation it does nothing and you end up having your model rotated correctly and it's transform all 0.

    Answer updated*
     
    Last edited: Dec 15, 2019
    frezer749 likes this.
  18. lclemens

    lclemens

    Joined:
    Feb 15, 2020
    Posts:
    761
    Thanks Tony_T for showing us how to do it in 3ds max. I think figured out how to do it in Blender...

    1. In Blender rotate your model -90 degrees on the axis that appears wrong within Unity. (For me it's the X axis)
    2. With the object selected, hit Control-A and then select the "Rotation" item in the context menu that appears near your cursor.
    3. Export!
     
    Tony_T likes this.
  19. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    Bug still exists in 2019.3 :( Has anyone submitted a bug report?
     
  20. io-games

    io-games

    Joined:
    Jun 2, 2016
    Posts:
    104
    it's not a bug. It's just different coordinates system in different 3d apps.
     
  21. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    700
    I know it needs to flip one of the axis to convert left/right handed coordinates, but other applications with different coordinate systems import just fine. Models certainly shouldn't be imported rotated on their side. It's a bug with either with Unity or 3ds Max.
     
    Haxel0rd likes this.
  22. viper110110

    viper110110

    Joined:
    Jan 19, 2014
    Posts:
    2
    I believe this is a bug as I've created two test cases in blender, both exported with FBX All, Y up, and Z forward.

    I've modelled a tree, which is imported on it's side, and I can see the rotation of the model in Unity set to (-89.98, 0, 0) and not changeable.

    When I add a plane as a separate object in blender and export them with the same settings, Unity orients them correctly. This is probably similar to the workaround of adding an empty parent object.

    This isn't an issue of a different coordinate system because whichever axis settings are chosen in blender seem to get undone in Unity, forcing the tree to be on its side.
     
  23. suleymanbucuk

    suleymanbucuk

    Joined:
    Mar 13, 2019
    Posts:
    11
    Too much old topic, but someone (for example me) still facing this issue,

    Here is my solution:

    Import your 3d model as it is, make that object a prefab in Unity, install Probuilder from Package Manager, open Probuilder window, select prefab, click Probuilderize from Probuilder window. At Scene window, upside of the screen, four objects appear, first is Object Selection, select it. Then rotate the object as you want to be seen on screen. Than select Freeze Transform from Probuilder window. Your objects rotation and transform is locked and set to 0, 0, 0 as it's shown on the screen.

    Hope helps a gamedeveloper.
     
    AmazingRuss likes this.
  24. Gatolino

    Gatolino

    Joined:
    Sep 1, 2013
    Posts:
    1
    I've just stepped into this same issue recently, and found that there is a good solution within 3DS Max.

    Just go to Hierarchy tab of your model, select "Affect Pivot Only"...
    Print1.png

    ...and rotate your axis, so that blue Z axis points the same direction as your "Front"...
    Print2.png

    Then in Unity you shall have your object correctly oriented, without nested empty objects fixing, nor -90 rotation on X (Instead, your X axis is probably going to be mirrored, but not a big issue though)
    Print3.png

    (One more tip: When exporting your model either by FBX Export or Game Export options, and you select "Export All", 3DS Max automatically creates an container object which "corrects" the rotation, but the problem persists when you look at any inner mesh)
     
  25. unity_EvhoZ4GQLOLR0Q

    unity_EvhoZ4GQLOLR0Q

    Joined:
    Nov 27, 2021
    Posts:
    1
    For Blender, when exporting in FBX, you only have to uncheck "Use Space Transform" (under Apply Unit), and 0,0,0 should be your rotation values in Unity.
     
    mothloths and ghenryschmitt like this.
  26. am_rg

    am_rg

    Joined:
    Oct 4, 2022
    Posts:
    3
    When exporting from Rhino find this option "Map Rhino Z to FBX Y" and select it:

     
  27. QuigsBigSpecGames

    QuigsBigSpecGames

    Joined:
    Apr 20, 2019
    Posts:
    39
    I had a problem where my fbx's from 3DS max were rotated incorrectly. The issue was that there was only 1 object in the fbx, if there was more than one object Unity brought them in, inside a holding, empty gameobject. This was the fix for me. For level etc I would add a 1x1x1 cube at 0,0,0. It was easy to remove, after import.