← All ideas
  • Published 4 Mar 2019

Mesh deform modifier for armatures

Problem

I want to create a mesh with multiple different shape keys, for example persons or creatures with different ages, monsters which can transform or similar things. The problem is, when I want to pose and animate these meshes, the rig only works for the base, if the mesh deform is not only a bit. As long as the proportions don't change it's possible to resize the mesh and just scale the bones, it's parented to, but even for fading between child and adult this is most likely not applicable. The alternative is changing the proportions by scaling bones and then create a shape key that matches the new proportions. This is as well for creating as for usage more difficult than just using shape keys. Besides it's not possible or at least very difficult to use the poses and animations done for key one shape key for the other shapes because the proportions are most likely stored as poses. This would also not permit to have an animation that works for a partially applied shape key (example if you have a child and a shape key for adult, it's not possible to animate a teenager). There are probably ways to get it work using some advanced rigging techniques, but this gets complicated pretty fast.

Solutions

A much more simpler technique I can imagine is being able to add shape keys to the armature, more exactly to the rest pose of the armature. This would only require to have the same shape keys for the mesh and the armature. This would be nice to have, but it's still too difficult because you have to match both shape keys manually.

So an even better method would be having a mesh, which is used as a "Mesh Deform" modifier for both, the character/creature mesh, and the armature. So both the mesh and the rest pose of the armature transform in the same way. Instead of a "Mesh deform" modifier for the mesh bound to the armature, it could also just share the vertex data with the mesh used as cage for mesh deform.

But it would be weird to have only a single modfier for meshes. It would be nice to have some other modifiers, too, like cage, mirror, or even armature itself. This may be interesting, too, but there's a better way to solve this problem directly.

Proposal

So instead I propose a single new option for the armature modifier, which works like mesh deform, called armature deform. If this option is enabled, mesh deform will be applied to the armature before the armature pose is applied to the mesh. The pose will always be calculated relative to the rest pose after mesh deform. It's not recommended when have multiple child objects, that share the same armature, to activate armature deform on more than one of them. Instead of an additional option, there could be an alternate version of the armature modifier, or a armature transform modifier, which is initially applied from the child mesh.

I'm not sure, which implementation strategy sounds best. I might even try to implement it myself, but in this case I'd like to have some feedback first.

Features

So why I think, this feature is worth it:

  • Mesh deform already exists, so it shouldn't be difficult to implement for armatures, too
  • It simplifies creating characters of different ages a lot (makehuman also does something like that)
  • It simplifies creating creatures of different ages, which change a lot, even more
  • It can be used for many kinds of things, as long as the topology and the armature stay the same (which is a lot, you could even scale additional limb bones down and flatten them in the base mesh)
  • It simplifies creating various kinds of monsters without having to create a new rig everytime
  • It can be used for a single character in multiple ages/forms
  • It can be used for multiple characters based on the same base mesh (look at makehuman)
  • It can be used to add variation without having to care about different rigs.
  • The shape keys can easily be changed during animation of the rig
  • It can be used for continuous monster evolutions

So, what do you think about this? Would really be cool to have this feature.

66.7%

Development Status: Open

Upvote 2 Downvote 1
porky11
4 Mar 2019

15 Comments

vasiln

There is a way to do this. It's not convenient. It is scriptable though.

You can make an armature follow a mesh by tracking (probably damped track + stretch to + locked track) vertices in a mesh with appropriate vertex groups. Using this, you can mesh deform an armature-- just control it with mesh-deformed verts.

Note that curves can be handled the same way, even though they're (kinda) mesh-deform compatible anyways, through the use of hooks, which allows the full suite of deform modifiers to be used with curves. Only kinda compatible, because tilt isn't handled, although it can be done with a driver (again, bending the tilt toward mesh-deformed verts.)

Depending on what you want to do with this, you can setup layers of controls in various places-- you can armature deform the deforming mesh, you can armature deform the controlling verts, you can add a layer of child bones (or if you want a linked chain, copy position/rotation/scale offset bones) on top of the mesh deformed bones.

I would like to see this as well, although like I said, an add-on could handle it as well as anything native to Blender.

porky11 Author

* @vasiln * Sounds interesting. Looks like I have to add the modifiers to every bone manually. It's not perfect but maybe it works good enough. I'll try it.

porky11 Author

* @porky11 * I just tried it and for rotation it seems to work, but it doesn't work for scale. Maybe it's possible using copy scale and vertex groups or something similar, but I couldn't get it work yet.

vasiln

* @porky11 * Yeah, you have to do some other rigging stuff to get scale working correctly, I wasn't really thinking about that. It is possible though. (Stretch-to marker bones, with scale copied via transform constraint to the deforming bone.) But I don't want to encourage you to do this, the reality is that it's really way too much work to set up for what it is, unless you're going to do enough of it to make it worthwhile to set up a script to create your armatures and verts-- in which case, please send me a copy of your add-on :) Edit: I'm not so sure. It would certainly be tricky getting it working properly with scale on any axis.

porky11 Author

* @vasiln * Before I set up a script to place my bones automaticaly I fork blender and just implement one of my ideas. I already found, where I have to add it, but first I have to succeed in building blender myself, which isn't even that simple.

vasiln

* @porky11 * Here, check out pasteall.org/blend/index.php , I think it demos doing it with scale. Would be a pain in the ass to implement for anything more complicated than a demo though. Edit: Oops, forgot to disable volume conservation. pasteall.org/blend/index.php instead.

porky11 Author

* @vasiln * The problem here is, when using the mesh to deform the bones here, it's not possible to deform the mesh using the bones, as well, because it's a cyclic dependency.

Vyach

tl/dr bones are not meshes.

porky11 Author

That's not helpful. Basically, bones could be transformed similar to "Mesh Deform" modifier, since both have Points (Mesh: vertices, Bone: head and tail), which will be transformed.

Vyach

* @Krapohl.f * Mesh deform made for mass-deformation. And bones are bones. Two point for bone or even 1 element of chain. They have IK, constrains, relations. It is not just a cloud of points. If you want flexibility — use bendy-bones. If you want to squish character, use proper rig with IK`s and constrains. If you need poses — use pose library If you need local deformations — use shapekeys.

Please Learn existing abilities before imagine new.

Makehuman use shapekeys and rig-constrains. Bones in blender can be streched, limited, driven etc

porky11 Author

Makehuman uses shapekeys for transforming the humans (like age). The shape keys have very different sizes. The rig is changed, so it matches the new shape. That's basically what I'd like to do. And "Mesh Deform" seems to be the best option for it.

As I wrote, I assume it's possible using some advanced rigging techniques, but especailly for monsters, that change the proportions a lot, this will get overly complicated.

My preferred workflow would be this:

  • Create the base mesh
  • Create shape keys for different states (fish like monster, frog like monster, dinosaur like monster)
  • Add a single rig, that works for all

A workflow, that could work in current blender, is this:

  • Create base mesh
  • Rig it
  • Pose it to look like a fish/frog/dinosaur
  • Use some advanced rigging techniques to switch between these poses
  • Use these meta bones to switch also for shape key drivers

There are a few pros to this method, but adding a new form will not be as simple as just adding a new shape key. And the rig will also get more complicated for every new transform. Really is an option, but having armatures, that transform with shape keys, is much easier to set up and extend.

Vyach

* @porky11 * Ok, I see. Use «copy transform» bone constrain and empty or driver to tune 3 axes. Thats all.

porky11 Author

* @ Vyacheslav * Not sure, what you're trying to tell me. I could use "copy transform" to switch, which of my skeletos I use, and use a empty as driver for the shape key and which of the seletons are used. One skeleton per shape key is hopefully enough.

Vyach

* @porky11 * How do you imagine meshdeform will work for bones but follow these bones? It is cyclic dependence. So 2 rigs.

porky11 Author

* @ Vyacheslav * Mesh deform for bones (armature deform) will be applied, before the armature is applied to the mesh. That's how I described it. But the alternative would be, that you need two mesh objects, one is the parent of the armature, one is the child of the armature. Then you don't have cyclic dependency problems. (Look at my initial description for more details. I'll edit it to make it visually more clear, how it's organized)