Is there a way to run a MAXScript file prior to rendering?

I have a problem I need to solve automatically. It has mainly to do with paths etc… inside a Max scene that I need to override prior to rendering.

I can specify a pre-render script in the scene itself, but that’s not error-proof.

I need a way, during the submission, to be able to specify a maxscript file with all the code in it, that’ll get executed prior to rendering the job.

Right now I don’t see any switch or field where I could link this file to during the submission.

Thanks in advance, cheers…

The name is misleading, but if you think about the way thing work (Deadline Slave picks up a task, loads Max file, then starts rendering and renders one or more frames), then a Post Load Script is the SAME as a Pre Render Script :slight_smile:

In other words, if you want to modify the scene right after it was loaded but before the rendering started, you assign your script in the Post-Load Script field of the SMTD. It will be run after the customize.ms, IIRC.

If you need to resolve some asset pathing issues, you could submit the files with all the maps (assets) stripped via SMTD and use a session path / path configuration file (under “pathing options”) in the SMTD to declare an alternate path configuration file which is just an ASCII ini file that you could build up using 3dsMax via its local paths dialog or via notepad :slight_smile:

Mike

Thanks a lot guys for your help, I appretiate it!

Unfortunately, we don’t submit Max scenes via the integrated SMTD script. We only use the Deadline Monitor for that. :frowning:

But if the 3ds Max submission script could be modified to accommodate such feature, it’d also be great! Is this something that can be quickly done?

Its already there in the “Advanced Options” tab under “Alternate Path File” = *.mxp
Just create the *.mxp file via the 3dsMaxGUI under “Local Paths” dialog…at the bottom there is a “save” button to save out the *.mxp session paths file OR as I said, create the file via hand/shell script.
HTH
Mike

Hmm… didn’t think of this one. Thanks a lot for pointing that out, I’ll give it a shot! :slight_smile:

Ah, I still need a way to execute a more complex script file prior to rendering, since not only do I need to change the paths, but I also need to run some modifications.

I’ll try dissecting the integrated submission script as well as the Monitor submission scripts to see if there is such an option there.

OK.
One option might be to look at the “post submission function” at the bottom of one of the tabs in the SMTD.
Maybe you could change this to be more of a “pre submission function” for your needs?
Alternatively wait a bit for my MXS Job plugin system :slight_smile:

Hmm! Sounds intriguing. :wink:

But I guess I’ll submit a wish for the next version of deadline, since the mapped paths work so great for Nuke etc… (yes, I know why :wink: ), it’d be great if they worked for Max as well. It’s pretty much a simple loop script going through all the ATSOps files (+ some other hard coded for specific purposes, that don’t show up in the ATS dialog).