# Maya 2013 Rigging simple script Help

 11 November 2012 BrioBriss PRO   portfolio Olivier Brisson 3D animation Cégep du Vieux Montréal Montreal, Canada Maya 2013 Rigging simple script Help Alright, here's the issue. I actually have a script on some bones of the legs/arms of my character to make the leg/arm stretch. It works with a measure tool, so as far as the distance tool is higher than the base value (when the character is at his initial pose), the arms/legs will stretch. The problem is that when I scale the Master Icon of my character, it scale the distances tools too, so make the character arms and legs stretch, but I don't want it. I want that the arms and legs don't stretch when I scale the whole character with the Master Icon. So yeah, all I want is to be able to scale the whole character with the Master Icon without the legs and arms stretch. (Don't know if it's clear here?) Here's the initial script for one bone of the left leg: 1- if ( RG_L_legStretchDistanceDimension_Shape1.distance > 7 ) { BD_L_leg_1.scaleZ = (RG_L_legStretchDistanceDimension_Shape1.distance/7); } else { BD_L_leg_1.scaleZ = 1; } 7 is the Distance value of the distance tool. And here's the script attempt (that don't works actually) to add (multiply) the Master Icon stretch value to the distance tool value. This way it's supposed to cancel the extra stretch when I scale the Master Icon. I used to try with only the Scale X of the Master Icon and it "worked", only, when I scaled the Master Icon in Y or Z, it didn't worked. So I attempted to connect all the 3 axis separately, but it don't works. I guess it's just the way to write the script, telling I want it to multiply the Distance Tool value (7) with the X, Y or Z of the Master Icon (or only X and Z or only Y and X etc etc). Here's the script attempt: 2- if ( RG_L_legStretchDistanceDimension_Shape1.distance > 7*(RG_C_masterIcon_1.scaleX || RG_C_masterIcon_1.scaleY || RG_C_masterIcon_1.scaleZ)) { BD_L_leg_1.scaleZ = (RG_L_legStretchDistanceDimension_Shape1.distance/7*(RG_C_masterIcon_1.scaleX || RG_C_masterIcon_1.scaleY || RG_C_masterIcon_1.scaleZ) ); } else { BD_L_leg_1.scaleZ = 1; } Here's some picture to show what happen (Maybe it'll help to understand the problem) 1. Initial pose: 2. Normal leg stretch (without scaling the Master Icon): 3. And now the problem it goes when I scale the Master Icon (the legs aren't stretched voluntarily they are at their initial pose (like on the 1st pic, only the Master Icon got scaled)) - What I want is that the pose stay like on the 1st pic when I scale the Master Icon. __________________ Portfolio | Videos share quote
 11 November 2012 ldunham1 Character TD portfolio Lee Dunham Character Rigger Surrey, United Kingdom personally i'd suggest not to do this with expressions, try nodes instead, it'll be far easier to see what is going on, and building upon it The problem is that the value in which the distance is being compared to (to tell it when to stretch) isn't scaling along with the master scale. and for simplicities sake, you could create a new 'uniformScale' attribute on the master control and connect the scale attributes to it, meaning then you only need to compare against one attribute. __________________ ldunham.blogspot.com share quote
 11 November 2012 CGTalk Moderation Expert 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.