Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
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 16-01-2010, 08:10 PM   #1
Lokjutus
Registered User
 
Join Date: Jan 2010
Location: Croatia
Posts: 11
Thanks: 3
Thanked 4 Times in 2 Posts
Question HUGE rendering problem - batch render different than single frame

Hello to all.

I am sorry that my first post for this great communitiy is a cry for help... but I desperately need some help. And sorry for my crappy English.

To cut the long story short, my wife and I are taking a course in video animation and so far we come a long way. Started 3 months ago we had no clue about 3D modeling or animation and now we are practically done with our scene, ready to render. But, here came our biggest problems yet...and it's 7 day until our project is due.

Batch render doesn't work as we expected, or as it should...but single frame render does. We started animating our cameras and objects, and we made some changes to some objects after that, moving them and creating some new lights, etc. Those objects and lights that we change don't show in batch rendered images at all!! For example, if we moved an object just a few units to the right, that object didnt show in batch render any more..same with lights...

we are frustrated, its a big problem for us cause we have to be done with our project in 7 days and we started to do single frame render and save them one by one as stills.. but we are dead tiered and not even half way done..

if anyone has any idea why this happens and what to do ti fix this, please help 2 desperate souls.
Lokjutus is offline   Reply With Quote
Old 17-01-2010, 12:29 AM   #2
Gen
Moderator
 
Gen's Avatar
 
Join Date: Dec 2006
Location: South FL
Posts: 3,457
Thanks: 13
Thanked 635 Times in 558 Posts
Default Re: HUGE rendering problem - batch render different than single frame

Originally posted by Lokjutus
...... we made some changes to some objects after that, moving them and creating some new lights, etc. Those objects and lights that we change don't show in batch rendered images at all!! For example, if we moved an object just a few units to the right, that object didnt show in batch render any more..same with lights....
Not sure but could it be that your render camera's clipping plane is too low so it's snipping off your scene? That's the only thing that came to mind. Hope you guys sort it out.
Gen is offline   Reply With Quote
The Following User Says Thank You to Gen For This Useful Post:
jACKMANI (05-05-2011)
Old 17-01-2010, 06:14 AM   #3
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,982
Thanks: 33
Thanked 532 Times in 471 Posts
Default

That's very odd... But it has happened to me as well. Take a look at your ram usage while batch rendering, as it has a tendency to just stop when it hits the limit.

I understand that you are in some trouble with time, so I've made a nasty little hack for you guys. You say single frame renders work? Well, here's a script I've quickly put together for you guys that will render a frame, save it out, render another, etc; therefore bypassing the usage of batch render. One thing to be aware however, is that once it starts, you won't be able to stop it until it finishes, or you force quit the process.

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.

Edit: The newest version can be found here

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.
__________________
Imagination is more important than knowledge.

Last edited by NextDesign : 08-02-2012 at 03:32 AM.
NextDesign is offline   Reply With Quote
The Following 4 Users Say Thank You to NextDesign For This Useful Post:
Antonin Ganner (06-02-2012), anwol (15-01-2011), jabbelmous (15-03-2011), pavithra (26-02-2011)
Old 17-01-2010, 10:29 AM   #4
Lokjutus
Registered User
 
Join Date: Jan 2010
Location: Croatia
Posts: 11
Thanks: 3
Thanked 4 Times in 2 Posts
Default

NextDesign, I am so very much grateful to you and i can certainly say that this is the nicest thing anyone has done for me when i asked for some help online, regarding anything. Thank you so much.

That's so nice that i'm almost sorry that we managed to solve our problem before i read this post .

Anyway, the problem wasn't the far clip plane, full RAM, or anything like that. It seems that somehow (i have no clue how) we had a "DefaultRenderLayer" created in our scene and that layer was checked as unrenderable. Anything that we created or changed after that layer was created seems to be put in that layer, therefor not renderable. (but interesting, still it was renderable as single frame) We haven't created that layer ourselves and have no clue how it was created, and WHY it had uncecked the "Renderable" box..

As for your script, thank you again for making the effort to help us, i will still test it out when we are done rendering. Hope this this thread and your script will help out some other desperate souls.

Cheers.
Lokjutus is offline   Reply With Quote
The Following 2 Users Say Thank You to Lokjutus For This Useful Post:
michaelcawood (07-01-2011), NextDesign (19-04-2011)
Old 17-01-2010, 05:34 PM   #5
G-Man
Subscriber
 
G-Man's Avatar
 
Join Date: May 2004
Location: Bowling Green. Kentucky U.S.A.
Posts: 810
Thanks: 9
Thanked 27 Times in 23 Posts
Default

Damn mate,
That was way above and beyond Next design...
My kinda guy
G-man
__________________
Follow My Business
On The Web!
Or
On Facebook!
G-Man is offline   Reply With Quote
The Following User Says Thank You to G-Man For This Useful Post:
NextDesign (19-04-2011)
Old 17-01-2010, 06:29 PM   #6
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,982
Thanks: 33
Thanked 532 Times in 471 Posts
Default

Glad to help guys.

You don't know how nice it is to have a request that is fully described, and asked for nicely. It really makes the difference
__________________
Imagination is more important than knowledge.

Last edited by NextDesign : 25-10-2011 at 07:01 PM. Reason: Grammar
NextDesign is offline   Reply With Quote
Old 12-08-2010, 02:58 AM   #7
Giantbean
Registered User
 
Join Date: Aug 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Similar issue.

I am having a similar issue. I do a local render and the image comes out looking great but when I batch render the image is much flatter, some of the textures don't seem to work at all.

I am using final gather and it seems that its not using the effect in the batch render. I also loose glows and incandescence but fur looks like its on fire.

I don't have any render layers and Im not sure how to set up a final gather render pass. Would NextDesign's code work to render what I need? And if so how do you use that code in Maya 2010?

I have attached a RAR with a local screen capture jpeg of an .iff and a batch Tiff Frame so you can see the difference.

Thanks.
Attached Files
File Type: rar shot2.rar (144.6 KB, 259 views)
Giantbean is offline   Reply With Quote
Old 07-01-2011, 05:26 PM   #8
michaelcawood
Registered User
 
michaelcawood's Avatar
 
Join Date: Jan 2011
Location: Austin TX / Los Angeles CA
Posts: 4
Thanks: 1
Thanked 1 Time in 1 Post
Default

We've had similar problems on our short film. One thing to look out for is that if you have some referenced and instanced objects you may need to import the references into your scene for Batch rendering to work. We had some referenced clouds instanced across the scene that didn't show up in batch render until we imported the reference. Very odd but it's a work around.
michaelcawood is offline   Reply With Quote
Old 09-01-2011, 04:22 PM   #9
anwol
Registered User
 
Join Date: Jan 2011
Posts: 2
Thanks: 1
Thanked 1 Time in 1 Post
Default 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]
anwol is offline   Reply With Quote
The Following User Says Thank You to anwol For This Useful Post:
NextDesign (19-04-2011)
Old 13-01-2011, 10:07 PM   #10
anwol
Registered User
 
Join Date: Jan 2011
Posts: 2
Thanks: 1
Thanked 1 Time in 1 Post
Default

Originally Posted by NextDesign View Post
Glad to helps guys.

You don't know how nice it is to have a request that is fully described, and asked for nicely. It really makes the difference
Hi there,
Im hoping you can tell me how to revise your script so that it calls on the Mental ray engine instead of the Maya software.
I am using Maya 2009 and the render view & globals are set to MR.
Any help would be so very appreciated.
Best,
a
anwol is offline   Reply With Quote
Old 14-01-2011, 07:04 AM   #11
NextDesign
Technical Director
 
NextDesign's Avatar
 
Join Date: Feb 2004
Posts: 2,982
Thanks: 33
Thanked 532 Times in 471 Posts
Default

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

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! (http://www.creativecrash.com/forums/...on_post_306312)

Edit: Fixed a small bug that would stop all frames from being rendered.
__________________
Imagination is more important than knowledge.

Last edited by NextDesign : 24-01-2011 at 01:14 AM.
NextDesign is offline   Reply With Quote
The Following 5 Users Say Thank You to NextDesign For This Useful Post:
Antonin Ganner (06-02-2012), BabyDuck (22-02-2011), bullet1968 (14-01-2011), MystaPaul (25-01-2011), tweetytunes (18-02-2011)
Old 14-01-2011, 07:57 AM   #12
bullet1968
Lifetime Member
 
bullet1968's Avatar
 
Join Date: Feb 2010
Location: Australia
Posts: 4,255
Thanks: 158
Thanked 651 Times in 621 Posts
Default

ND you are a bloody champignon mate...kudos to you for the help with these problems..

cheers bullet
__________________
bullet1968

"A Darkness at Sethanon", a book I aspire to model some of the charcters and scenes
bullet1968 is offline   Reply With Quote
The Following User Says Thank You to bullet1968 For This Useful Post:
NextDesign (19-04-2011)
Old 14-01-2011, 10:18 AM   #13
arindam2007c
Registered User
 
Join Date: Jan 2011
Posts: 2
Thanks: 0
Thanked 2 Times in 2 Posts
Default

u r great...man.
it really works great.
it will avoid many internal errors during batch render.
arindam2007c is offline   Reply With Quote
The Following User Says Thank You to arindam2007c For This Useful Post:
NextDesign (19-04-2011)
Old 17-02-2011, 11:45 PM   #14
aguayo.Andrez
Registered User
 
Join Date: Feb 2011
Posts: 2
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Hey I am having a similar problem with my batchrender. This script could really come in handy but whenever I try and run it I am also having an error. If someone could help out I would be very grateful.

the error is ( // Error: renderWindowEditor: Object 'renderView' not found)

I am trying to render in Mental Ray out of a camera I have set up. anyone know what is causing that error?


maybe I am just filling in something in the first 4 lines incorrectly ...
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 22-02-2011, 01:31 PM   #15
BabyDuck
Subscriber
 
BabyDuck's Avatar
 
Join Date: Nov 2002
Location: USA
Posts: 1,170
Thanks: 3
Thanked 12 Times in 12 Posts
Default

Awesome script ND. 2 little things - just tested in maya 2011 and I get before each render this error:
Code:
# Error: AttributeError: ImageFormats instance has no attribute 'oldOutf' #
Not a deal breaker since the render does work w/o problems.

And also the last line should read
Code:
print ("Completed rendering of " + ($endFrame - $startFrame + 1 ) + " frames.\n");
otherwise it is saying completed one less render than it actually did (not really an issue, just a nitpick.

And I noticed if the files already exists it will ask each time if you want to overwrite it - nice feature, but might be annoying if you got a lot to render - so if you do, just delete the files beforehand.
BabyDuck is offline   Reply With Quote
The Following User Says Thank You to BabyDuck For This Useful Post:
NextDesign (19-04-2011)
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 07:26 PM
Batch Rending Render Layers Ozgalis Lighting & Rendering 7 07-01-2011 07:04 PM
Strange Problem - Unable to change attributes for multiple objects anthonysw3 Technical Issues 4 04-12-2010 11: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-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.