PDA

View Full Version : mentalrayGlobals.preRenderMel


rollmops
02-05-2004, 01:22 PM
Hi,

Does anyone knows how to set an outputpath for mentalray?

This script is maybe missing something:
setAttr mentalrayGlobals.outputPath -type "string" "Y:/house/line_test/INTRO/RIGHT";
:hmm:

Thanx a lot.

Emmortal1
02-05-2004, 08:38 PM
Shouldn't it be this? Not positive though as I'm not a MEL master by any means.

"Y:\\house\\line_test\\INTRO\\RIGHT";

Emmortal

rollmops
02-06-2004, 07:54 AM
Thanx Emmortal,

But it doesn't work either.:shrug:
In fact I'm wondering if the prerenderMel has any effect. Even a stupid print "text" doesn't work.

rollmops
02-06-2004, 08:10 AM
Thanx Emmortal,

But it doesn't work either.:shrug:
In fact I'm wondering if the prerenderMel has any effect. Even a stupid print "text" doesn't work.

djx
02-06-2004, 12:10 PM
I will assume you are attempting command line renders.

To render frames 1 to 25 to d:\myImages you need to create a mel script called mrStart.mel (but the name isnt important).

global proc mrStart()
{
setAttr "mentalrayGlobals.startFrame" 1;
setAttr "mentalrayGlobals.endFrame" 25;
setAttr mentalrayGlobals.outputPath -type "string" d:/myImages;
mrBatchRender_v5;
}

Then launch the render from the commandline using...

mayabatch -file sceneFile -proj projectPath -command mrStart

(obviously substituting sceneFile and projectPath with your name and path)

You can override many of the other render globals in the same way, but there are some quirky things. For example the output folder specified above will be ignored unless you also edit mrBatchRender_v5.mel and change the line

string $imageDir = miSetImageDir();

to

string $imageDir = "";



(mrBatchRender_v5.mel is part of the maya installation, provided as a way of launching a commandline mentalray for maya render)

If you get this far, then its not much extra to use some scripting to generate the mrStart.mel automatically. I have it set up so that I just type "mr sceneName 1 25" at the command prompt and the output folder gets created and the render invoked. I can pass on the details if you are interested.

rollmops
02-06-2004, 01:44 PM
Yes!
Cool! For the first time maya reads the mel, with this lines.
global proc mrStart()
{
setAttr "mentalrayGlobals.startFrame" 1;
setAttr "mentalrayGlobals.endFrame" 5;
setAttr mentalrayGlobals.outputPath -type "string" "Y:/house/line_test/INTRO/RIGHT";
mrBatchRender_v5;
}


But :cry:
rendered pictures allways come to my proj/mentalRay/images/

djx
02-07-2004, 12:26 PM
You are almost there.
You need to track down and edit mrBatchRender_v5.mel
(usually in C:\Program Files\AliasWavefront\Maya5.0\scripts\others)

and change the line

string $imageDir = miSetImageDir();

to

string $imageDir = "";


(This `miSetImageDir()` resets your mentalrayGlobals.outputPath back to what ever was set in your project file paths - which is not what we want here).

MDurante
02-07-2004, 08:32 PM
Just do:
workspace -rt images $rd;

Where $rd is the render directory. It has worked for me in all instances, though perhaps it is not bulletproof.

- Matthew Durante

djx
02-08-2004, 09:52 PM
I think that "workspace -rt images $rd;" only works for batch renders launched from within maya interactive. I cant get it to work as part of a start-up script for a command-line render.

MDurante
02-08-2004, 10:49 PM
No, it works from outside of maya. Check out:
http://www.cgtalk.com/showthread.php?s=&threadid=94005

I've been using variants of this for awhile without problems, though honestly not lately. The version I use is plugged into a network rendering system but it's nearly the same code.

- Matthew Durante

CGTalk Moderation
01-17-2006, 08:00 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.