Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  05 May 2006
Question Error

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

HTML Code:
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`; if(($scalex==$scaley)&&($scaley==$scalez)) { if($scalex!=$travel) { tire.translateY=$scalex; } tire.rotateY=-(tire.translateZ*(($deg)/(2*$pi*$scalex))); } else { error "scale should be uniform"; }
  05 May 2006
don't use == or != to test equality of floats. It rarely works.

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

  05 May 2006
I'd recommend floatEq...
if( floatEq($scalex, $scaley) )
  05 May 2006
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.
Thread Closed share thread

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
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 06:43 PM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.