[Closed] maxscript, xml and backburner jobs
Hi everyone,
I’m pretty new to maxscript so I don’t know if this problem has been addressed in the past
I work for a architectural visualization company and as such there are a lot of fly through animations to be done.
Basically right now I’m in the process of writing a maxscript for job sumission to Backburner. The process is simple, for every shot/camera the scene gets submitted twice, once to calculate IRmaps and Lightcashe (using vray) and those are saved in a specific dir and the second time to read those and render out the frames. The tricky part is the IR/Lightcashe pass can only be submitted to one machine , as opposed to frames, which can run on any number at the same time. Also IR pass has to finish first before the frames pass begins. We address the latter by assigning dependencies – so that the frames are dependent on the IR pass – but that is done manually.
So far I was able to write a part of the script to submit job like that for every camera in the scene but I don’t know how to manage dependencies.
The reason I brought up XML is, I noticed in the XML file that gets submitted with the job to the backburner manager has a tag <DependsOn><Dependent>number</DependsOn></Dependent>
between those tags is a number which is taken from <JobHandle>number</JobHandle> in the xml file from the job that the current job dependends upon.
So it looks to me that I have get that number from the xml file of the first job and append it to the second. However if I do that by hand the dependecy is not reflected in the backburner queue and the job goes through independently.
So I’m a bit stumped as to what can be done. Also if anyone has any documentation on backburner submission process that would be greatly appreciated.
You can get the job handle through maxscript. Using the NetRender Interface and get a job you simply call <job>.handle to get the handle that corresponds to what you need. I would try sending both jobs Suspended, then send a job to the manager machine (or any machine that can access the manager machine Backburner folder) using a post open callback and use .Net to modify the XML data, then activate the jobs. This is all in theory as when I came up with this idea I was having issues getting jobs from the manager through maxscript.
I would reference Paul Neale’s .Net XML Reading and XML Writing tutorials.
-Eric
EDIT: Also look at this recent thread on dependencies.
the xml dependency setter seems to be working – well sort of.
thanks for the info.
I decided to switch the tequnique of IR map calculation where by I set it to animated object setting and get a single vrmap file for every 5 frames so that I can use all the servers at the same time (not just one) also it is a lot safer as if one server crashes I don’t have to restart the job because the Ir map is ruined.
that said. I am trying to run a post script that would at the end of the job would collect all the induvidual maps and combine them into one vrmap file.
so far I have a script that generates a batch file that runs a irmapviewer.exe utility that comes with vray that can combine those files into one.
as a post script – script , i have something that looks like this:
(ShellLaunch "server\\\folder\\batch.bat" "")
and the batch.bat looks something like this :
"locationofutility\irmapview" -load server\\irmap0000.vrmap -load server\\irmap0005.vrmap ... -save server\\irmap.vrmap -nodisplay
it seems to work perfectly if i already have the maps and just launch the batch file from windows myself. It also works if i am in max and load the script that launches the batch file from the rendering post script menu – that is if I load the ms file and press execute – it work. But i want it to work over network render automatically because the next job is the frames job that takes the result of the batch file – the irmap.vrmap and uses it to render the final image.
I don’t know if any of you have experience with running post script on a network render and how that work but any help would be appreciated.
I posted in the thread that PiXeL_MoNKeY refered to (this one) about using cmdjob.exe which is located in the <3dsmax root> directory. It has the ability to set dependencies without using the python script however it’s for custom jobs, not a max jobs.
So what you would do is this:
- submit all your irradience map jobs,
- submit a custom job using cmdjob.exe that will combine the irradience maps. Make it dependent on those jobs
- submit the actual render job and make it depend on the custom job from step #2 via that python script
For the batch commands, don’t use Max as Gravey mentioned. As he said you can use cmdjobs.exe to handle various tasks. Check the 3ds Max Help and the Backburner Help files to see how to do what you need.
-Eric
It isn’t part of 3ds Max, it is part of Backburner. Look in the Backburner folder.
-Eric
I’ve python functions for that too… I just posted my BackBurner Class to the Python Thread in a “stand alone” version for easy use…
http://forums.cgsociety.org/showthr…965#post5491965
It has functions to return ALL jobs in the queue and set servers and dependencies.
It “should” only require an ActiveState Python install…
http://www.activestate.com/Products…hon/index.mhtml
Thanks a lot guys for all the info
I am not familiar with python but i guess i have look at it if i want to do some serious scripting.
by the way the method that I described above doesn’t work as well as I planned
when combining the IR maps the resulting file is not as consistent as if you were to just render it as multiframe incremental on a single server. As well the cmd.exe can only handle 8000 characters in as single line and when i have load the paths of 100 ir files it is easily over that limit.
So its back to sending ir renders to single machine and setting dependencies.