PDA

View Full Version : 3dsmax pre-render scripts on a farm


Esgar
06-30-2008, 02:10 AM
Hi All,
We are currently trying to run a pre-render script through backburner. It works fine when executed locally to test.
Unfortunately when rendering on the farm this way currentTime.frame always returns 0.
Is there a way to get the currently rendering frame on a render node?
rendStart and rendEnd return the values from the original file submitted to the farm.
There must be some way to get the number of the frame sent to a render node?

Any help appreciated.

ZeBoxx2
06-30-2008, 04:25 AM
looks like a bug - possible. I haven't installed SP1 for 3ds Max 2009 yet.

But doing a quick test with the pre-render script functionality (external file) and an internal #preRender (and #preRenderFrame, for good measure) persistent callback, all writing their values out to a file, I get:


#preRender callback: 25f
pre-render script: 0f
#preRenderFrame callback: 25f


So #preRender fires first, gets the correct frame just fine.
Then the pre-render script is run... returns 0 - whoops.
Then #preRenderFrame is called and has the correct frame again.

So my suggestion, if you need this functionality, would be to ditch the pre-render script method and use a #preRender callback instead. You can still use the file; presuming it's in a network-accessible location, you would just use "fileIn" to evaluate the script file from within the #preRender callback.

Edit: whoops - totally forgot to mention why I tried #preRenderFrame for good measure. You didn't explain what you use this for, but you mentioned "There must be some way to get the number of the frame sent to a render node?". Sometimes nodes may be assigned a range of frames. So if you need some manner of code run for the exact frame, rather than just the first frame in the range, then #preRender (or the pre-render script, for that matter) would be somewhat less than useful.

Esgar
06-30-2008, 05:31 AM
Thanks Richard.
I'll look into adding the script in as a #preRenderFrame callback.
Sorry I was little vague in the original post but we are processing geometry each frame then saving out so it will need to get the current frame not the start of the range.
Also we're using 3dsmax 2008 32 and 64bit which both have the same "bug".
Nice to know it still doesn't work with 2009 :curious:
Cheers,
Edward

ZeBoxx2
06-30-2008, 05:48 AM
cool - #preRenderFrame (or #preRenderEval, possibly...) should be your man, then :)

I'm going to guess that getting the correct begin frame was never really planned for the pre-render script. Given the other files it takes (bat, exe), I can only presume that it is mostly intended for things like copying (dependent) files around before the rendering is performed on the given node, rather than more complex scripting :)

Esgar
06-30-2008, 05:55 AM
Yeah I guess so. Was hoping it would be a little easier to deal with
but there you go - nothing is as easy as it seems :)
Will let you know how I get on.
Cheers,
Edward

Esgar
07-01-2008, 05:58 AM
So the frame number from currentTime.frame is working from a call back as you suggested:

callbacks.addScript #preRenderFrame fileName:"S:\\Test\\colorVertsWithOmnisPreRender.ms" persistent:true id:#zviRender

Thanks for that :)
The script runs fine but then when it gets to the save nodes at the end it doesn't save the file out. Runs fine locally and a generated log file has the correct command but no saved file.

saveNodes targetMesh filename

When logging for frame 8 for example:
Trying to save $PolyMesh:Grid 01-08 @ [34561.351563,-14225.492188,0.000000]. As file = S:\Test\Grid01_small08.max

But no file is created.
Once again works fine locally but not on the farm. Is this another known issue perhaps?

ZeBoxx2
07-01-2008, 10:36 AM
I *think* that might be an intentional limitation of being in slave/network node - it might stand to reason that autodesk wouldn't want 'full seat' functionality provided in slave mode.

Not sure, though :/

Esgar
07-02-2008, 02:47 AM
Hmm I hope not.
Will check it out further.
Can you think of another way to merge vertex colored verts preocessed on the farm?
The idea is to process a large piece of high poly geometry in chunks coloring verts based on the number of lights illuminating them. Then merge the pieces saved out back together.
The processing works fine it's now just the exporting of the data...

ZeBoxx2
07-02-2008, 02:00 PM
if none of the 'save' or 'export' methods work, you could manually export it (openFile, format, close, etc.) to a text or binary file; writing to a text file certainly works.

CGTalk Moderation
07-02-2008, 02:00 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.