just want to ask where I should look for an option to add a user specified pre-render Maxscript during the submission?
I’ve looked into the .PY files in both the job plugins and the submission scripts folders, but I can’t really make up where to place this flag/option so I can modify the submission dialog to include a line for a Pre-Render MAXScript (for some automation processes).
Thanks a lot in advance for any tips in this regard.
I think you want the “PreFrameScript=” flag, which would be executed before each frame is rendered. If you are looking to execute the script only after the scene file is loaded, then you can use the “PostLoadScript=” flag. You can find how the 3dsmax submitter sets this in the SubmitMaxToDeadline_Functions.ms file in \your\repository\submission\3dsmax.
Altough I’m afraid I broke the integrated 3ds Max submission scripts since you had hard-coded the submission of the PreLoad etc… scripts with the scene file. However, when I modified the scripts, the 3ds Max plugin script assumed automatically a stripped down file-name of the script itself and combined it with the path leading to the Deadline jobs directory. I had to modify that so the whole process preserved the correct, full, path to the script file itself. I assume I’d have to modify the integrated Deadline submission script in Max as well to reflect this change.
Yeah, you would have to, otherwise the plugin won’t be able to find the script. The other solution is to just handle both cases in the 3dsmax plugin. For example:
A very good point, Ryan, thanks! I’ll check this one out and if it works, I’ll release the modified submitter here so you can decide if you want to bundle it with Deadline. What do you say?
Also, one last modification I’d like to make is when the job is submitted, but suspended, if I want to change the properties of the job and I want to change my script files that’ll get submitted with the job, what file do I have to modify? Is it the 3dsmax.options?
That’s done by design. These two properties define this behavior:
Required=false
DisableIfBlank=true
If you want an option to always be shown, you could do this:
This is for a string property, which is why the Default is blank. As an alternative though, you could have your submitter always specify these properties:
If preLoadFile is blank, it won’t be executed by the max plugin, so you’re safe there, and because the property is defined in the plugin info file, it should appear in the 3dsmax job properties tab.
In order to completely control the order within a category, each property in that category should specify an index. Also, “index” needs to be capitalized.
[PreFrameScript]
Type=filename
Label=PreFrame Script
Category=Scripts
Description=A MAXScript file which gets executed BEFORE each rendered frame.
Required=false
DisableIfBlank=false
Default=
Index=40
Finally, we’ll be updating 3dsmax.py in the next release to support absolute paths to scripts, but in the Monitor script, we’ll continue to strip the paths and submit the script files with the job to maintain consistency with SMTD. Thanks again for the code!
Glad to hear it! We probably won’t include the changes to 3dsmax.options with the release because those only work when the maxscript files are on the network and aren’t being submitted with the job. Because SMTD and our out-of-the-box monitor submitters submit the maxscript file with the job, it doesn’t really make sense to expose an option to change it.
A problem I see is that the the options file won’t be able to differentiate if the script file is a full path or just a file name, and we shouldn’t be showing the option if it’s just a file name. We would almost need separate property names for if it’s a full path or not. Because we’re so close to the end of the beta, we’re hesitant to add any additional features at this point, but I’m sure we can take another look during the next beta.