AWS Thinkbox Discussion Forums

custom sanity check issue

Hi guys, I recently tried to add my own custom sanity check on submission jobs from 3DS max. When I added my custom array definition for the sanity check, deadline seems to accept the array definition, however when I go to execute a sanity check I get a maxscript error from SMTD_SanityCheck.ms that says "–No “not” function for undefined. I went thru my array definition several times and everything seems to be in order but when I comment out the definition the sanity check seems to work fine again with the standard sanity checks.

If there is any direction anyone can give me on how to further debug this that would be awesome. Thanks.

Cheers, Christian

Hi Christian,

Any chance to post the code you added so we can debug together?
My guess is that your test function does not return a boolean value (either True, or False), but undefined.
In the file you mentioned, the first element of the definition array is called like this:

if not ((SMTD_SanityChecksToPerform[c][1])()) do 

The fact that the error says “no ‘not’ function for undefined” show that the result of the function call performing the actual test was undefined instead of a Boolean, so the NOT failed to invert it.

I could have worded the test differently to avoid this, for example

if ((SMTD_SanityChecksToPerform[c][1])()) == false do

would consider anything that does not return ‘false’ to be True, including Undefined. However, then you would not have noticed that your function is not producing a valid Boolean, and the results of the test could have been misleading…

Thanks Bobo, you were spot on (what’s new, :wink:). I was able to fix it as my function was not returning a boolean as you stated. I was also wondering separately if there is a way to enable the sanity check studio wide and have that setting controlled by IT dept rather than the artists (you know, so they can’t turn it off randomly).

Thanks again for our help.

Cheers, Christian

Yes, you can force the Run Sanity Check option to checked studio-wide, but you cannot currently prevent the user from unchecking it manually in the current session if they so wish. I should consider adding that level of control in the future, so you could gray out some controls to prevent the user from changing them. But that might be a bit too draconian… But nothing prevents you from going into the actual SubmitMaxToDeadline.ms file in the Repository and setting the control to enabled:false to gray it out on all machines! :smiling_imp:

checkbox chk_performSanityCheck "Run Sanity Check Automatically Before Submission" align:#left checked:false offset:[-112,-39] ENABLED:FALSE

There are always two files that files how a control’s value is handled (with exception with some controls that are forced to a certain behavior using factory settings): In the Repository\Submission\3dsmax\Main, look for SubmitMaxToDeadline_StickySettings.ini and SubmitMaxToDeadline_Defaults.ini.

The former defines whether a control’s value is sticky or not. A sticky setting remembers the user’s last choice, while a non-sticky setting would respect the global defaults, if any, or would retain the factory default otherwise. So you need to open the file SubmitMaxToDeadline_StickySettings.ini, locate the line

PerformSanityCheck=true

change it to

PerformSanityCheck=false

and save the file.
Then you need to open the file SubmitMaxToDeadline_Defaults.ini and make sure the same line exists in it, and it is set to true (that is the default we ship with). This way, when any of your artists starts SMTD, the setting for the Sanity Check will be forced to be non-sticky, and will end up checked thanks to the Defaults value being true. If you want to disable the Sanity Check studio-wide, just edit the Defaults value to false and voila!

Now this was how SMTD in Deadline 9 and earlier operated. In Deadline 10, this has changed somewhat, since we now also store the last user decisions in the MAX scene file itself. So the defaults and sticky settings only affect NEW scenes that have not been used with SMTD before. Most settings in SMTD will thus persist between sessions by storing their values in the MAX file when it is saved. However, there are a bunch of rather general settings that should not be enforced on a per-scene basis, so we have a third INI file called SubmitMaxToDeadline_ExcludeFromSceneStorage.ini in the Repository. If you open it, you will discover the line

PerformSanityCheck=true

in it, which forces the Sanity Check to NOT save with the MAX scene file. Thus, if your user disables the Sanity Check during a session, that change will not be stored in the MAX file, and if you disabled the Stickiness, it will not restore from the user’s local INI file either. So your global studio settings will be used each time SMTD is opened - if the user closed SMTD or 3ds Max, and restarted SMTD and/or 3ds Max, the Sanity Check will end up checked again in the new session even if it was unchecked in the previous session!

I find this system rather convoluted (so I am updating the docs with more info), but also very very powerful…

Privacy | Site terms | Cookie preferences