arunspooja
05-13-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`;
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";
}
Thankyou
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`;
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";
}
Thankyou
