Welcome to SimplyMaya

SimplyMaya.com has been teaching Maya for eleven years. We believe in teaching the fundamental principles of 3D by example. In our online library you will find more than 500 hours of video training.
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 01-03-2011, 01:44 AM   #16
aguayo.Andrez
Registered User
 
Join Date: Feb 2011
Posts: 2
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I have solved my problem... not really... I just switched from Windows to Mac and ran the same script and it worked. Not sure what the difference is but it worked.

NextDesign thank you so much for this helpful script!
aguayo.Andrez is offline   Reply With Quote
The Following User Says Thank You to aguayo.Andrez For This Useful Post:
NextDesign (19-04-2011)
Old 15-03-2011, 11:26 AM   #17
jabbelmous
Registered User
 
jabbelmous's Avatar
 
Join Date: Mar 2011
Posts: 2
Thanks: 2
Thanked 1 Time in 1 Post
Default

Thanks a lot... Just what I was looking for! Works perfect!
jabbelmous is offline   Reply With Quote
The Following User Says Thank You to jabbelmous For This Useful Post:
NextDesign (19-04-2011)
Old 29-03-2011, 04:46 PM   #18
oznn00
Registered User
 
Join Date: Mar 2011
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default

thank you so much ND its working realy good but when i start render i can't stop it any way thanks again
oznn00 is offline   Reply With Quote
The Following User Says Thank You to oznn00 For This Useful Post:
NextDesign (19-04-2011)
Old 29-03-2011, 05:49 PM   #19
LauriePriest
Moderator
 
LauriePriest's Avatar
 
Join Date: May 2003
Location: London
Posts: 998
Thanks: 0
Thanked 58 Times in 50 Posts
Default

Can you post a scene please, i'm intreagued by what's causing this.
__________________
www.lauriepriest.co.uk
FX supervisor - double negative
LauriePriest is offline   Reply With Quote
Old 11-04-2011, 02:05 PM   #20
j.htlim
Registered User
 
Join Date: Apr 2011
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default help

Hi I know this thread has recently become inactive. But I'm calling out for some help. Hopefully someone will read this and help a very lost person out

So here's the situation:
I am trying to rerender my turntable of my toilet model. Why "rerender"? Because the last time I managed to batch render out the turntable with all it's textures in mental ray- no problems at all. Now, what I am trying to do is rerender a wireframe version of my model using toon lining and a white lambert shade plastered over - using Maya Software.

Like Lokjutus the render view looks perfectly fine. But when it comes to the batch render everything just goes wrong.

I tried using the hack created by NextDesign (both versions) but an error message appeared -
Error: Object not found: renderView

Basically there are two problems. The first is that I can't batch render and second, I still can't render out my render views using the hack.

I am using Maya 2010. Help anyone ?

Here are some images to help you all understand what I'm facing - sorry for the horrible modelling

http://www.flickr.com/photos/26565161@N07/5610063986/

http://www.flickr.com/photos/26565161@N07/5610064048/
j.htlim is offline   Reply With Quote
The Following User Says Thank You to j.htlim For This Useful Post:
NextDesign (19-04-2011)
Old 19-04-2011, 01:51 PM   #21
Dez85
Registered User
 
Join Date: Apr 2011
Posts: 1
Thanks: 1
Thanked 1 Time in 1 Post
Default Please Help - // Error: renderWindowEditor: Object 'renderView' not found. //

Hey there guys, how you doing?

I was wondering if you could help me out with the following error regarding the script for Maya that has been discussed. I am very eager to get this working as my current frame render works considerable faster than Maya batch render which doesn't even load. I am running Maya 2011 x64.

In the script editor I have input the following:



// Batch rendering workaround - John Mather (NextDesign)
string $filename = "ContainmentSHOT1 2";
string $cameraName = "Test:SHOT1";

int $startFrame = 108;
int $endFrame = 234;

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 ("render view", $concatFilename, `getAttr defaultRenderGlobals.imageFormat`)));
else
renderWindowSaveImageCallback ("render view", $concatFilename, `getAttr defaultRenderGlobals.imageFormat`);

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





When I input this into the Mel script the following error comes up:

// Error: renderWindowEditor: Object 'renderView' not found. //

And so I attempted executing it in Python, however only to be greeted with this error message:

# Error: SyntaxError: invalid syntax #

If anyone could possibly help me out with this then I'd greatly appreciate it. I only have a little of a week left to get all this rendered for my final year at university and Maya batch render isn't playing nice. The script would be a dream come true if anyone could help me get it working.

Cheers guys

Derek
Dez85 is offline   Reply With Quote
The Following User Says Thank You to Dez85 For This Useful Post:
NextDesign (19-04-2011)
Old 19-04-2011, 02:38 PM   #22
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Location: Toronto, Ontario, Canada
Posts: 3,234
Thanks: 34
Thanked 518 Times in 456 Posts
Default

Hey guys. I've figured out the problem. Here's the newest version. Also, please note that it renders out of the current camera (Ie. It renders out of the camera that renders when you press the render button [if that makes any sense ])

Code:
// 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");
Hope it helps guys!

-John
__________________
Imagination is more important than knowledge.

Last edited by NextDesign : 19-04-2011 at 10:00 PM.
NextDesign is offline   Reply With Quote
The Following 2 Users Say Thank You to NextDesign For This Useful Post:
Antonin Ganner (06-02-2012), Dez85 (24-04-2011)
Old 18-08-2011, 05:19 AM   #23
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Location: Toronto, Ontario, Canada
Posts: 3,234
Thanks: 34
Thanked 518 Times in 456 Posts
Default

Alright! New version! This version now displays a progress bar while rendering, which also allows the user to cancel the rendering by pressing the ESC key. It also now has support for frame padding, of which the number can be easily controlled with the nFramePadLength variable. The last change is that it will also render in any selected image format from the render globals, not just iff!

Hope you guys enjoy!

-John Mather

Code:
// Batch rendering workaround V4 - 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 = 3;
int $endFrame = 24;
int $nFramePadLength = 4; // eg name.0000.ext (4 zeros)

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;
}

// get the image format in the render globals
int $format = `getAttr "defaultRenderGlobals.imageFormat"`;
string $extension = "";

switch($format)
{
    case 0: $extension = "gif"; break;
    case 1: $extension = "pic"; break;
    case 2: $extension = "rla"; break;
    case 3: $extension = "tif"; break;
    case 4: $extension = "tif"; break;
    case 5: $extension = "sgi"; break;
    case 6: $extension = "als"; break;
    case 7: $extension = "iff"; break;
    case 8: $extension = "jpg"; break;
    case 9: $extension = "eps"; break;
    case 10: $extension = "iff"; break;
    case 11: $extension = "cin"; break;
    case 12: $extension = "yuv"; break;
    case 13: $extension = "sgi"; break;
    case 19: $extension = "tga"; break;
    case 20: $extension = "bmp"; break;
    case 22: $extension = "mov"; break;
    case 30: $extension = "pntg"; break;
    case 31: $extension = "psd"; break;
    case 32: $extension = "png"; break;
    case 33: $extension = "pict"; break;
    case 34: $extension = "qtif"; break;
    case 35: $extension = "dds"; break;
    case 36: $extension = "psd"; break;
}

// start the progress bar
global string $gMainProgressBar;

progressBar -edit -beginProgress -isInterruptable true -status "Rendering..." -maxValue $endFrame $gMainProgressBar;

for ($i = $startFrame; $i <= $endFrame; $i++)
{
    // check for user termination
    if(`progressBar -query -isCancelled $gMainProgressBar`)
        break;

    currentTime $i;

    renderWindowRender redoPreviousRender renderView;

    // pad the frame number
    string $framePadded = $i;
    
    while (`size($framePadded)` < $nFramePadLength)
        $framePadded = ("0" + $framePadded);

    string $concatFilename = $directory + $filename + "." + $framePadded + "." + $extension;

    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`);

    progressBar -edit -step 1 -status ("Rendering frame " + (($i - $startFrame) + 1) + " of " + (($endFrame - $startFrame) + 1)) $gMainProgressBar;    // update the progress bar
        
    print ("Saved " + $concatFilename + "\n");
}

progressBar -edit -endProgress $gMainProgressBar;    // clear the progress bar

print ("Completed rendering of " + (($endFrame - $startFrame) + 1) + " frames.\n");
__________________
Imagination is more important than knowledge.

Last edited by NextDesign : 18-09-2011 at 10:52 PM.
NextDesign is offline   Reply With Quote
The Following 2 Users Say Thank You to NextDesign For This Useful Post:
MarleneR (06-12-2013), stwert (23-03-2013)
Old 10-09-2011, 01:29 PM   #24
farbtopf
Subscriber
 
farbtopf's Avatar
 
Join Date: Jul 2005
Location: London
Posts: 520
Thanks: 0
Thanked 1 Time in 1 Post
Default THANK YOU SIR!

wow, thanks a lot for your great script. I had the wiredest error with one of my renders. Whatever I rendered out of batch was a couple of pixels off from where it should be.

Same file, same camera same everything on single frame gives the correct result... No idea why but I'm trying your single frame technique and it works for me.

Thanks again
__________________
www.animateme.me.uk
farbtopf is offline   Reply With Quote
The Following User Says Thank You to farbtopf For This Useful Post:
NextDesign (11-09-2011)
Old 11-09-2011, 03:02 AM   #25
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Location: Toronto, Ontario, Canada
Posts: 3,234
Thanks: 34
Thanked 518 Times in 456 Posts
Default

Thanks farbtopf, I'm glad you found it useful!
__________________
Imagination is more important than knowledge.
NextDesign is offline   Reply With Quote
Old 20-10-2011, 09:48 AM   #26
kayveedeeoh
Registered User
 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Next Design.

A question:
How could I customize this to grab all the settings from a render layer, and render out multiple layers without having to babysit each one?

Last edited by kayveedeeoh : 20-10-2011 at 10:28 AM.
kayveedeeoh is offline   Reply With Quote
Old 20-10-2011, 02:13 PM   #27
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Location: Toronto, Ontario, Canada
Posts: 3,234
Thanks: 34
Thanked 518 Times in 456 Posts
Default

Originally Posted by kayveedeeoh View Post
Thanks Next Design.

A question:
How could I customize this to grab all the settings from a render layer, and render out multiple layers without having to babysit each one?
Hi kayveedeeoh, what do you mean by "grab all the settings from a render layer"? Do you just want all of the render layers to be batched out?
__________________
Imagination is more important than knowledge.
NextDesign is offline   Reply With Quote
Old 24-10-2011, 06:40 AM   #28
kayveedeeoh
Registered User
 
Join Date: Oct 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's exactly it yes. Assuming I have multiple cameras and frame ranges(assigned to different layers) I would like to batch out without having to create a new script for each one.
kayveedeeoh is offline   Reply With Quote
Old 24-10-2011, 11:09 AM   #29
ctbram
Moderator
 
ctbram's Avatar
 
Join Date: Jan 2004
Location: Michigan, USA
Posts: 2,958
Thanks: 42
Thanked 567 Times in 519 Posts
Default

Nice script ND. I like the comments very clear and kudos for giving folks recognition.

Just out of curiosity, why do you have to call "renderWindowSaveImage" in the catch(eval(...)) block in maya 2011 or higher?

I am guessing it is because it is in a try block inside maya 2011 and higher and not in earlier versions?
__________________
"If I have seen farther, it is by standing on the shoulders of giants." Sir Isaac Newton, 1675

Last edited by ctbram : 24-10-2011 at 11:13 AM.
ctbram is offline   Reply With Quote
Old 25-10-2011, 05:58 PM   #30
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Location: Toronto, Ontario, Canada
Posts: 3,234
Thanks: 34
Thanked 518 Times in 456 Posts
Default

Originally Posted by kayveedeeoh View Post
That's exactly it yes.
Hi kayveedeeoh, could you send me a test file? I'll take a look into it. Is the normal batch not working?

Originally Posted by ctbram View Post
Just out of curiosity, why do you have to call "renderWindowSaveImage" in the catch(eval(...)) block in maya 2011 or higher?
Hey ctbram, it's due to an annoying little bug in 2011+ with the ImageFormats:
# Error: AttributeError: ImageFormats instance has no attribute 'oldOutf' #
It still writes out the file, but since it throws an error, the scripts halts. The catch eval pretty much just states "I know there's a problem, just keep going."
__________________
Imagination is more important than knowledge.
NextDesign is offline   Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem solving many dynamic objects in a pile? rohiniduggal Dynamics & Special Effects 3 14-01-2011 06:26 PM
Batch Rending Render Layers Ozgalis Lighting & Rendering 7 07-01-2011 06:04 PM
Strange Problem - Unable to change attributes for multiple objects anthonysw3 Technical Issues 4 04-12-2010 10:56 PM

Thread Tools





A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2014 SimplyMaya - vBulletin® Copyright © 2000-2014, Jelsoft Enterprises Ltd.