PDA

View Full Version : Batch regionRender evaluated for each frame, i can't :(


bigbossfr
08-15-2009, 05:08 PM
Hello all,
I am writting a python script with batch render and render just the region when objets are selected. I am writting the version 2 of this script :
http://www.highend3d.com/maya/downlo...Tile-5794.html (http://www.highend3d.com/maya/downloads/mel_scripts/rendering/mental_ray/Deex-Render-Booster-Tile-5794.html) and now, i want the script work with animation, etc etc...
For that, i use this attributs:
regionRectX
regionRectY
regionRectWidth
regionRectHeight
on the mentalrayGlobals.

In the preFrame render mel, simply, i put a mel script whitch change the interger valur of the 4 attributs (set attr ...)
What is the problem ?
The problem is the script isn't work for each frame. The batch render just the region with the value of the first frame.
But me, i want change the render region for each frame.

Is it possible ?

The only solution i have found is one batch for each frame. But it is too ugly !
I want :
render -r mr -s 1 -e 10 ...
and not :
render -r mr -s 1 -e 1
render -r mr -s 2 -e 2
render -r mr -s 3 -e 3 ...
Any solution ?

isoparmB
08-17-2009, 05:49 AM
You might not be able to do that, as I don't think you can dynamically change the inputs on the -reg flag on a per frame basis. But getting the raw data of converting a point in 3d space to camera screen space can be automated using Rob Bedrow's script:

http://www.185vfx.com/2003/03/convert-a-3d-point-to-2d-screen-space-in-maya/

You'd just need to parse the data to generate per-frame batch render line commands. It's still one line per frame though, but then again generating those lines can be automated.

bigbossfr
08-17-2009, 06:07 AM
My problem is not to convert 3d space to 2d space (my script on v1 is already doing), my problem it is justly to change the render region per frame in one line render job, and not one line per frame.
So, for this, i don't use the -reg flag, but the extra attribut of my mentalrayGlobal node (regionRectX, regionRectY, etc etc).
And the problem is this attributs are "read" when the job is read (preRender), and not when the frame is read (preFrame).
So when i change the value of the attribute (like regionRectX) with a preFrame script, the value wasn't read.
So me, i want change the renderRegion for each frame, and have juste 1 line for all my job.

Why ?
Imagine a scene with 3000 frames. I don't want 3000 jobs on my renderfarm software (like Smedge, RoyalRender or other...). It is just ugly.
That's the problem.

Generate 3000 lines, i can, but justly, i don't want.

isoparmB
08-17-2009, 06:11 AM
Hm. Possibly put the per frame render lines in a for loop? So that it gets submitted one line at a time. Or put the render jobs in a que, have the next one start only after the first is done.

bigbossfr
08-17-2009, 06:17 AM
If i do that, my job is calculated just by 1 computer.
Perhaps, found a command which say (in preFrame) : reload the scene for the frame.

isoparmB
08-17-2009, 06:24 AM
OR divide the contents of the for loop by the number of pcs you want. Say you have 3000 frames which you want to render on 5 pcs. PC 1 render frames 1 -600, PC 2 renders 601 to 1200, and so on. Each of their for loops would have a different set of single frame render commands.

The problem is as far as I know the arguments of a batch render command can't be changed on the fly. Unless, maybe, in the pre render script you could define a variable and somehow have the batch render use those float variables while rendering for your regionRectX, regionRectY flags. Then it would be possible.

bigbossfr
08-17-2009, 05:46 PM
I can't know the number of computer before. My script is free and for all people.
There is a command to skip frame ?

CGTalk Moderation
08-17-2009, 05:46 PM
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.