Search Unity

Unity Maya - Animations are different once imported

Discussion in 'Animation' started by Vire, Apr 28, 2013.

  1. Vire

    Vire

    Joined:
    Jun 17, 2012
    Posts:
    178
    Hi,

    I baked out my animation in maya, exported as fbx, made a new scene, imported the fbx, and it was fine.

    I import that same fbx into unity and anywhere that a hand was parent constrained to an object such as the hips or the other hand (two handed weapon) it isn't acting properly. It is always roughly where it's meant to be but not quite in the right place and intersects with his hips as a result in the idle animation or is off-target on the weapon swing. Keep in mind all constraints are deleted at this point and it's only geometry and skeleton and it works fine inside of maya.

    So why can't unity handle it? I can not make my animations without these constraints on the hand, it is impossible.
     
    BeneHogue likes this.
  2. Vire

    Vire

    Joined:
    Jun 17, 2012
    Posts:
    178
    Still need some help.
     
    BeneHogue likes this.
  3. Gnimmel

    Gnimmel

    Joined:
    Apr 21, 2010
    Posts:
    354
    It's hard to tell whats up without seeing it, but bear in mind once you've baked your animations and removed all the IK etc. you only have rotation information posing your skeleton. This means a lot of your animation on things like the arms and legs move in arcs where as in maya you probably had IK moving them in straight lines. Even baked this wont show up in maya because you animated at 30 or 24 frames per second and maya only shows you those keyframes, while in unity your animations are playing at 60 frames a second or more meaning you will see the inbetween frames which don't show up in maya unless you also switch it to 60 frames per second. Things like 2 handed swords will never look the same because you can only parent the sword to 1 of the hands, so the other has inbetween frames which will cause it to move into the sword a little. Animation compression will also add to this problem.

    Not sure if that helped at all, but it's worth remembering when you set up rigs and animations.
     
  4. Vire

    Vire

    Joined:
    Jun 17, 2012
    Posts:
    178
    I'm aware of every point you made and actually...

    It's kind of my point - there is only rotation information on the skeleton. Yet when I import the FBX into maya it works fine. This FBX contains geometry and skeleton and of course the skin definition - nothing else, no constraints, no connections, nothing. And it works spot on.

    The moment that FBX hits unity, without animation compression, it's off target.


    And for your own information, you can parent constrain one hand (which would be in IK) under the other hand (which can be FK or IK) for two handed weapons, then the two handed weapon gets parent constrained under the the non-IK only hand. And it all moves together.

    Can anyone please tell me the answer to this riddle?
     
    BeneHogue likes this.
  5. Vire

    Vire

    Joined:
    Jun 17, 2012
    Posts:
    178
    This really isn't funny, why does no one help around here? It's an issue almost everyone should be running into if it's constraint based.
     
    BeneHogue likes this.
  6. VCC_Geek

    VCC_Geek

    Joined:
    Apr 30, 2013
    Posts:
    29
    It's entirely possible you could be running into a rotation order problem. I've run into that with Unity before. I would have a rotation order of ZYX, and then bring it into Unity and it would be off. I found that it always rotates in XYZ order no matter what order you specify in Maya. Also see which rotation interpolation you're using. Use quaternion if possible. Euler acts weird under certain circumstances, and that's beyond gimbal lock.

    You can also just save your Maya scene directly into your library, and Unity will automatically import it. That's how I do my assets. You might try that at least as a troubleshooting step to see if something's getting lost in the FBX conversion.
     
  7. DRayner

    DRayner

    Joined:
    Sep 11, 2012
    Posts:
    4
    Hello All,
    Just come across this myself. We have a Maya scene with a character holding a two handed weapon (across the chest - so more like an axe or rifle rather than a two handed sword or pistol where the hands are together). The weapon is parented to the wrist bone (not skinned) of the left wrist, and in Maya we have the right hand parented to the left wrist with an offset. The animation once baked looks correct in Maya - it still looks great after removing the constraint on the right hand ... but when I load this animation in Unity onto the character - low and behold during the animation cycle the weapon starts to creep into the right hand (the one that had the constraint). If there is an "error"/difference between the curve interpretation between Maya and Unity it will be very small.. but because the weapon is a child of the left wrist and the right hand is at the other end of the left wrist/weapon - essentially the end of an arc.. the error is even more pronounced - if that made sense.
    If there is any more info on this I would be most welcome to hearing it as this means we can't have closeup cutscenes without wandering hands/weapons. I'm going to look at VCC_Geeks suggestions of rotation order.. but I really am not looking forward to that as it means a great deal of re-export and potential re-work.
    Any other suggestions?

    Cheers,
    D
     
  8. Vire

    Vire

    Joined:
    Jun 17, 2012
    Posts:
    178
    VCC_Geek's solution wont help you. The skeleton I bring out of Maya has all XYZ rotations because it is a slave to the actual rig skeleton via constraints. I never found a solution.

    Best of luck.
     
  9. SomeDude

    SomeDude

    Joined:
    Feb 16, 2012
    Posts:
    95
    This is worrying that it's been 7 months and it's still not fixed? Have you submitted a bug? I haven't started using Unity yet but will in the near future. With Maya being so popular for animation how is this not fixed yet?
     
  10. eafreak

    eafreak

    Joined:
    Jan 28, 2014
    Posts:
    5
    Hello

    Ever found a solution to this? I am getting same problems, but used Modo to export the fbx... However, re-importing to modo or maya (trial) the animation looks fine...
     
  11. Vire

    Vire

    Joined:
    Jun 17, 2012
    Posts:
    178
    Hi,

    I never found a solution and still desperately need one.
     
  12. esmith08

    esmith08

    Joined:
    Jun 11, 2013
    Posts:
    1
    I'm having similar issues as well. Character animations(FBX) look fine in Maya/MotionBuilder, but lose their precision once imported into Unity as FBX.
    The Joint rotations just seem to be slightly off in Unity. And turning off compression doesn't help. I've trial-and-errored the heck out of this to no avail.
     
  13. Vire

    Vire

    Joined:
    Jun 17, 2012
    Posts:
    178
    Yep same here. There is literally nothing left to try. Doesn't matter what file format for the record, importing the maya file directly results in the same issue.
     
  14. danybittel

    danybittel

    Joined:
    Aug 1, 2013
    Posts:
    68
    Did anyone find a solution to this?
    I've run (probably) into the same problem.
    When exporting a rig with animation from Houdini, some rotations are a couple degrees (around 10°) off in unity.
    Importing it to Houdini works. (Tried different rotation orders, all is baked)

    Using Unity 5.3.2f1
     
  15. theazz

    theazz

    Joined:
    Oct 20, 2013
    Posts:
    56
    Under generic, humanoid, or both?
     
  16. danybittel

    danybittel

    Joined:
    Aug 1, 2013
    Posts:
    68
    It's a generic rig.
     
  17. danybittel

    danybittel

    Joined:
    Aug 1, 2013
    Posts:
    68
    Ok Humanoid rig does not have that problem. I will run with this then. Thanks.
     
  18. knight91

    knight91

    Joined:
    Apr 14, 2016
    Posts:
    1
    I did have the same problem. When you import the .fbx file in unity on the animation tab there are two options named "resample curves" and "anim. compression", I turned both off and then my animations played exactly the same as in maya.
    Hope it helps.
     
unityunity