Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Maya IK FBX problem

Discussion in 'Asset Importing & Exporting' started by Fibre Optix, Mar 10, 2009.

  1. Fibre Optix

    Fibre Optix

    Joined:
    Mar 10, 2009
    Posts:
    13
    Hi all I'l try to make this short.

    I'm a Maya guy and my partner is learning Unity. I do not have Unity installed because Im on a PC. So I have to export FBX (latest plugin.

    We've been doing simple tests. FK works like a charm. We are stuck on IK animation transferring to Unity.

    This is what I'm doing, I made a simple cylinder placed 4 bones, applied IK (tried SK and RP Solver) Parented a Nurb Circle as a control object to the end effector. (tried regular parent [P key] and a parent constraint). Animated it over 25 frames. Works in Maya 8.5.

    I delete the Non Deform History on All objects and have tried only on the Mesh.
    I bake the mesh animation. See Attach.
    I export ALL using the FBX plug in. See Attach

    Unity only sees the Control object move. I should note that I have tried this without the Nurb circle as a control object and the IK handle moves but the mesh is not responsive.

    Also I tried deleting the joints, IK handle and the control object, leaving only the baked animated mesh. In this case Unity saw no animation what so ever.

    Any ideas or suggestions would be appreciated.

    I've attached the Maya 8.5 file as well.

    Thanks
     

    Attached Files:

  2. Fibre Optix

    Fibre Optix

    Joined:
    Mar 10, 2009
    Posts:
    13
    Here is yet another attachment showing the Hierarchy of my file in case this means anything.
     

    Attached Files:

  3. Fibre Optix

    Fibre Optix

    Joined:
    Mar 10, 2009
    Posts:
    13
    I think we have found a work around that works perfectly.

    Create a custom shelf (optional)
    Create a simple script. In the MEL command line type: select -hi, select it and drag it to your custom shelf. This will create a clickable icon on your shelf. You can even design an Icon for it if you like.

    1. Rig your character the way you normally do. Set driven keys and all.

    2 Animate your character as usual.

    Here is the work around after you finalize your animations.

    3. Save a copy of your scene. you need the original incase of changes to you animations.

    4. At every key point you like select your root joint. This should highlight your entire skeleton.

    5. Click the select -hi button you created and then hit S key to create a keyframe.

    After all that you can delete you IK handles, control objects and what ever else you have leaving you with only the mesh and the bones.

    You can delete deform history at this point as well.
    then Export you FBX.

    What select -hi does is it selects your entire hierarchy of joints. So when you key frame it with the hierarchy selected it keeps the transform position of every joint thus converting the IK to FK. Which Unity seems to prefer over IK jargon. This solution keeps the ease of animating with IK and set driven keys.

    If there is a better way let me know, because we tried everything else.
     
  4. Udii

    Udii

    Joined:
    Feb 25, 2009
    Posts:
    2
    Qué pasa NEEENGS!!!

    The IK Animation is something not recommended for games, the best is FK Animation... I know, FK animation is just a lot of work, and the IK are really cool for cinematics and for all kind of character animation, but in many game engines (not only Unity) it gives some troubles.

    The method that mension Fiber Optix is a good one, but a simple one is:

    1-Save a copy of your scene

    2-In the copy, select all the bones that have IK Handlers.

    3-In the menu EDIT go to "KEYS", then select "Bake Simulation"

    This will bake the animation from your IK Handlers to all the selected bones. The default settings create a Keyframe for every frame, but you can modify this in the Bake Simulation's options.

    AlakaNooch!!!
     
    ValentinMalmgren likes this.
  5. AreDub3D

    AreDub3D

    Joined:
    Mar 21, 2009
    Posts:
    3
    Hi,
    I'm a Maya user who is totally new to Unity, so forgive this (probably) dumb question, but are any of these things recognized and used by Unity?

    If you can point me to where I can learn about this specifically, I'd appreciate it.

    Cheers,
    RW
     
  6. Fibre Optix

    Fibre Optix

    Joined:
    Mar 10, 2009
    Posts:
    13
    Udii: Your right I just tried my method on a complete character and it doesn't work. It sucks do not do the method I described above

    Baking the joint chain as you said is the best way.

    However we are still getting problems. If I bake the Mesh as well as the joint chain it breaks the skin binding.

    If I just bake the joints unity sees the joints animating properly but the mesh screws up. It looks like a ball of polys. But the model looks fine in Unity's preview window.
     
  7. Mrguy

    Mrguy

    Joined:
    Jun 9, 2009
    Posts:
    8
    I believe I'm having the same problem as you. I've been following this.
    http://unity3d.com/support/documentation/Manual/HOWTO-ImportObjectMaya.html

    And some other forum posts. But when I bring the FBX into Unity the mesh looks like a blob or rock of polygons.

    V01 mesh was made, baked the IK on the joints, and then exported. The file would blow up in Unity. but oddly enough if I re-exported the FBX as an FBX there would be no problems when brought into unity.

    V02 Mesh was redesigned (mesh and rig) and had the exact same export process and it is now always a blob of polygons.

    I tried, deleting non-deformer history, optimizing the scene, deleting the constraints and the NURBS curves. Nada.

    I'm using Maya 2009 and I'm at a complete loss as to whats happening. :(
     
  8. Fibre Optix

    Fibre Optix

    Joined:
    Mar 10, 2009
    Posts:
    13
    Try this... export your MB file as an FBX. if it's a character bake your animations for the joints and the mesh and just delete your ik and other stuff. Create a new scene in Maya and re-import the same FBX you just exported and Export it again as a new FBX file. Then import that new file into Unity. You'll just need to re-apply the texture in unity again ... i think. I know it sounds stupid, but it works.

    It's as if re-exporting the FBX again strips extra Maya junk out of it which is causing the crazy blow up. Let me know of it works.
     
  9. Mrguy

    Mrguy

    Joined:
    Jun 9, 2009
    Posts:
    8
    The first time around I found that out too.. so I did the exact same thing for my version 1 mesh/rig and it worked out just fine. But now with my version 2 mesh and rig the double export FBX doesn't work. Between the two the only differences are lower polygon mesh, and different bones.. the other difference is that my scene is in meters now and the mesh was scaled accordingly. (before it was rigged)
     
  10. IMJudge

    IMJudge

    Guest

    Joined:
    Jul 8, 2009
    Posts:
    5
    The way we are doing it is working fine. It is slightly complex however. We can use any IK controls or driven keys we want in maya by doing it this way though. We are using two rigs. One with all of the controls/IK and another with only the FK joints. We are referencing the rig with all of the controls, animating that, baking out all of the keys, then replacing the reference with the FK rig before saving. This works just fine and also helps performance in Unity because all characters are fully FK and fewer joints. This also allows you to make the controls on your main rig be polygons or whatever you want.
     
  11. jbuck

    jbuck

    Joined:
    Jun 9, 2009
    Posts:
    169
    What you're describing is the "Universal Skeleton" approach and it is in use in one form or another by many AAA game dev teams.

    It allows members of the team and outsourced artists to work in whatever package they like with whatever skeleton they like and only export simple skeletal rotation on a secondary skeleton that's attached to the driver skeleton. It can get complicated in terms of keeping track of the master (source) animation files but works REALLY well when working with mocap data.
     
  12. giyomu

    giyomu

    Joined:
    Oct 6, 2008
    Posts:
    1,094
    this is what they call "shadow Rig " in XSI, working exactly on that principle, and using some pre defined rig you can easily transport and bake your animation for final output easily.
     
  13. ormon

    ormon

    Joined:
    Jun 9, 2009
    Posts:
    12
    I had the same issue/question.
    I created a rig in Maya that was all IK with constraints and shapes and such and then, constrained a simple FK skeleton to it and eneveloped a character to that, and that worked after doing the plotting and baking of animation.

    But I would really like to work in XSI,and skeleton Hierarchies work a touch different. Like in Maya when you parent bones they become part of the same chain, but not in XSI.
    And I am finding if bones are not in the same chain, they are losing animation.
    Is there a way to import bones 'linked' to each other, like by a naming convention or grouping technique, so that Unity understands, that oh this is all part of the same chain of bones..............


    ok found some solutions.....
    One, Never link anything to an end effector in the hierarchy, link roots to bones and bones to roots, I guess that should be obvious but sometimes I get sloppy and just parent an ankle root to a leg end effector and this is where the connection was getting lost for me.
    And its easy enough to plot a skeleton with IK, without having to use a totally different rig that was only fk, like I had first thought.
    Still......seems to me this should just work without having to cut out end effectors....I would be willing to bet this is a FBX export thing as it is flakey as all get out with materials any way and xsi.

    But good to know I now have a solution.