Search Unity

Y axis from Max to FBX

Discussion in 'General Graphics' started by GiG, Jan 6, 2015.

  1. GiG

    GiG

    Joined:
    Dec 9, 2014
    Posts:
    6
    Hi guys,
    I am doing a few tests before starting my project, and I am stumbling again and again on a problem I have since I was working with XNA years ago.
    In Max the UP axis is Z, and when I convert my model, a spaceship, to FBX I can choose which is the UP axis, Y or Z: whatever I select, my model in Unity appears not correct, in the preview window the spaceship nose points downwards, and when I drag it into the scene it appears with the correct orientation, because X rotation in the Transform component is automatically set to -90.
    Am I missing something in the conversion process?
    You can test my FBX (and MAX source) attached here.
     

    Attached Files:

  2. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Hey GiG - welcome.
    There's a lot of info on this throughout the forum. It's been asked before a couple times. Just need to search for it.

    I'll give you a hint though - create all assets in the front viewport - export Y up.
     
  3. GiG

    GiG

    Joined:
    Dec 9, 2014
    Posts:
    6
    You mean I have to use the front view to create the model from above?
    Well, I have explored the forum already, but I have found different workarounds that don't fix my problem, apart for one: rotating the (master) pivot by 90° on the X axis (green arrow up) the model is exported correctly, independently from Yup or Zup setting in the exporter settings.
    I wonder if this method will cause problems in the future...
     
  4. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    When I say create in the front viewport Im just talking about when you first create an object (from the create panel).
    You can edit the object after that in any viewport.

    Creating objects in the front viewport establishes the proper local coordinates to later play nice when you export as fbx with Y up and into Unity.

    To your question - yes this will cause problems in the future when you have a rigged character (any hierarchy with parent child relationhip) with animation data where you cant adust master pivots of the bones / or edit the pivot of the skinned mesh.
    Best to just start the creation of all assets including bones in the front view port.

    I dont have my notes available but I think the absolute local coordinates for objects upon creation in max should read 0, 0, -90 on objects before export. Creating objects in the front viewport sets the local coordinates to this automatically.
    Another artist can correct my numbers if they are wrong.

    For static mesh objects your work around shouldnt have future issues.
     
  5. GiG

    GiG

    Joined:
    Dec 9, 2014
    Posts:
    6
    Well, I have tested your suggestion, and the result is: the model shows correctly in Unity, no autorotations and nothing.
    Green axis (Y) in the master pivot is vertical, as I set manually in the previous model, do you think this could be a problem?
     
  6. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Hey GiG I dont think the manual pivot adjustment will cause any future problems.
    May want to put a note in your dev document or somewhere about any mesh objects you adjusted manually - just in case you encounter oddities.
    The only instance I could forsee is if you put the manual adjusted pivots in a hierarchy but even then I dont think it would cause issues.

    Update if you run into future odd problems you suspect steming from pivot issues.
     
  7. GiG

    GiG

    Joined:
    Dec 9, 2014
    Posts:
    6
    Sure!
    And thank you for your time!
    I should try to start a discussion with the other 3DSMax users to compare different modelling techniques in relation to Unity.
     
  8. davidosullivan

    davidosullivan

    Joined:
    Jun 9, 2015
    Posts:
    387
    Yeah the problem with creating all your objects with an x value of 90 is that nested objects still dont animate properly when they come into Unity.

    So say you have three boxes on top of each other, and you want to hinge the second box open and move the third one with its lid, and then open the lid of the third one.

    If you make all the boxes so they are x90 and then parent the third to the second and the second to the first, when you import into Unity it will look fine, BUT the animation on the third box will be screwed up- instead of hinging upwards like the second box does it will start rotated the wrong way and then hinge down.

    Its a total cock up to be honest and something that has not been fixed since 2013

    Please help me in posting bug reports to get this nonsense finally sorted out!!
     
  9. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Hey david.
    I have not had the issue you state - though I admit I would perform this animation in Unity since its such a simple example.
    Personally (my opinion only) Unity has sufficient animation tools now to animate inorganic objects pretty well.
    While using Max for organic objects that are complex and would be controlled via bones and exported via fbx.