CGTalk > Software Specific Forums > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 07-14-2005, 04:32 AM   #1
Jboy
Frequenter
 
Join Date: Feb 2003
Posts: 143
Send a message via AIM to Jboy
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
 
Old 07-14-2005, 09:26 PM   #2
Robert Bateman
Lord of the posts
 
Robert Bateman's Avatar
Robert Bateman
Software Engineer
United Kingdom
 
Join Date: Aug 2004
Posts: 1,160
did you create the expression before changing the units, or afterwards?
 
Old 07-15-2005, 09:23 AM   #3
Jboy
Frequenter
 
Join Date: Feb 2003
Posts: 143
Send a message via AIM to Jboy
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
 
Old 07-15-2005, 10:06 AM   #4
Jboy
Frequenter
 
Join Date: Feb 2003
Posts: 143
Send a message via AIM to Jboy
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-15-2005 at 10:46 AM.
 
Old 07-15-2005, 10:06 AM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 10:09 PM.


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