working Units bug?

Become a member of the CGSociety

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

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  07 July 2005
working Units bug?

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;
}
__________________
-Jeff Gran
Lead Artist
Coccinella Development
My Online Portfolio
 
  07 July 2005
did you create the expression before changing the units, or afterwards?
 
  07 July 2005
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.
__________________
-Jeff Gran
Lead Artist
Coccinella Development
My Online Portfolio
 
  07 July 2005
HAHA!

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.

[edit] I just saw myself become one of those annoying people who screams "bug" when they make a mistake. :( [/edit]
__________________
-Jeff Gran
Lead Artist
Coccinella Development
My Online Portfolio

Last edited by Jboy : 07 July 2005 at 10:46 AM.
 
  07 July 2005
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
CGSociety
Society of Digital Artists
www.cgsociety.org

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

All times are GMT. The time now is 02:06 AM.


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