Rigify and action baking

Hi!

I work with low to medium poly models for mobile devices (surprisingly these days, for a character these can go up to around 6000 triangles!) and I absolutely love how much of a time saver rigify is, and I would really like to use it instead of using my own rigs but I’ve hit a snag.

I’ve been told by our lead programmer that the system we have relies on sending the animation information to the GPU of the device, since using the CPU bogs the device down. However this creates a bone limit (ideally of 32 bones, we can live with 64 or a bit more though) and exporting from rigify as is creates around 400 bones…!

I would like to use rigify to rig and animate a character, then bake the animation to only the deforming bones and finally get rid of all the unnecessary stuff so I can export it to a format of our choosing (used to be md5, will probably be using FBX in the future)

I’ve been trying to use the the “Pose->Animation->Bake Action” option in conjucton with rigify, to bake the animation I made to only the deforming bones (the ones prefixed DEF), however despite ticking the “remove parent” option it doesn’t clear the parent on these bones…

Removing the parents by hand results in a broken animation. Exporting an unmodified rig to FBX still results in around 180 bones or so - still too much.

Does anyone has any sort of workflow that could help here? (other then abandoning rigify and going back to making my own rigs?)

Temporarily, I’ve baked the animation to the bones prefixed ORG + root bone (since these, unlike the DEF bones had a proper parent-child structure), removed everything else from the rig, checked the Deform option for all of them, and then I re-parented the character to this new rig - this is a hacked solution however and there has to be a better, cleaner and faster way…

If anyone’s interested I’ve found a solution to my problem.

So here’s how to use rigify for game rigs:

-Load up your character
-Load up the rigify rig, match the meta_rig to your character
-Generate the rig, hide/move/get rid of the meta_rig
-Select the newly created rig, under the rig section in the properties window switch to layer 18 (where the DEF bones are)
-In Edit mode, select all the bones, go to Armature->Bone Settings->Deform (this will untick the deform option for all of these bones)
-Go to layer 20 (where the ORG bones are), select all of the bones except the four heel bones, repeat Armature->Bone Settings->Deform
-In Object mode parent the model to the rig, auto generate weights (I have to do this twice for some reason - the first time around the automatic weights won’t generate, only the empty vertex groups).

Now, with the root bone you have nice 64 bones to export to whatever format you want.
If you’re going for mobile I suggest you keep your bone count below 60 (delete most of the fingers from the meta_rig before generating for instance) - some devices can handle a lot more, the new Unreal Engine has 75 somehow, but many devices will show errors when you have more bones (like the new nexus tablet).

2 Likes

Thank you very much for your insight.
Using the ORG Bones for Deformation fixed a Deformation Issue that came in Unity.
However when I try to bake the visual transforms of the ORG Bones, half the Bones are left out. (Mostly the spine bones)
Any Idea of why that is the case and how to fix this? (I am working on a quadruped BTW)

Holy moly had I not came across this post I’d still be exporting the rigify animation by baking the control rig with the deformation bone and mess up all my animations.

Thank you thank you thank you.