Shape Keys for Armatures
Lately I've been finding that I really wish I could gain the same advantage I get from shape keys for meshes with armatures as well. The idea is that you would be able to add shape keys for armatures and then adjust them in edit mode the same way you do for meshes. Add a basis, then an additional shape key for each set of bone positions you need, then select the one you want to work on and pop into edit.
I've recently been focusing on reusable game ready models. I intentionally keep a lot of my rigging and animation pretty simple and generic for that reason. I try to avoid messing with position and scale with my deformation bones as much as possible, keeping most of the animation data limited to rotations and hip bobbing, which means I can reuse animations for a wide range of character shapes, as long as they have roughly the same rest post and hip height, then I can adjust their overall height in engine via scaling, since animations happen in local space.
But right now, each time I want a fairly different body type that needs bones moved around to accommodate, I need to fork off a duplicate of the armature and from then on all changes made to the original have to be synced up manually with each duplicate. This could be avoided if I had access to shape keys for armatures.
Then I could make each new body type variation as a pair of mesh and armature shape keys all within the same unified base and just change up which are active when it comes time to export. I would get a ton of use out of such a feature, for several on-going projects and I'm sure there are others out there in similar situations who would benefit greatly from this as well.
6 Comments
How would animations be interpreted across different armatures with different shapes?
Any change in edit mode results in changing the base pose of the armature, and also how the bones move and rotate. An animation you made before an edit could be completely unusable after edit.
How would it be interpreted when exporting ?
No other software (including game engines) would have this feature, nor the IO formats, so it has to be somehow baked into a raw armature at some point if you want to keep the desired final effect.
As I mentioned, I keep the starting rotations of the bones in edit as unchanged as possible and ensure the pelvis has the same position in every version, as long as you keep those consistent and stick to animating mainly with rotations and having the pelvis be the only thing that moves up and down, then the animations pretty much always translate perfectly, no matter how far the bone positions have moved in edit.
Also since I focus on game ready stuff, the animations tend to be pretty simple and aren't usually the sort that rely on precise alignments or interactions with anything outside of themselves other than the ground. Like I'm not making them shake hands or anything like that, and even if I had to, I'd probably end up relying on IK animations in Godot itself to force things to line up where I need them. Most of the animations end up being stuff like running/walking/shooting in a general direction, that sorta stuff.
And this isn't hypothetical, I've been doing this for quite some time now. Some friends and I are big fans of the old Mega Man Legends series and have been porting the first game to Godot. I have one base rig for all of the humanoid characters from that game, and they can all use all of the animations from across all those various characters (dozens of them). We wanted to include multiplayer in our port, so I wanted to make sure any of the NPCs from throughout the game could all be used by players.
The only thing that I have to account for is scaling them all in Blender so that their hips line up with the Mega Man player model. I make sure to do the math to find the precise scale to get those perfectly lined up, and then I calculate the scalar needed in Godot to restore the exported model to their proper height. Since the scaling is happening at the object level, and the animations are playing within the object's local space, the animations scale with the object, so taller characters have relatively higher rise and falls for the hips.
It's worked pretty flawlessly so far. It's just such a pain because I have to have a separate armature for every single character I port to this base, just so I could move around the initial bone locations to suit the various body types. So I am stuck manually syncing up all the NLA stacks across all of the currently ported characters every time I add more animations. I've ended up finding a script that helps a bit, but still has to be run for each and is prone to human error, basically me overlooking one or more of the spin offs.
I'm also working on another game project now using my own IP and plan to do something similar, making all of the characters from a single base, most can even get away with using the same UVs. They are all stylized humans of roughly the same overall proportions, but I would really like to be able to do things like give the guys wider shoulders, and girls wider hips, or kids shorter limbs. The changes would be pretty subtle, just moving some of the bone positions to allow for slightly more dramatic silhouette changes to really help them stand out from one another.
For now, and for my own sanity and desire to avoid extra work, I am just using a single generic rig and base mesh that compromises somewhere between the male and female adult forms, so that the limitations and distortions are spread out equally to the gendered shape keys going in each direction. And for now I'm leaving kids out entirely, just so I only have to fork off one duplicate to adjust for all of them much later down the line after most of the animation work is done. The kids are just filler NPCs anyhow to make the town where the game takes place feel more like a real lived in town.
As to exporting, my thought would be that it would be preferable to just have the currently active setup be the bone placement that gets exported. So each character needs both their mesh and armature shape keys applied for the export. It would be nice if that can be done automatically, but it isn't a big deal to just save before hand, and clear out the shape key stacks in such a way as the desired choices are applied, export, then revert.
if all you are doing is moving bones a bit, why don't you use animation layers for that?
I haven't had much luck with getting clean results moving the bones around as animations. As it really jacks up the shape keyed mesh changes. You got to basically counter model against the animations, it ends up being more hassle than just duplicating everything and moving the bones in edit mode to match the mesh shape key, even with all the manual sync work that introduces, which is what spawned the idea for this thread.
I remember a while back I saw a tutorial on a hulk out transformation, but with the caveat that the characters had to be the same size so that the armature could be used for both without issue. I remember thinking back then that shape keys for armatures would be vert useful for projects like that.
Yeah, it would be awesome if we could "bake" armatures changes into shapekeys.
This would be very helpfully for charater generators like Human Generator ( blendermarket.com/products/humgen3d ) or any figure platform.
DAZ Studio has such a feature and they are using it for their Genesis platform.
There's a Genesis to Blender converter called diffeomorphic.blogspot.com/
To get around Blenders missing ability to bake armature into shapekey, Diffeomorphic has in the current beta version a script, which changes into armature edit mode and adjust the armature for the shapekey. This is of course not the technically best solution (after it's slow) and works only for shapekeys exportet from DAZ studio to Blender via Diffeomorphic... but it's working.
Would love to see a native support of this feature in Blender. This would also help for character transformation, e.g. a human into a werwolf or an adult into a child.