View Full Version : working Units bug?

07 July 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;}
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;

Robert Bateman
07 July 2005, 09:26 PM
did you create the expression before changing the units, or afterwards?

07 July 2005, 09:23 AM
it's a script that runs and creates everything, including the expression, so I've tried it both before and after.

If I create the expression after changing the units to meters, it's borked.
If I create the expression before changing the unites, it seems to work fine, but then the dimensions of everything in the scene gets scaled down 100x, which is not useful, since the scale (for exporting reasons) is the whole reason I need to change the working units.

07 July 2005, 10:06 AM

I figured it out. :)

In the script I was using the expression command with the -uc all flag (because that's the default and I just copied and pasted from the script editor when I was writing the script), and changing it to -uc none fixed the problem.

I just saw myself become one of those annoying people who screams "bug" when they make a mistake. :(

CGTalk Moderation
07 July 2005, 10:06 AM
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.