PDA

View Full Version : Set Working Units


russ_c
12-02-2007, 05:48 AM
Is it possible to set the working units preference with MEL. I can't seem to figure it out.

Thanks for the help,

Russ

russ_c
12-02-2007, 06:48 AM
I figured it out. Maya uses the procedure changeLinearUnit , thus the answer to changing working units to centimeters would be the following command:

changeLinearUnit "centimeter";

GiantG
12-02-2007, 07:45 AM
optionVar -stringValue "workingUnitLinearDefault" "cm";
optionVar -stringValue "workingUnitAngularDefault" "deg";
optionVar -stringValue "workingUnitTimeDefault" "pal";

russ_c
12-02-2007, 08:35 AM
Yes, that sets the user preference for the default working units, but it does not change the current units of the opened scene (like when you go to the preference window and select settings>working units>linear)

The reason I was looking for the solution of changeLinearUnit is because I want to batch change a bunch of files that were previously set to inches. But I failed to make that clear in my first post didn't I!? ;)

Thanks for pointing that out though,

Russ

AtrusDni
04-17-2008, 10:58 PM
In 2008, that code errors out, instead you need to use this:

changeLinearUnit("cm");

Dont know when this was changed, probably ver 8 of Maya.

GiantG
04-18-2008, 07:41 AM
I disagree..

It's working on Maya 2008...

AtrusDni
04-18-2008, 04:48 PM
GiantG, are you using a fresh install of maya 2008, or one of the extension packs? Cause fresh new install does not work on my machine. ?

GiantG
04-21-2008, 07:18 AM
I use a fresh install. No Extension...

strarup
04-22-2008, 08:06 AM
hi,


changeLinearUnit is a runtime command... if you dig a bit further down under the motorhelmet of maya you would discover that the actually command used is currentUnit...

so if changing the linear unit to cm/centimeter... use the currentUnit cmd with the flag -l/-linear to do that...

example...

currentUnit -l "cm";
currentUnit -l "centimeter";


getting which currentUnit linear unit which is used... currentUnit -q -l;

hope that helps a bit... :)

kind regards

Strarup

CGTalk Moderation
04-22-2008, 08: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.