Volume Preservation via Utility Nodes


#1

Hi,

I’m watching Jason Schleifers AFR to catch up on some stuff.

I’m trying to do volume preservation with a translate driven stretch/squash spine. He does it with expressions and I’m doing it with utility nodes.

Basically…

MultiplyDivide - Arc length divided by absolute length.

Then that would drive the scale, except that it’d drive it in reverse… Putting a output x -1 MD would cause the scale to just invert rather than only scaling it by -1 and I don’t think a condition would solve it?

So of course there’s also the inverse scale but when I use that things go strange as if the inversscale has become disconnected between joints - which it has because obviously I just overwrote them…

I will work on how to change the quantity of preservation once I know what to do here, but until then I’m stuck.

Does anyone have any suggestions?


#2

Hi,
Maybe there’re more simple ways to do this, but this is how I do it. Works fine on ik spline.

After the devide,
- subtract the value by 1 so it’s 0 at normal state.

- Split the value to 2 channals, X(or R) for stretch and Y(or G) for squash
multiply them by 2 scalar values

MD input2X=-1 input2Y=1

multiply values don’t have to be 1 and -1. You can try multiple value to maximize your deformation.
This part is up to you, if you want some fall off on the deformation you can add another MD that does power the values before this one.

- Limit the value using clamp node.
clamp minR=-1 maxR=0
clamp minR= 0 maxR=1

- 2 condition nodes, one for stretch and one for squash
stretch condition// secondTerm=1 op=greather, clamp.outputR>>colorIfTrue, colorIfFalse=0
squash condition// secondTerm=1 op=less than, clamp.outputG>>colorIfTrue, colorIfFalse=0

- addDoubleLiear or ±Average
//add the outColorR and G together

- addDoubleLiear or ±Average
//add with the value 1

- connect to joint scale

hope this helps


#3

Hey mate,

That worked wonders. Thanks lots for that! Took a bit of tweaking but it got there, had to change around the scalar values and condition operation.

Adding power MD seems to make the mesh collapse :x


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.