if render completed/cancelled, do?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
  01 January 2013
if render completed/cancelled, do?

I'm wondering if there is a way to determine if a render was cancelled mid-script since if I cancel a render for my baking script, it still proceeds with the rest.
 
  01 January 2013
This is an interesting problem, mainly due to the fact that I can't seem to find any built-in commands to query the current render state.
What you can do is find out what procedure is called when a particular renderer requires a render, via the `renderer -q -renderProcedure (currentRenderer())` command. Then you have to follow the breadcrumbs through the maze of .mel scripts in Maya's installfolder.

I spent a while scanning over those scripts, and the only really useful piece of information I found was this:

global int $gRenderViewRenderAborted;

I found it in mentalrayPreviewRender.mel, which seems the main rendering procedure linked to mentalRay. Basically, it gets set to 1 if the render is aborted. I assume that this happens with any renderer, though I'm too lazy to read through every renderProcedure of every available renderer.

So try utilizing that variable with your script, basically breaking out of the script if that variable happens to be 1 at a given point.

That's all I can offer at this moment, haven't ever really dealt with renderers in scripts.
 
  01 January 2013
Probably is not the cleanest way to work this out, but can't you check the file state on disk?
What I mean is checking the file size or maybe trying to read it (with the help of a module like this http://excamera.com/articles/26/doc/openexr.html working in your app) and then decide to go on or return?
 
  01 January 2013
the problem with a file detection is that the image could exist from a previous bake. I supposed I could add a deletion of the file at the start of the script.

Also, I'm using V-Ray, so a mental ray script doesn't help much.

Maybe what I can do is add a prompt after the render to ask if it's okay to proceed, but I'll need to rejig my for loop and put all the last bit at the end.
 
  01 January 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:57 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.