Maintaining bone volume, a new constraint
Mar 16th, 2010 by admin
Under the Transform section of the Add Constraint menu is a new one called Maintain Volume.
I developed the constraint (which is extremely simple) to help with adding squash and stretch to characters. There are a number of ways to do this already, but as I’m not the world’s greatest rigger and don’t have a lot of patience for layering several tiers of controls on top of each other, I wanted an easier way. First, I tried doing it with Drivers. I figured that if I could drive the X and Z scale of a bone as a function of its Y scale that would do the trick (the equation btw is: X (or Z) scale equals the square root of the constant volume divided by the Y scale). Unfortunately, Blender didn’t like this and considered it a cyclic dependency. So, I moved on to using the Transform constraint.
Another user (mtracer) said that he’d done just such a thing with the Transform constraint, and it seems like that’s the case. I just couldn’t get it to work. I find those types of value-mapping interfaces horrible to deal with. I could have tried to do this with a PyConstraint, and in fact something like this was done by Cessen in Big Buck Bunny. Unfortunately, I’ve never done a PyConstraint before and didn’t feel like learning the new API for what should be a relatively simple effect.
So, I was at the point where most users find themselves. Yes, I could have brute-forced any of the previous four solutions (complex rig, drivers, transform constraint, py constraint). However, that doesn’t solve the problem for everyone else. We can’t expect people to be programmers just to use the software. So, I did the easiest thing for me, which was to add a constraint. You can see the effect below:
Blender 2.5 “Maintain Volume” constraint from Roland Hess on Vimeo.
It’s in trunk, so update, compile and have fun!
Hi,
Awesome feature, glad it is back in 2.5. I will have to grab the most recent svn and give it a try.
no new enough builds on graphicall
This looks awesome! Maybe there should be a weight painting mode for it, so some parts can stretch more than others. That would be more difficult to implement, though.
Thanks soooo much! Just what I needed for my character rigs. Now, no need for some special locks whatsoever. Thanks so much again! ^_^
-Reyn
Yay!
Making our lives extremely easier!
This is specially great on more complex setups (ex.: IK-FK capable setups), avoiding the creation of too much extra bones.
Thanks a lot!
Thanks folks. It was the complexity of doing this with the existing tools that prompted it. I hope it stands the test of time and makes a real contribution to rigging.
Hey Roland, I was wondering if you could give me the list of blender source files you had to edit to create a constraint. I was thinking about trying to add a very simple one myself so I’m sure it would save me some time if I knew what to start looking at. Thanks for any help, and thanks for the constraint!