Quick Question about how to change properties in an open SMTD with Maxscript:
We have some simple maxscripts that help us setup irradiance passes and beauty passes. These maxscripts pull data stored in cameras and allow our artists to set irradiance values and save paths (and send), then load these values to send the main pass. These scripts just automate the overall process in the standard render dialog - and it worked really well for standard submission to Backburner.
One thing i would like to add to this maxscript is the ability to change certain values in an open SMTD, so we don’t have to keep going back and forth from the maxscript to the SMTD. For example, I want to make a button in the maxscript that will (for irradiance) check the “Limit Number of Machines Rendering Concurrently” to be enabled, then set the spinner value to “1”, at the same time, it would disable “Restart Renderer Between Frames”
Of course, make another button that would reverse these values for sending the main pass.
Any suggestions on how to do this?
Thanks!
This will Set your Submission settings to limits on with 1 machine…
SMTDSettings.limitEnabled = true
SMTDSettings.MachineLimit = 1
…this will set the values and if you send the job off it will be limited to one machine, however you won’t see it change in the interface without calling something to update the interface… either through reloading the rollout or adjusting those controls individually.
SMTD_MainRollout.sub_SubRollout.SMTD_JobOptions.chk_limitEnabled.checked = false
SMTD_MainRollout.sub_SubRollout.SMTD_JobOptions.spn_machineLimit = 1
Dave - that is great stuff!
I have a maxscript up and working - but I cant change values of checkboxes on tabs that are not currently active.
For example, I can change values of the Limit Enabled checkbox and the Machine limit spinner when the job tab is open, but i cant check/uncheck “restart render between frames” because its on an inactive tab “Render”
If i click the “Render” Tab, the opposite is true.
How do I account for the tab switches in the code you attached? (The code below are the lines i am using - is there a way to code the tab between the sub_SubRollout and the Rollout (SMTD_JobOptions,etc)
SMTD_MainRollout.sub_SubRollout.SMTD_JobOptions.chk_limitEnabled.checked = false
SMTD_MainRollout.sub_SubRollout.SMTD_JobOptions.spn_machineLimit = 1
To be more clear about what I am doing:
My Test Script Looks like this:
(
global DeadlineSubmissionSettings_Floater
fn fnsubmitAsSuspendedTrue =
(
setIniSetting SMTDPaths.InIFile "JobSettings" "SubmitAsSuspended" ( (SMTDSettings.SubmitAsSuspended = true) as string)
SMTD_MainRollout.Ui_report ("+Job Options: Submit As Suspended set to [" + true as string + "]")
SMTD_MainRollout.sub_SubRollout.SMTD_JobOptions.chk_submitAsSuspended.checked = true --submit as suspended true update to SMTD
)
fn fnsubmitAsSuspendedFalse =
(
setIniSetting SMTDPaths.InIFile "JobSettings" "SubmitAsSuspended" ( (SMTDSettings.SubmitAsSuspended = false) as string)
SMTD_MainRollout.Ui_report ("+Job Options: Submit As Suspended set to [" + false as string + "]")
SMTD_MainRollout.sub_SubRollout.SMTD_JobOptions.chk_submitAsSuspended.checked = false --submit as suspended true update to SMTD
)
fn fnRestartRendererTrue =
(
setIniSetting SMTDPaths.InIFile "RenderingOptions" "RestartRenderer" ((SMTDSettings.RestartRenderer = true) as string)
SMTD_MainRollout.Ui_report ("+Rendering: Restart Renderer Between Frames set to [" + true as string + "]")
SMTD_MainRollout.sub_SubRollout.SMTD_MaxRendering.chk_restartRenderer.checked = true --"Restart Renderer Between Frames" true update to SMTD
)
fn fnRestartRendererFalse =
(
setIniSetting SMTDPaths.InIFile "RenderingOptions" "RestartRenderer" ((SMTDSettings.RestartRenderer = false) as string)
SMTD_MainRollout.Ui_report ("+Rendering: Restart Renderer Between Frames set to [" + false as string + "]")
SMTD_MainRollout.sub_SubRollout.SMTD_MaxRendering.chk_restartRenderer.checked = false --"Restart Renderer Between Frames" false update to SMTD
)
rollout subrolDeadlineSubmissionSet_ON "ON"
(
button btnDeadlineSubmissionSet_ON "ON" width:140 height:50
on btnDeadlineSubmissionSet_ON pressed do
(
fnsubmitAsSuspendedTrue() --submit as suspended true
-- fnRestartRendererFalse () --restart renderer false
)
)
rollout subrolDeadlineSubmissionSet_OFF "OFF"
(
button btnDeadlineSubmissionSet_OFF "OFF" width:140 height:50
on btnDeadlineSubmissionSet_OFF pressed do
(
fnsubmitAsSuspendedFalse() --submit as suspended true
-- fnRestartRendererTrue () --restart renderer True
)
)
try(closeRolloutFloater DeadlineSubmissionSettings_Floater)catch()
DeadlineSubmissionSettings_Floater = newRolloutFloater "Deadline Submission Settings" 178 180
addRollout subrolDeadlineSubmissionSet_ON DeadlineSubmissionSettings_Floater
addRollout subrolDeadlineSubmissionSet_OFF DeadlineSubmissionSettings_Floater
)
The values are updating in the SMTD, and are being sent with jobs. However, I cant turn on the fnRestartRendererTrue () or fnRestartRendererFlase () because I get a “–Unknown property: “SMTD_MaxRendering” in SubRollout:sub_SubRollout” Error. If i switch to the “Render” tab, enable the Restart Renderer functions in the button press (and disable the suspended jobs), it works fine.
So - what code do i need to use to specify a “Tab” Click - I am guessing that this “Tab” code should be inserted into blocks of code inside the button press?
If anyone can help with this - it would be appreciated. I did more research on dotnet last night, and I think i have found the dotnet/tab areas in the SubmitToDeadline.ms - but I am just not savvy enough to put it all together…Thanks!
For anyone who needs it, the code would be this:
SMTD_MainRollout.dn_tabs.SelectedIndex = 0 (number is the tab)
Cheers!