View Full Version : MEL command to change linear unit

02 February 2008, 10:30 AM

i am searching the MEL command that changes the linear unit to meters.

i am bored of changing this everytime i start maya for a new scene...

thanks for any input.

02 February 2008, 10:45 AM
normally you should be able to save it with your preferences... but I know that sometimes maya just doesnt want to handle it (the good old vanishing mental ray tabs .. hehe).

here is your command:

currentUnit -linear "m";


02 February 2008, 10:53 AM
heya !

yep, i have played with that command, but the general scene unit setting in the preferences is not displayed accordingly... is that just a «display issue» because the prefs window is not updated ?

it remains a bitter taste ...

02 February 2008, 11:06 AM
you dont have to keep it open. just close it. do the change and reopen it.

i think its because the changes in preferences just effects them when saved as long you do not save it nothing will happen... or something like that. but it willl change I tested it myself.


02 February 2008, 11:10 AM
aaah, me likes...

will put this to the userSetup.mel...

thanks !

02 February 2008, 11:28 AM
yes !

i put it like this in the userSetup.mel file:
from an other thread i know that at maya startup, the userSetup.mel files are executed before the actual new scene is generated.
for exaple if you add the command «sphere;» in the userSetup.mel, the sphere will not show up because it had already been deleted by the file -n command which is the last standard command at maya startup.
--> just use the evalDeferred command that waits until maya has completely started up and is IDLE for the first time.

evalDeferred ("currentUnit -linear \"m\"");

02 February 2008, 12:24 PM
cool... thx for sharing

CGTalk Moderation
02 February 2008, 12:24 PM
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.