Search Unity

Blender / Generic Animations don't transfer with Empty Parent Alone BUT with skinned Mesh

Discussion in 'Animation' started by the_motionblur, Apr 2, 2019.

  1. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,774
    I've found something very weird in Unity's behaviour today and after 2 days of trial and eror I think I've narrowed it down to a Unity specific problem. If it's Blender problem please let me know, also. Either way this is super weird:
    Basically Generic Animations do not retarget with bone hierarchies parented with an empty object. At least not alone but they do retarget if the file is exported together with a skinned mesh!
    Same hierarchy. Same animation, exact same names.

    Mecanim works fine. Files with the same animation but also with an additional mesh skinned to the rig also work fine. Otherwise Unity loses the ability to find the animations inside the file.

    The setup is this:
    Inside Blender I have a Rigify skeleton. Since Rigify also uses a lot of additional bones in it's deformer mesh hierarchy I am creating a secondary rig that has a clean hierarchy and retarget with 'copy transform' constraints from the more complex rigify skeleton. Kinda like this:
    upload_2019-4-2_16-36-0.png upload_2019-4-2_16-43-51.png

    Next up I bind a mesh to the rig and set the rig into "Rest Position". I export this out to have a netral mesh skinned to a rig without any transforms or animation that I can target animations to.

    Next I create an animation on my Rigify Rig. Then I select either
    1. The mesh and the rig and export the two out into one file together with the animation or ...
    2. ... only the rig and export it out into a file with only the animation without the mesh attached to it.

    Now here's the weird part:
    When I want to use the animations in Unity I cannot use the file without the mesh. The FBX with the same animation, from the same rig just skinned to a mesh works in preview and in the scene view. Not the isolated anmiation. Neither when i drag the respective mesh in the preview nor in scene or in the aniator.
    Unity won't find the animations despite them being 100% identical to the other file. I checked in Maya to see whether something was off with Blender's hierarchy when exporting, maybe. But no. Not the slightest.

    Here's a comparison from Maya:
    (Left) the neutral Pose, Model skinned to simplified rig
    (Right) the animation on the rig only, no mesh, no skinning.
    upload_2019-4-2_16-55-28.png
    Before you ask: Yes - inside Maya the animation can be loaded onto the skinned mesh no problems whatsoever!

    THEN there's the same animation exported with the skinned mesh and the rig.
    Same source rig, same animation, same Blender file I exported from but this time it works.

    The file can be previewed in the inspector and can be retargeted onto the neutral mesh.

    Without the Null Parent from Maya:
    When I...
    1. load the skinned neutral mesh into Maya, remove the Null parent and save the file again ...
    2. ... then load the rig animation (wihtout mesh), remove the Null parent and save it from Maya as well ...

    Then it works. So bare animations are transferrable.
    They are apparently even transferrable WITH Null Parents but for some reason a mesh has to be attached to it. And it's ONLY for Generic animations, as well. Not for Mecanim. Mecanim works fine.
    This is such a frigging specific Thing ... is this by design or is this a Bug?

    My Test Project is attached as a unitypackage. It includes the raw Blender 2.8 files as well just in case.
    Please tell me I'm not insane! :-o

    (edit) using Unity 2018.2.1
     

    Attached Files:

    Last edited: Apr 2, 2019