Aha, well I did some digging to look into it, and since it’s something we should probably have in our sanity checker too, this is what I added. It’s not the most simple thing to explain how to add these to your existing Private Sanity checks,
Go to your Deadline repository\Submission\3dsmax and open SubmitMaxToDeadline_SanityCheck_Private.ms
Make a backup of it first!
In
struct SMTD_Private_SanityCheckFunctions
add this…
[code]fn CheckforVrayVFBRegion =
(
try(
theRenderClass = substring ((classof renderers.current) as string) 1 3
–print “checking vray vfb”
Case theRenderClass of
(
“V_R” : (
if (renderers.current.output_on) and vrayVFBGetRegionEnabled() then
false
else true
)
default: true
)
)
catch(true)
)[/code]
In
struct SMTD_Private_RepairFunctions
add this
fn FixCheckforVrayVFBRegion =
(
vrayVFBSetRegionEnabled false
)
and in
SMTD_Private_SanityChecksToPerform = #(
add this
#(SMTD_Private_SanityCheckFunctions.CheckForVrayVFBRegion, #fix, "Vray Frame Buffer Region is on!", SMTD_Private_RepairFunctions.FixCheckforVrayVFBRegion, true)
Even as a seasoned Maxscript writer I struggled to get my head around how to add custom Sanity checks, here’s a quick breakdown of how it works. I’ve put two example functions as it’s very important you put the commas (,) in exactly where they are needed.
[code]struct SMTD_Private_SanityCheckFunctions
(
fn CheckFunctionA =
(
–check function A code
–if this function returns true then the check will have passed and you’ll get no warning
true
),
fn CheckFunctionB =
(
–check function B code
–if this function returns false the check will have failed and you’ll get a warning
false
)
)
struct SMTD_Private_RepairFunctions
(
fn FixFunctionA =
(
–code to fix check A
),
fn FixFunctionB =
(
–code to fix check B
)
)
SMTD_Private_SanityChecksToPerform = #(
–the format of these are… #(checkfunction from the SMTD_Private_SanityCheckFunctions struct, the type of warning, the text to go with the warning, the function to fix it, and the result needed to pass the test)
#(SMTD_Private_SanityCheckFunctions.CheckFunctionA, #warn, “Problem A!”, SMTD_Private_RepairFunctions.FixFunctionA, true),
#(SMTD_Private_SanityCheckFunctions.CheckFunctionB, #warn, “Problem B!”, SMTD_Private_RepairFunctions.FixFunctionB, true)
)[/code]
Make sure each function is wrapped in brackets and when adding a second or third function etc, that you always put the , in between the functions.
When you’ve added your check, save the file, restart the Submit to Deadline window and it should load taking slightly longer than normal while it copies over the updated script to your local machine. If you get an error message that means something in the script is wrong and it will default back to loading the old copy on your local machine.