Search Unity

Maya Animation with IK and Driven Keys wont import properly

Discussion in 'Asset Importing & Exporting' started by valriviala, Jan 21, 2009.

  1. valriviala

    valriviala

    Joined:
    Jan 21, 2009
    Posts:
    15
    I'm using a character that I've already animated in Maya using IK handles and set driven key attributes. Does anyone know how to properly get that into Unity? I've tried a lot of different things but nothing has worked so far. The best I've gotten is the character to import in my scene and partially animate (the joints that aren't affected by IK and driven keys at all). I've tried baking keys in Maya but that doesn't seem to work because as soon as I delete my character controls (ik handles, etc) then the animation is gone.

    I'm hoping there's some sort of solution so I don't have to re-do all of my animation! Also it's much easier animating with IK handles... has anyone else had this problem and by any chance figured it out?

    I've included a screenshot of my character in Maya so you have an idea of what I'm talking about. It shows the outliner and how I've done the character controls.

    Thanks in advance!
     

    Attached Files:

  2. amirebrahimi

    amirebrahimi

    Joined:
    Jan 27, 2008
    Posts:
    171
    What import settings do you have?
     
  3. valriviala

    valriviala

    Joined:
    Jan 21, 2009
    Posts:
    15
    I've tried all sorts of import settings in Unity and it doesn't seem to make a difference. But I was actually able to bake the keys in maya and using the proper settings (which I wasn't before) I was able to get rid of the IK's and other controllers before exporting, and still keeping the animation intact. So I think I've figured it out!

    I thought I did enough research on my own to qualify for a post but apparently it just took a bit more and I figured it out :)

    Thanks though!
     
  4. theinfomercial

    theinfomercial

    Joined:
    Sep 9, 2008
    Posts:
    1,000
    Making an iPhone game? Or just testing out the character? :wink:
     
  5. nm8shun

    nm8shun

    Joined:
    Jul 14, 2007
    Posts:
    476
    As far as I know, Set Driven Keys won't import. IK chain stuff will, but if you're using Driven Keys, that animation won't transfer over.

    I usually have my students leave their IK chains in tact, but to animate with parent relationships and leave out Driven Keys wherever possible.

    And then again, you can Bake the Animation, and that will usually reduce the Driven Keys down to regular keyframes that Unity can read.
     
  6. valriviala

    valriviala

    Joined:
    Jan 21, 2009
    Posts:
    15
    I'm testing out the character for an iPhone game. Just getting started on it so the learning curve is pretty large right now!

    I managed to bake most of the animation but I am still having a small problem with the way I rigged this character. I used some root control shapes and I'm not able to bake them into the animation. They import into Unity but it still animates oddly. I'm moving onto other things for now, if I have to re-rig the character that's not that big of a deal.
     
  7. nm8shun

    nm8shun

    Joined:
    Jul 14, 2007
    Posts:
    476
    If you'd post or pm the maya file, I could take a look. We actually just finished a big project and solved a lot of these types of problems, so the solutions are fresh on my mind.
     
  8. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    If the issue is resolved via PM, could we get the result in here? Also, if you have a list of general issues and solutions with Maya animation export, I believe many would find it useful here and on the wiki.
     
  9. nm8shun

    nm8shun

    Joined:
    Jul 14, 2007
    Posts:
    476
    Sure, I'd be glad to. Most of our recent trouble-shooting was surrounding character rigs and animation - and most of those solutions were based upon organization and hierarchy adjustments.
     
  10. valriviala

    valriviala

    Joined:
    Jan 21, 2009
    Posts:
    15
  11. nm8shun

    nm8shun

    Joined:
    Jul 14, 2007
    Posts:
    476
    Try this one.

    What I did:
    1) Baked the Animation. Edit>Keys>Bake Simulation (made sure to set "Below" but left other defaults alone.
    2) Deleted leftover constraints nodes.
    3) Deleted IK Handles and Effectors
    4) Deleted Non-Deformer History of main mesh

    In general, we've found that the baking IK with Unity's import options works well and it's nice to not bake in Maya so that you can then go back and make adjustments to the animation.

    But watch for these things:
    1) Bad (or unnecessary) history (you had a polySoftEdge and polyNormalPerVertex on the main mesh down stream of the skinCluster node)
    2) Constraints. Any Point or Orient Constraints cause problems. For that matter, most anything that uses the "move this, and use it's attributes to drive another object's attributes" paradigm causes problems. So, Driven Keys don't work and cause problems. The obvious exception is parenting. So if you had parented your Root to a NURBS curve, and then animated the NURBS curve, you'd be fine.
    3) "Clean" animation. This was tough to track down any reporoducable (sic) problem. But generally, animating by hitting the "s" key in Maya creates some monster collections of data. You can avoid this by using "shift-w" to set Translate Keyframes, "shift-e" for rotation, etc..Alternately, in the Channels Box, if you right-click on attributes that won't animate (scale for instance for something like the foot IK), and choose Lock and Hide Selected; you can then animate with "s" as it will only place keyframes on the available channels/attributes.

    Let me know if that works....
     
  12. destiny7419

    destiny7419

    Joined:
    Jun 24, 2011
    Posts:
    1
    hey valriviala

    u said u were able to keep the animation intact even after removing the Iks after baking with the help of "proper settings". can you tell me what settings you actually used to bake the animation?? coz i am having the same problem with baking the animation.