Please support to defined OutputFilename1 in SMTDSettings

Discussion and Support of Deadline, the Render Management System
User avatar
Bobo
Posts: 5925
Joined: Tue Nov 15, 2005 10:26 am
Location: Vancouver, Canada
Contact:

Re: Please support to defined OutputFilename1 in SMTDSettings

Postby Bobo » Tue Jul 11, 2017 5:35 pm

Correct. Here are the necessary changes:

* Go to Repository\submission\3dsmax\Main\
* Make a backup copy of the file SubmitMaxToDeadline_Functions.ms just in case.
* Open the file SubmitMaxToDeadline_Functions.ms for editing
* Add the following two properties to the struct SMTDSettingsStructure () definition, and don't forget to add a comma behind the previous last entry...

Code: Select all

      ExtraOutputFilenames = #(),            -- for 3rd party developers, populate with filenames to add to the job's right click menu in the Monitor. Will be indexed automatically as OutputFilename#
      ExtraPluginInfoKeys = #()               -- for 3rd party developers, populate with #(Key, Value) sub-arrays to write custom values to the Plugin Info file.
   )

* Locate the following code block:

Code: Select all

            local limitGroups = ""   --initialize Limits to empty string
            local limitGroupsToUseArray = for i in SMTDSettings.LimitGroupsToUse collect i

* Add the following loop before it:

Code: Select all

            for aFile in SMTDSettings.ExtraOutputFilenames do
            (
               format "OutputFilename%=%\n" outputFilenameIndex aFile to:submitInfoFile
               outputFilenameIndex += 1
            )

            local limitGroups = ""   --initialize Limits to empty string
            local limitGroupsToUseArray = for i in SMTDSettings.LimitGroupsToUse collect i

* Now locate the following codeblock:

Code: Select all

            --EXPORT ADVANCED RENDERING SETTINGS ENDS HERE
            
            Close JobInfoFile
            true
         )
         else
            false
      ),

* Insert the following for loop in it:

Code: Select all

            --EXPORT ADVANCED RENDERING SETTINGS ENDS HERE
            
            for aKeyPair in SMTDSettings.ExtraPluginInfoKeys where isKindOf aKeyPair Array and aKeyPair.count == 2 do
            (
               format "%=%\n" aKeyPair[1] aKeyPair[2] to:JobInfoFile
            )            

            Close JobInfoFile
            true
         )
         else
            false
      ),

* Save the modified file.
* Launch SMTD in 3ds Max - now you have the two new properties, defaulting to #().
* You can set them via your own MAXScript to anything, for example

Code: Select all

SMTDSettings.ExtraOutputFilenames = #("c:/temp/test/something.exr")
SMTDSettings.ExtraJobInfoKeys = #(#("Bobo","Awesome"), #("Answer",42), #("Bad Value"), #("Too Many Values", 1,2,3), 5)


* If you submit a job via SMTD or your own script using SMTDFunctions, your submission will contain an additional output filename in the Monitor's Job Output right click menu, and two additional keys in the Plugin configuration, because the 3rd entry has no value, the 4th entry has too many, and the 5th entry is not an array of two values!
smtd_extrakeysandpaths.png
smtd_extrakeysandpaths.png (52.69 KiB) Viewed 37 times


* Note that the values will persist until SMTD is relaunched, so you would have to ensure both properties are reset to #() when you don't want them included (e.g. after your submission script finishes, you can reset them back to #()).
Borislav "Bobo" Petrov
Product Specialist
Thinkbox Software Inc.

gandhics
Posts: 46
Joined: Thu Dec 12, 2013 2:37 pm

Re: Please support to defined OutputFilename1 in SMTDSettings

Postby gandhics » Thu Jul 13, 2017 7:10 pm

Worked beautifully!
THANKS!


Return to “Thinkbox Software - Deadline”

Who is online

Users browsing this forum: kwatts and 1 guest