How to Distribute a Single Frame with DrQueue

TracNav(Documentation/TOC)

_(I'm using as base a post of my own on "*DrQueue can indeed distribute single frames over a renderfarm.*

People usually thinks it can't because of my own fault when I named somehow "frame numbers" to what should have been named "task numbers". (I'll try to fix that issue in a future release)

What DrQueue mainly does is sending tasks to the slaves. Those tasks are simple shell scripts that receive some environment variables that let that script know what do they have to render. (check JobScripts"httpblenderartistsorg)_ also)

One of those variables is DRQUEUE_FRAME. The name of that variable is really misleading. Because it is just the task number, not necesarily related to the frame but to one of those divisions into which you decice to divide your animation/frame. That number usually represents a whole frame, but doesn't have to. That is what it was meant for at the early developing stages. But it could be used for any other purpose, for example, a vertical (or horizontal) bar from a single frame.

So what you could have is... to give an example, you have a single frame 1000 pixels width. Then you make 10 'drqueue_frames' x 100 pixels wide columns. Ten divisions of your single frame job. Ten tasks. Ten chunks to distribute.

|-------- 1000 pixels --------|
|C0|C1|C2|C3|C4|C5|C6|C7|C8|C9|
|  |  |  |  |  |  |  |  |  |  |
|  |  |  |  |  |  |  |  |  |  |
|  |  |  |  |  |  |  |  |  |  |
|  |  |  |  |  |  |  |  |  |  |
|  |  |  |  |  |  |  |  |  |  |
|  |  |  |  |  |  |  |  |  |  |
|  |  |  |  |  |  |  |  |  |  |
-------------------------------

That is 10 vertical bars that can be rendered in 10 different computers simultaneously.

With that, you set the render script like :

; This is the [[DrQueue]] render script
column_width = 100
column_height = 600
start = $drqueue_frame * $column_width
end = (($drqueue_frame+1) * $column_width)-1

render $scene -x1 $start -x2 $end [--frame <your_frame_number>]

Extending this solution, you could even have every animation's frame to be distributed over the network. And the whole animation also distributed, of course.

Like (please, forgive any error that the pseudo code might have):

real_frame_count = 100     ; total number of frames on your final animation
colums_per_frame = 100    ; number of columns a single frame will distribute
column_width = 10           ; every column will be 10 pixels wide

; Then we get the real frame number we're gonna work on
; (remember $drqueue_frame has already been assigned by drqueue)
real_frame_no = floor ($drqueue_frame / $columns_per_frame)

; The total number of columns the job will work on
total_columns_count = $columns_per_frame * $real_frame_count

; Start x coordinate for this column we'll render (to be corrected later)
start = floor($drqueue_frame/$columns_per_frame)*$column_width
; Ending x coordinate for the column (to be corrected later)
end = (floor($drqueue_frame/$columns_per_frame)+1)*$column_width)-1

; Corection amount
image_width = $column_width * $columns_per_frame
correction = $real_frame_no * $image_width

; Corrected values
start = $start - $correction
end = $end - $correction

; The start value would be 1000 pixels higher for the second frame (=1)
; 2000 for the third (=2) ... (because we start counting at zero)

; Then execute the render command
render $drqueue_scene -x1 $start -x2 $end -f $real_frame_no

NOT FINISHED YET