Search Unity

Animated Maya fbx export with joints in Unity

Discussion in 'Asset Importing & Exporting' started by maccer, May 8, 2013.

  1. maccer

    maccer

    Joined:
    Mar 14, 2013
    Posts:
    6
    Hi,

    Apologies in advance for how basic this question might be. I'm trying to export an animated Maya model (animated by rigid binding skin) to FBX for use in Unity. When opened in Unity, the FBX (2011) file does not look proper at all.

    I've managed to go through the process of importing animated fbx models to Unity already, but they did not involve joints.

    Here is a look at the problem: http://i.imgur.com/za1sIJW.png

    Any help would be appreciated, I am VERY new to Unity and would really love anything you have to offer.

    Thanks,
    Maccer
     
  2. proandrius

    proandrius

    Unity Technologies

    Joined:
    Dec 4, 2012
    Posts:
    544
    It's hard to understand the problem from that screen but:

    1. You need to bake animations from Unity (by checking checkbox in the import settings).
    2. Try using maya binary save file (mb,ma) in Unity, see how they looks like.
    3. Don't trust preview window, drag object in the scene in see how everything looks.
     
  3. maccer

    maccer

    Joined:
    Mar 14, 2013
    Posts:
    6
    1. So while baking the animations I should be selecting both, ie. exporting all?
    2. I've tried with both maya and fbx files and unfotunately I'm getting the same thing!
    3. Same in scene as in the preview window. Interestingly those polygons that do seem to work, when viewed in the animation preview in Unity will animate.

    One thing I suspect I may have buggered up was not freezing transformations for polygons before animating them in Maya.

    Also a quick note: If there is a way of removing joints but keeping the polygon animation in Maya, that would suit me well- as this is the only animation the model needs. Worst case scenario I could remove the joints and re-animated using polygon rotation but I would rather avoid that!
     
  4. proandrius

    proandrius

    Unity Technologies

    Joined:
    Dec 4, 2012
    Posts:
    544
    Try these things:

    In Maya:
    Edit->Delete All by Type->History
    Edit->Delete All by Type->Non-deformer History
    Attach skin to the mesh once again and all the animation stuff.

    In Unity:
    Import to Unity.
    Select that file, in Inspector Import Settings, select RIG tab, choose animation type: Legacy
    In animation tab add checkbox Bake Animations.
    Apply and Drag object to the scene

    See what happens.
     
  5. maccer

    maccer

    Joined:
    Mar 14, 2013
    Posts:
    6
    Hm, I've given that a shot a few times and when I get to the Unity section, I choose Legacy, but 'Bake Animations' is always greyed out...

    Thanks to your Maya instructions, I could get the joints and mesh (I froze the transforms when the polygons were not bound) to view properly in Unity when separated if I didn't bind the skin to the skeleton.The joints can animate in Unity without anything attached to them.

    The only problem is getting these polygons to follow joint animation in Unity. I should still be exporting the FBX from Maya with baked animation, correct?
     
  6. proandrius

    proandrius

    Unity Technologies

    Joined:
    Dec 4, 2012
    Posts:
    544
    Well I always use mb files and I don't bake animations in Maya, I bake them in Unity import settings.
     
  7. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    358
    You can't use rigid bind in maya and export to a game engine. You must use smooth bind and paint all the skin weights.
     
  8. JeremyBenson11

    JeremyBenson11

    Joined:
    May 9, 2013
    Posts:
    37
    I know it helps me to bake the keys in Maya before exporting the fbx. Not sure how much of an effect that will have.. but I always go into the hyper graph hierarchy select all my joints and then go to Edit -> keys -> bake simulation... that will put a key frame every step of your timeline..

    FBX settings

    General Options - > check default file extension
    under include -> only smooth mesh is checked and reference container content
    under animation - > check animation
    under bake simulation -> check bake simulation
    under deformed models - > deformed models and skin is checked (although I don't believe you can use deformed models
    uncheck cameras and uncheck lights
    scale factor - > centimeters
    FBX file format -> ASCII
    FBX -> 2013

    works like a charm although I have to import texture maps separately.
     
  9. maccer

    maccer

    Joined:
    Mar 14, 2013
    Posts:
    6
    Thanks a lot for the help, everyone. I ended up removing the joints and animating the polygons individually (luckily the model was VERY simplistic), due to a deadline I had. However I'm definitely going to experiment with the suggestions given here in future!
     
  10. wolfganghendrix

    wolfganghendrix

    Joined:
    Aug 22, 2014
    Posts:
    1
    Have you had a chance to see if any of that worked?

    I'm still interested in seeing a different outcome to this scenario.
     
  11. rb.moyer

    rb.moyer

    Joined:
    May 17, 2014
    Posts:
    1
    So on a current job I came across a similar situation in which all of my bones in the rig, minus the root were collapsing in on themselves. The problem I found was an attribute setting in the bones from Maya. It's a check box called Segment Scale Compensate. It's also a check box in the joint creation menu. You want this turned off. Otherwise with Unity not supporting it, all your bones kind of collapse into a singularity of sorts. Hope this helps any of you with a similar problem. I only found it myself by checking the fbx import warnings and errors in unity. Good luck!
     
    agito1987 likes this.
  12. agito1987

    agito1987

    Joined:
    Mar 13, 2013
    Posts:
    27
    Had the same problem. was stuck for 2 days, thank you!!