Jboy
07-14-2005, 04:32 AM
I'm using this code in an expression to control the offsets of a point constraint. It works when in the default Centimeters working units mode, but on switching to Meters, the offset values get multiplied by 100 on every evaluation of the expression. I have tried dividing the results by 100 to offset this, but it doesn't work. I have also tried using the worldPosition values instead of translateX/Y values. Has anyone run into this problem and found a solution?
string $obj;
string $selection[] = `ls -selection`;
int $test = 0;
for($obj in $selection)
{
if ($obj == "R_Thumb_A_Location" || $obj == "R_Shoulder_Location")
{$test = 1;break;}
}
if($test!=1)
{
R_Thumb_B_Location_pointConstraint1.offsetX = R_Thumb_B_Location.translateX - R_Thumb_A_Location.translateX;
R_Thumb_B_Location_pointConstraint1.offsetY = R_Thumb_B_Location.translateY - R_Thumb_A_Location.translateY;
}
string $obj;
string $selection[] = `ls -selection`;
int $test = 0;
for($obj in $selection)
{
if ($obj == "R_Thumb_A_Location" || $obj == "R_Shoulder_Location")
{$test = 1;break;}
}
if($test!=1)
{
R_Thumb_B_Location_pointConstraint1.offsetX = R_Thumb_B_Location.translateX - R_Thumb_A_Location.translateX;
R_Thumb_B_Location_pointConstraint1.offsetY = R_Thumb_B_Location.translateY - R_Thumb_A_Location.translateY;
}
