Batch server rendering errors: how to catch through scripts?

81 views
Skip to first unread message

Vitali Crystal

unread,
Nov 30, 2013, 12:36:43 AM11/30/13
to python_in...@googlegroups.com
Hello,

I am kind of lost and I need your help. I know that I can do batch rendering through 'render' command and it will also allow me to run callbacks (such as after each frame is rendered). I can even import a python script and run that script as my callback. With that i have no problem.

However: how can I detect when a frame, for example, fails to render and batch rendering stops? Is it detectable through a callback that runs after each frame is rendered? If not, how can I do it? I need it because if such an event occurs, I need to clean up the database, and mark all entries, each corresponding to a frame of the scene, as 'errored'. I can't do it unless I can detect an error through a python script. Can anyone help me? I have already spent hours searching online and have no clue where else to search. Is it even possible?

Justin Israel

unread,
Nov 30, 2013, 1:04:39 AM11/30/13
to python_in...@googlegroups.com
Do you mean you are running them from a command via via "Render"? If so, a failed render should return a non-zero exit status, which you would look for. 
The post callbacks don't seem to run on failure.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/2c3872a7-0f2c-46ce-83df-221b7c0073f4%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Vitali Crystal

unread,
Dec 1, 2013, 1:42:18 AM12/1/13
to python_in...@googlegroups.com
Yea, though I will most likely run a .bat file from C++ code; I might also run it through Python too, but in any case, I guess the only way to check for failure is to get an exit status after running .bat file, right?  This is indeed not perfect, but oh well : (   So, I have to imagine, Maya has no way to render multiple layers not through batch render, does it?  

Because another way I was thinking is to start a maya service itself and then render layers, but I guess now it does not really matter, render command is probably better.

Thanks for the help!

Justin Israel

unread,
Dec 1, 2013, 1:49:44 AM12/1/13
to python_in...@googlegroups.com

Any wrapper scripts would need to properly convey the exit status so that you know if your process succeed.

--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

Vitali Crystal

unread,
Dec 2, 2013, 1:38:37 PM12/2/13
to python_in...@googlegroups.com
Thanks for the reply!

I have one last question - when render command is being run, what happens is on the back-end new Maya process is started and a scene is loaded before being rendered, right?

I wonder, however - I know there is a command called batchRender in Maya - and i can run it for individual layers. But if, say, I loop through all layers and run that command on each, does it mean Maya will load a scene every time?  Can I run it such that it will use the current opened scene?


Justin Israel

unread,
Dec 2, 2013, 4:30:14 PM12/2/13
to python_in...@googlegroups.com
Ya every time you call render, it will do a maya batch, spinning up an instance, loading the scene, and doing the render. 
If you are trying to make a "server", maybe one option is that you spin up N number of non-gui interactive Maya's, and then feed it work over a commandPort. Or a Maya standalone via python and do the exact work you want. 
As far as I know, the straight up render commands do their run with the given flags, and exit.


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages