View Single Post
# 9 09-01-2011 , 04:22 PM
Registered User
Join Date: Jan 2011
Posts: 2

adjusting the render script

Hi,
I tried your script- it works fantastic!
Is there anyway to make it work with mental ray as the rendering engine?
I cant figure out where or what to adjust.
Many thanks
a






I haven't tested this as I don't have Maya installed on this machine, but it should work without problems.

Open up your script editor, and change the first 4 lines to your requirements.

Filename is used for something like "render.001.jpg"
Camera, is the camera you want to render out of
Start and end frame are self-explanatory.

If you have problems setting this up, just give me your requirements, and I'll do the changes for you.

Code:
string $filename = "render";
string $cameraName = "persp";

int $startFrame = 1;
int $endFrame = 24;

string $directory = (`workspace -q -rd` + "images/");

for ($i = $startFrame; $i <= ($endFrame - $startFrame); $i++)
{
    currentTime $i;

    render  -x `getAttr defaultResolution.width` -y `getAttr defaultResolution.height` $cameraName;

    string $concatFilename = $directory + $filename + "." + $i;

    renderWindowSaveImageCallback ("renderView", $concatFilename, `getAttr defaultRenderGlobals.imageFormat`);

    print ("Saved " + $concatFilename + "\n");
}

print ("Completed rendering of " + ($endFrame - $startFrame) + " frames.\n");
Hope this helps guys.[/QUOTE]