View Single Post
# 115 26-02-2017 , 07:04 AM
Registered User
Join Date: Feb 2017
Posts: 1

Wow, it seems this script has attracted quite a bit of attention user added image

Here is a fixed version that will allow rendering in multiple renderers, as well as work in Maya 2011!

Code:
// Batch rendering workaround - John Mather (NextDesign)
string $filename = "render";
string $cameraName = "persp";

int $startFrame = 1;
int $endFrame = 3;

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

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

    // Old version
    // render -x `getAttr defaultResolution.width` -y `getAttr defaultResolution.height` $cameraName;
    
    // New version - supports MR and other renderers!    
    renderWindowRender redoPreviousRender renderView;
    
    string $concatFilename = $directory + $filename + "." + $i;

    if (`getApplicationVersionAsFloat` >= 2011)
        // Thanks to nowayfra on creativecrash for his workaround
        catch(eval(renderWindowSaveImageCallback ("renderView", $concatFilename, `getAttr defaultRenderGlobals.imageFormat`)));
    else
        renderWindowSaveImageCallback ("renderView", $concatFilename, `getAttr defaultRenderGlobals.imageFormat`);

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

print ("Completed rendering of " + ($endFrame - $startFrame) + " frames.\n");
P.s. Many thanks goes out to nowayfra on CreativeCrash for his Maya 2011 fix! (https://www.creativecrash.com/forums/...on_post_306312)

Edit: Fixed a small bug that would stop all frames from being rendered.

wow the script is working very well , but the problem now is that the extension of the images is saving as an ISO image !! lol how does it happens ?!
I set render settings to be the output render image is .png
please help. I need to save as .png or .psd better
Thanks.