PDA

View Full Version : MEL Startup question


neonoodle
08-25-2005, 07:28 AM
Hi all,
I'm trying to set the default time and resolution so that whenever Maya starts up, it will automatically go to ntsc time units and NTSC resolution. I made this script that does it if I run it in Maya:

Code:
currentUnit -t ntsc -updateAnimation 1;
setAttr "defaultResolution.width" 720;
setAttr "defaultResolution.height" 486;
setAttr "defaultResolution.deviceAspectRatio" 1.333;
setAttr "defaultResolution.lockDeviceAspectRatio" 1;

but if I put it in the userSetup.mel file, the settings wont change and the resolution is back to 640x480 and the time is whatever I set it to last.

How can I make this work?

Thanks!
David

harmless
08-25-2005, 08:25 PM
Make a Render Settings>Preset through the UI or through script then do a

loadNodePresets "myCoolPreset";

in your userSetup.mel



Cheers

osamo
12-02-2005, 03:50 PM
When I do that and restart Maya, the Mel Stack Trace windows says:

Cannot find procedure "loadNodePresets".
Start of trace: (file:
../../../scripts/userSetup.mel, line 3).

But if I enter
loadNodePresets "myPreset";
at the GUI's command line, it does load my configuration of Render Globals.

Why?

harmless
12-02-2005, 05:57 PM
The melscript isn't loaded into memory so you can't call the function.

Add this line before the call to the procedure:

source unifiedRenderGlobalsWindow.mel;





Cheers

osamo
12-02-2005, 07:52 PM
Hello again,
I enteredsource unifiedRenderGlobalsWindow.mel;
in my userSetup.mel so now it reads:
MJPolyTools;
source unifiedRenderGlobalsWindow.mel;
loadNodePresets "myPresets";
Now the window with the warning "Cannot find procedure" doesn't popup when starting Maya, but the Render Globals are still the default, not the 'myPresets' ones .

Osa.

P.S. My preferences are Maya Software rendering and the version is 7.0

harmless
12-02-2005, 11:33 PM
Under Render Global Settings>Presets>Set Preferred Preset>"myPreset"

You don't need to use melscript.

osamo
12-03-2005, 12:57 AM
Oh, yes, but in my case I must use the command line only, no GUI, like
$ maya -file x -script y.mel
and also
$ maya -render z.ma
I've read the howto at http://www.ewertb.com/maya/mel/mel.php?howto=65
I wonder if there is a sanctuary of default render globals in the Maya code that can be tweaked.
I haven't found the
renderGlobalsWindow.mel

in my system.

Quoting ewertb.com:
Note that the "renderGlobalsWindow.mel" script uses the UI for
obtaining the current settings, defeating the ability to simply call the
functions within it to specify your own setting.
but I'm not sure if that means that the render globals simply can't be set outside the GUI!
Thanks again.
Osa.

CGTalk Moderation
12-03-2005, 12:57 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.