# Volume Preservation via Utility Nodes

 09 September 2012 #1 JaredTaylor Technical Artist   portfolio Jared Taylor Wellington, New%2BZealand   Join Date: Jan 2007 Posts: 1,229 Volume Preservation via Utility Nodes 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? share quote
 09 September 2012 #2 nuternativ Automator   portfolio nuternativ Character TD Picture This Studio Bangkok, Thailand   Join Date: Dec 2010 Posts: 148 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 Last edited by nuternativ : 09 September 2012 at 10:04 AM. share quote
 09 September 2012 #3 JaredTaylor Technical Artist   portfolio Jared Taylor Wellington, New%2BZealand   Join Date: Jan 2007 Posts: 1,229 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 Last edited by JaredTaylor : 09 September 2012 at 08:38 PM. share quote
 09 September 2012 #4 CGTalk Moderation Expert   Join Date: Sep 2003 Posts: 1,066,473 Thread automatically closed 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. __________________ CGTalk Policy/Legalities Note that as CGTalk Members, you agree to the terms and conditions of using this website. share quote

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts vB code is On Smilies are On [IMG] code is On HTML code is Off CGSociety Society of Digital Artists www.cgsociety.org Powered by vBulletinCopyright ©2000 - 2006, Jelsoft Enterprises Ltd.