Home Technical Talk

Maya animations to Unity, FBX issues changing the animation.

Hey guys,

I'm trying to import a character into Unity that I rigged and animated and am exporting as an fbx. The animations work and the character imports fine but I am having a weird issue where the feet are raising above the ground when they shouldn't be.

p3gv.png

On the left is the original file and the right is the fbx, showing the feet lifting off the ground. We have 7-8 different animations and are having the exact same issue in all of them. I figure it must be an export problem or a rig problem but for the life of me I can't find the issue.

Any help would be appreciated.

edit: here is a warning it is giving

101 attributes had complex animation. Complex animation was exported as baked curves. (8080 evaluations done)
The plug-in has changed some animation curves tangents type to User to ensure interoperability. This mode change will not affect the animation curves' values

Left_LegCTRL_translateX
Left_LegCTRL_translateY
Left_LegCTRL_translateZ
Left_LegCTRL_rotateX
Left_LegCTRL_rotateY
Left_LegCTRL_rotateZ
Hips_CTRL_translateX
Hips_CTRL_translateY
Hips_CTRL_translateZ
Hips_CTRL_scaleX
Hips_CTRL_scaleY
Hips_CTRL_scaleZ
Hips_CTRL_rotateX
Hips_CTRL_rotateY
Hips_CTRL_rotateZ
Chest_CTRL_translateX
Chest_CTRL_translateY
Chest_CTRL_translateZ
Chest_CTRL_rotateX
Chest_CTRL_rotateY
Chest_CTRL_rotateZ
Left_ArmCTRL_translateX
Left_ArmCTRL_translateY
Left_ArmCTRL_translateZ
Left_ArmCTRL_rotateX
Left_ArmCTRL_rotateY
Left_ArmCTRL_rotateZ
Right_ArmCTRL_translateX
Right_ArmCTRL_translateY
Right_ArmCTRL_translateZ
Right_ArmCTRL_rotateX
Right_ArmCTRL_rotateY
Right_ArmCTRL_rotateZ
Head_CTRL_translateX
Head_CTRL_translateY
Head_CTRL_translateZ
Head_CTRL_scaleX
Head_CTRL_scaleY
Head_CTRL_scaleZ
Head_CTRL_rotateX
Head_CTRL_rotateY
Head_CTRL_rotateZ

Replies

  • warby
    Options
    Offline / Send Message
    warby polycounter lvl 18
    yeah looks like the fbx exporter does a mistake while baking your curves what kind of "deformers" and shit does your rig use ? anything exotic ? ... you know that might not be supported ?!

    does this also happen if you manually bake your curves? ( edit > keys > bake simulation )
    and manually delete the rig before exporting ?
  • Doran
    Options
    Offline / Send Message
    Thanks for the help!

    When I bake the simulation the bake works but when I delete the rig or the ik's it screws everything up. I think I must have done something wrong with the rig itself, using the controllers to animate and have the constraints linked to the ik's. Here is the hierarchy of the rig.

    41ab.png
  • MiAlx
    Options
    Offline / Send Message
    MiAlx polycounter lvl 10
    What happens when you bake the simulation, then export via FBX, without deleting your rig and ticking off "bake animation" in the fbx window (it is under animation I believe) Same result as before, i.e. character floats?

    EDIT: You said that the IK screwed up the rig when you deleted it. You deleted the IKs and curves after baking, right?
  • xMuku
    Options
    Offline / Send Message
    Hey,

    I'm working on this animation with Doran.

    When the simulation is baked it saves all the key frames and the IK's and Curves can then be deleted but when its exported the animation is non existent in Unity.

    Where should the animation be baked to?

    Also not sure if this helps but the character begins to float whenever the hip controller is bent downwards. All the other movement seem to work fine.

    Edit: It starts to float only after its exported to FBX not in the maya file animation.
  • Doran
    Options
    Offline / Send Message
    Yeah I imported a walk cycle that works fine because the hip isn't going up or down, but any animation where the hip moves is when it floats. I'm assuming it might have to do with the hip or the spine curve.
  • warby
    Options
    Offline / Send Message
    warby polycounter lvl 18
    which is the bone that adds the offset is it the pelvis/HIP/root ?

    or are the legs rotated/bent a bit more than they should ?

    exactly which element of the rig do you delete when the offset gets introduced ?

    are the translate xyz channels of the hip joint actually keyed on absolutely every frame after the bake simulation ?
  • xMuku
    Options
    Offline / Send Message
    From What we can tell its the Hip bone that is pulling it upwards.

    The legs are stationary during the animation. The character is sneezing and bending forward and that motion is just using the hip controller pulled down bending the knees because the feet are restricted from moving past 0 on the Y axis.

    The offset happens if we don't delete anything. Initially we had just baked the animation using the FBX exporter and that's where we noticed the floating error. Since then we have tried baking the animation right in maya and unchecking the exporter animation bake. When we do that the model we import into Unity has no animation attached to it.

    The baked simulation only keyed every key on the root controller named Main_CTRL. If we go down the hierarchy none of the other controllers have the simulation baked just the original animation we had created.
  • MiAlx
    Options
    Offline / Send Message
    MiAlx polycounter lvl 10
    xMuku wrote: »
    Hey,

    Where should the animation be baked to?

    The animation is baked on the bones.

    But hang on, maybe I misunderstood, but do you select the control objects (for example Main_CTRL) when you bake?

    If yes, then that's the problem.

    You select the root BONE, then edit -> select hierarchy, then edit -> keys -> bake simulation. Then, when it's baked, you select the root bone and the hierarchy of bones and the mesh and click export selected -> fbx and turn off bake animation inside the fbx exporter. :)
  • xMuku
    Options
    Offline / Send Message
    MiAlx wrote: »
    The animation is baked on the bones.

    But hang on, maybe I misunderstood, but do you select the control objects (for example Main_CTRL) when you bake?

    If yes, then that's the problem.

    You select the root BONE, then edit -> select hierarchy, then edit -> keys -> bake simulation. Then, when it's baked, you select the root bone and the hierarchy of bones and the mesh and click export selected -> fbx and turn off bake animation inside the fbx exporter. :)

    Ah okay that is much more clear than any of the forums I've read.
    After doing all that the model exports into Unity but when I click the preview screen for the animation the camera is moving as if the animation were playing but the character remains in his initial pose.
  • MiAlx
    Options
    Offline / Send Message
    MiAlx polycounter lvl 10
    hmm ok.. Have you enabled the animation in the animation properties in unity? Or is that an export issue still?
  • xMuku
    Options
    Offline / Send Message
    FLoat_zps1a53e50f.png

    This is what it looks like in Unity following the instruciton you posted above.
    The characters pose in that window is what he is stuck as. The animation is enabled in the settings.
    Under the Rig settings what should the "Animation Type" be set to?

    Edit: Alright so I brought the .FBX into maya and it seems the skin detached from the bones. The bones have the animation movement but the mesh remains still.

    Edit+: When exporting it still gives the warning that the plugin has changed the curve tangents.
  • MiAlx
    Options
    Offline / Send Message
    MiAlx polycounter lvl 10
    ok that's interesting..

    In the fbx exporter properties, under "deformed models", is skins and deformed models ticked on?

    I think the animation type should be set to humanoid, in case you have left it on generic.

    Unfortunately I am not at my PC at the moment so I can't check unity, but let me know if either of the above worked.
  • Doran
    Options
    Offline / Send Message
    thanks everyone the info you guys have given has worked, its working in the previewer perfectly now in unity, just need to change some settings so it plays in the game window now
  • xMuku
    Options
    Offline / Send Message
    Alright, so now the animation is working in the Unity preview window and the feet are remaining on the ground. I'll have to make sure it will play properly in the actual scene.

    Thank you for all your help guys. It is very appreciated. If anything else comes up I'll post back here.
  • xMuku
    Options
    Offline / Send Message
    FLoat_zpsc99c9160.png

    Alright it didn't take long for it to mess up for me.

    The picture above is the result of putting the animation files on to a static model and pushing the play button. All the animations work in preview with the model and they worked with the model they were imported with but not with the static model in the scene.

    The rig is set to Legacy because the animation wont play at all in Generic or Humanoid. I may be missing the next step.
  • xMuku
    Options
    Offline / Send Message
    Bump for Knowledge

    Edit: The way I have the animations set up is the main character is just called Character.fbx

    The animations are labeled a Character@Sneeze.fbx, etc.
Sign In or Register to comment.