Customizing sanity check - some probs

Hi,
is there a way to make the “submit to deadline” max script to reload the sanitycheck_private.ms without restarting max?

It is supposed to reload it each time you restart SMTD itself without restarting Max.

*The Submit To Deadline launcher copies the SMTD component files from the Repository to the local scripts folder if they do not exist or if the date OR time of the repository files does not match the local files.
*Then it loads the local files using fileIn()

So if you modify a repository file like “SubmitMaxToDeadline_SanityCheck_Private.ms” and call the Submit To Deadline launcher MacroScript (the .MCR installed from the Client Setup folders), if the file is different, it should be copied over locally before being reloaded. If you are modifying the local copy under \Scripts, it will be overwritten with the Repository copy and your changes would be lost…

If this is not what you are seeing, please explain what you are seeing :slight_smile:

I’m modifying the local script folder, the one on the C drive - c:\users%username%\appdata … \scripts. Damn. So I should overwrite the depository script and work on that always, right?

Right!

The local copies are there for performance reasons only.
When you launch Max, these copies are pre-loaded as part of the Max boot process.
When you launch the SMTD Laucher Macro, it checks to see if the files in the folder were loaded and whether their size and data matches the ones in the Repository.
If they are loaded and the same, SMTD launches immediately without the need to load everything again.
If they are not loaded or are different, SMTD copies them over again, then fileIn()s them from the local folder (which is faster than fileIn() from remote folder).
Next time you launch Max, these new copies will be pre-loaded and so on…

So you should always modify the Repository and use the SMTD Launcher to manage the local stuff for speed.

Uhm. It gives me a “failed to load the file from depository” error. I think I should talk with the IT for this.
Thanks Bobo! Anyway, if some Vray users are interested, I could post it here - it’s quite useful for me.

That would happen if there is a syntax error in the script, too…

Oh ok. Tried to find the mistake, but looks fine - but I’m also really tired :smiley:
Mind if I post the code? Is really short, I promise

Sure, let me have a look.

Here it is - rusty, I know :blush:

[code]-----------------------------------------------------------------------------------------------------------------------------------------------
–THIS FILE CONTAINS YOUR USER-DEFINED CHECKS TO BE PERFORMED AND THE FUNCTIONS
–TO BE USED TO CHECK AND REPAIR THE SCENE BEFORE SUBMISSION

–THIS FILE WILL NOT BE UPDATED AUTOMATICALLY BY THINKBOX SOFTWARE INC
–AND SHOULD BE USED FOR YOUR IN-HOUSE NEEDS.

(
global SMTD_Private_SanityCheckFunctions
global SMTD_Private_SanityChecksToPerform
global SMTD_Private_RepairFunctions

global SMTD_RepairFunctions
global SMTD_SanityChecksToPerform
global SMTD_SanityCheckFunctions

struct SMTD_Private_SanityCheckFunctions
(
fn vray_dontrenderfinal=
(
if (matchPattern (renderers.current as string) pattern:“V_RAY”) then(
renderers.current.options_dontRenderImage==false
)
),
fn vray_FrameBufferOn=
(
if (matchPattern (renderers.current as string) pattern:“V_RAY”) then(
renderers.current.output_on==false
)
),
fn EveryNth=(
renderSceneDialog.close()
rendNThFrame == 1
renderSceneDialog.open()
)
)–end struct

struct SMTD_Private_RepairFunctions
(
fn vray_FIXdontrenderfinal=
(
renderers.current.options_dontRenderImage=false
SMTD_SanityCheck_errorReportRollout.log_action “Fixed” (color 0 155 0) true “'Don’t render final image turned off.”
),
fn vray_FIXFrameBufferOn=(
renderers.current.output_on=false
SMTD_SanityCheck_errorReportRollout.log_action “Fixed” (color 0 155 0) true “Vray frame buffer turned off.”
),
fn FIXEveryNth=(
renderSceneDialog.close()
rendNThFrame = 1
renderSceneDialog.open()
SMTD_SanityCheck_errorReportRollout.log_action “Fixed” (color 0 155 0) true “Every nth set to 1.”
)
)–end struct


–SANITY CHECK PRIVATE DEFINITIONS

SMTD_Private_SanityChecksToPerform = #(
#(SMTD_Private_SanityCheckFunctions.vray_dontrenderfinal, #fix, “Don’t render final image is ON!”,SMTD_Private_RepairFunctions.vray_FIXdontrenderfinal, true ),
#(SMTD_Private_SanityCheckFunctions.vray_FrameBufferOn, #fix, “Vray Frame Buffer is ON!, will cause problems with render elements!”,SMTD_Private_RepairFunctions.vray_FIXFrameBufferOn, true ),
#(SMTD_Private_SanityCheckFunctions.FIXEveryNth, #fix, “‘Every nth Frames’ is different then 1”,SMTD_Private_RepairFunctions.FIXEveryNth, true )
)–end checks array

)–End File
[/code]

Thanks for posting the code! I think the problem is this line:

#(SMTD_Private_SanityCheckFunctions.FIXEveryNth, #fix, "'Every nth Frames' is different then 1",SMTD_Private_RepairFunctions.FIXEveryNth, true )

It should be this:

#(SMTD_Private_SanityCheckFunctions.EveryNth, #fix, "'Every nth Frames' is different then 1",SMTD_Private_RepairFunctions.FIXEveryNth, true )

You just had “SMTD_Private_SanityCheckFunctions.FIXEveryNth” instead of “SMTD_Private_SanityCheckFunctions.EveryNth”. :slight_smile:

Cheers,

  • Ryan

fn EveryNth=( renderSceneDialog.close() rendNThFrame == 1 renderSceneDialog.open() )
This won’t work well.
The function must RETURN true or false.
But renderSceneDialog.open() returns OK.

You have two options here:

fn EveryNth=( renderSceneDialog.close() local result = rendNThFrame == 1 renderSceneDialog.open() result )
or

fn EveryNth=( renderSceneDialog.commit() rendNThFrame == 1 )

Also, what happens when VRAY is NOT the renderer?

fn vray_dontrenderfinal= ( if (matchPattern (renderers.current as string) pattern:"*V_RAY*") then( renderers.current.options_dontRenderImage==false ) )
This will return undefined if the renderer does not match V_Ray* because THEN without ELSE returns undefined if the test fails.
Same in the case of

fn vray_FrameBufferOn= ( if (matchPattern (renderers.current as string) pattern:"*V_RAY*") then( renderers.current.output_on==false ) )

You should add an ELSE TRUE to pass the test. See the “SubmitMaxToDeadline_SanityCheck_General.ms” functions for examples - they all have IF … THEN … ELSE TRUE to avoid a problem when the condition is not met.

Thank you so muhc guys, learned a lot!