Friday, 20 May 2011

the code that saved the film

website


mel script:
// Batch rendering workaround V3 - John Mather (NextDesign) // Author page: http://www.creativecrash.com/users/john-mather // Check for updates here: http://simplymaya.com/forum/showthread.php?p=318227 string $filename = "render";  int $startFrame = 1; int $endFrame = 24;  string $directory = (`workspace -q -rd` + "images/");  // check for render panel. Found here: http://www.creativecrash.com/forums/mel/topics/error-object-not-found-renderview string $renderPanel; string $renderPanels[] = `getPanel -scriptType "renderWindowPanel"`;  if(size($renderPanels))      $renderPanel = $renderPanels[0]; else {     $renderPanel = `scriptedPanel -type "renderWindowPanel" -unParent renderView`;      scriptedPanel -e -label "Render View" $renderPanel; }  for ($i = $startFrame; $i <= $endFrame; $i++) {     currentTime $i;      renderWindowRender redoPreviousRender renderView;      string $concatFilename = $directory + $filename + "." + $i;      if (`getApplicationVersionAsFloat` >= 2011)         // Thanks to nowayfra on creativecrash for his workaround         catch(eval(renderWindowSaveImageCallback ($renderPanel, $concatFilename, `getAttr defaultRenderGlobals.imageFormat`)));     else         renderWindowSaveImageCallback ($renderPanel, $concatFilename, `getAttr defaultRenderGlobals.imageFormat`);      print ("Saved " + $concatFilename + "\n"); }  print ("Completed rendering of " + (($endFrame - $startFrame) + 1) + " frames.\n");

No comments:

Post a Comment