View Full Version : Error

05 May 2006, 09:11 AM
Good Afternoon

I have made a wheel and if I move the wheel in x direction it should rotate and if the scale is uniform it will align accordingly (to the plane, created as a base or on the grid) . And if the scale is not uniform it will show a error message.

I have written a script for the above but in that all works fine but when the scale is not uniform its not executing the else part.

I cant see the error message.

If you find the solution reply

float $scalex= `getAttr tire.scaleX`;

float $scaley= `getAttr tire.scaleY`;

float $scalez= `getAttr tire.scaleZ`;

float $pi= 3.141592;

float $deg=360;

float $travel=`getAttr tire.ty`;











error "scale should be uniform";



Robert Bateman
05 May 2006, 12:50 PM
don't use == or != to test equality of floats. It rarely works.

if( (abs($sx-$sy) + abs($sz-$sz)) < 0.001 )


05 May 2006, 01:30 PM
I'd recommend floatEq...
if( floatEq($scalex, $scaley) )

CGTalk Moderation
05 May 2006, 01:30 PM
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.