Our goal is to have one character (geometry + skeleton + weights) where we can load a bunch of different animations (skeleton with baked transforms). I’m not using the game exporter because we need some extra customization when exporting (we need to create a couple of root bones among other things). Also, by default mGear has the joints as ‘non-keyable’, so make sure to change that if you are exporting animated skeletons to your game engine.
Roughly, the steps I follow are these:
1/ if the rig is a reference, import it in the scene. Remove namespaces.
2/ create the additional joints I need in the joint hierarchy (this is particular for our case).
3/ set all the joints as keyable.
4/ bake all the joints’ animation. You can use something like this:
min = mc.playbackOptions (q = 1, minTime = 1)
max = mc.playbackOptions (q = 1, maxTime = 1)
mc.bakeResults (joints, time = (min,max), sm = True, sb = 1)
… after importing maya.cmds as mc, of course. We change the tangent type of the baked keys as needed.
5/ parent the joint root to the world.
6/ remove all the matrix nodes in the rig.
7/ and then, remove the ‘rig’ node.
This is what I do before I export the animated skeleton as .FBX. For exporting the character, I do not bake the joints’ animation because there’s none, but before step 5 I remove ALL the inputs to the joints using this:
for eachJoint in joints:
inputs = [eachInput for eachInput in pymel.core.ls(eachJoint).inputs() if eachInput.type() != 'joint']
… and then I delete the rig node. I believe this step is what could solve your issue.
I’m not saying this is the proper way to do it, but it seems it’s working for us so far. We have other issues on the Unity side that I’m figuring out, but it’s not related to mGear at all.