Search Unity

Resolved FBX import: anim hierarchy imported incorrectly if it uses a Maya Group without a mesh.

Discussion in 'Animation' started by Chris_Payne_QS, Sep 19, 2020.

  1. Chris_Payne_QS

    Chris_Payne_QS

    Joined:
    Jul 16, 2016
    Posts:
    84
    My team has built a character with a non-human rig and a bunch of anims.
    The rig and model are parented to different Maya groups.
    If we export the anim and the model together, the Maya groups (GRP_Mesh & GRP_Rig) are exported as part of the hierarchy, Unity loads them and everything works.
    If we export the anim alone, the Maya group GRP_Rig is still exported (visible in the FBX), but Unity either strips it or ignores it, and no amount of creating avatars and changing the root bone will make the anim map to the model's rig.
    If we export with ANY dummy mesh alongside the anim, it also works correctly.
    Our hypothesis is that Unity does import the group nodes when they are needed to preserve the mesh and rig in relation to each other. But if not, it discards the group node since it is not a bone and deemed inessential. This prevents the generic rig hierachy matching.

    This seems like a bug; surely the Maya group should be imported to preserve the rig hierarchy even though it's not a bone? (Tested in both 2019.4.0 and 2019.4.9)
     
  2. Nathanieljla

    Nathanieljla

    Joined:
    Apr 18, 2014
    Posts:
    97
    I just tried what you described and it's working for me. I'm on 2020.1.3f, but if anything you're version should be more stable. A few thoughts, as I've never seen Unity strip anything from the hierarchy.

    1. Is your animation > rig > Avatar set to "copy from other avatar" then referencing the avatar from your other file?
    2. For the file that only contains animation data, if you go under the animation and create a mask using the definition of "create from this model", does the hierarchy match the rig file (minus the GRP_Mesh). If your rig file doesn't have an animation to import with it (for comparing against) you can create an avatar mask to cross reference the hierarchy between the two files.
    3. Anim only files won't show anything in the inspector's preview window, but you can drag and drop your rig file into the preview window to see the animation playing.

    How exactly do you know the anim file isn't working?
     
  3. Chris_Payne_QS

    Chris_Payne_QS

    Joined:
    Jul 16, 2016
    Posts:
    84
    Hmm, thanks for trying it out. I wonder what's different with our data...

    1. I thought I'd tried this but apparently I hadn't because this works! Thank you :D
    2. If I try to create an avatar from the isolated animation, the root node picker does not allow me to choose GRP_Rig, it starts from the first spine bone instead. If I try to create an avatar from the rig FBX, GRP_Rig is available.
    3. The preview window doesn't work properly even with your suggestion from point 1 - the preview shows the model stuck on the last frame of the animation but doesn't actually play at all.
     
    Last edited: Sep 20, 2020
  4. Nathanieljla

    Nathanieljla

    Joined:
    Apr 18, 2014
    Posts:
    97
    I'm just taking a stab in the dark here, but OOC under the import model section of the inspector (left of the rig options) is there a preserve hierarchy option in your version? I'm not familiar with this checkbox, but from the tool-tip it sounds like it could be altering your structure. You might try turning that on.
     
    andre-ivankio likes this.
  5. Chris_Payne_QS

    Chris_Payne_QS

    Joined:
    Jul 16, 2016
    Posts:
    84
    Nathanieljla likes this.