To kick off this new blog I want to dive straight in for a specific Thinkbox Deadline feature. For those who don’t know Deadline is a render manager, similar to Backburner. Deadline has tons of advantages over the fairly outdated Backburner. I can honestly say that the cost of Deadline is small compared to the hours is it GOING to save you on wasted render time, and not least work hours spent on hunting down errors with the renders. Best of all, if you’re a freelancer or a small studio Deadline is free for two nodes.
Anyway, one of the really nice things about Deadline is the Sanity Checker. I will look at the one for 3dsMax here. Before you send your scene off it will check numerous things that can cause issues and common mistakes, and warn you about it.
One of the issues I kept seeing a lot was the render elements not being saved when people used the V-Ray Frame Buffer.
This happens when a user have the VFB enabled, but have not specified to Save Separate Render Channels. It can be solved it two diffent ways:
1. Disable the VFB, and let 3dsMax use it’s regular internal system
2. Enable Separate Render Channel and choose an output path.
Understandably it can cause a lot of frustration sending out your large render job, only to find all the render elements are missing hours or maybe days later! So how do you add this as a check into the Sanity Check?
Luckily Thinkbox has thought about this. For 3dsMax you have to go into your Deadline Repository.
All the sanity check files and more are located here. To make it easier and prevent custom code being lost if you update Deadline there are two files you need to be aware of. The SubmitMaxToDeadline_SanityCheck_General.ms holds the default sanity checks shipped with Deadline. While SubmitMaxToDeadline_SanityCheck_Private.ms is the file where you can add your custom checks. This file should not be overwritten by any updates, while the general most likely will be.
Looking at the Private file it is all normal MaxScript code, and it’s divided into three different sections.
SMTD_Private_SanityCheckFunctions: Here you add your check as a function. It should return false if the check fails. True if everything is ok.
SMTD_Private_RepairFunctions: Here you add the function on repairing the issue if found.
SMTD_SanityChecksToPerform: This part ties it all together. You add in the checks you write along with the error message the user will see.
The General file is great for reference, but do not edit this one!
So lets dive into the real stuff! Open SubmitMaxToDeadline_SanityCheck_Private.ms and remove the two blank functions. Let us first off all create the Custom Sanity Check Function. It needs to do a couple of things.
1. Check if we’re actually using V-Ray as the current renderer.
2. Check if the V-Ray Frame Buffer is enabled
3. Lastly if the VFB is enabled, is the Separate Render Elements disabled?
4. So if VFB is enabled, but Separate Render Elements is not. We need to fix this. Return false. If not return true.
Let’s call this function CheckForVFB. This is the code I have written for this check, following my outline above.
fn CheckForVFB =
vr = renderers.current -- get current render engine
-- If the name of the render matches V_Ray* then check if VFB enabled and Separate Render Channels is disabled
if matchPattern (vr as string) pattern:"v_ray*" ingnoreCase:true then
if vr.output_on == true AND vr.output_splitgbuffer == false then
The next step on how to deal with this issue involves a bit of personal taste. We could enable Separate Render Channels, but then we need make sure the path is set correctly. I am going the easy route here. I want to warn the user about the issue, and the fix will be just disabling the V-Ray VFB. The fix will only be applied if the user right click the error. They can fully fix it manually in any other way now that they will get the warning.
I call my Repair Function FixVFB. The code for this fix is very simple.
fn FixVFB =
vr = renderers.current -- Get current render engine
vr.output_on = false -- Disable V-Ray Frame Buffer
If you want you can also add a message to the user that VFB has been disabled. This could be a good idea. If so add something like this line right above the last bracket.
SMTD_SanityCheck_errorReportRollout.log_action “Hint” (color 155 0 0) false “V-Ray Frame Buffer (VFB) has been DISABLED!”
Now we have both functions we need. The last step is tying it all together in the SMTD_SanityChecksToPerform section. This is a nested array, and looking at the General Sanity Checks is a great reference here. It contains a few parts.
1. What function to run for the check. The function is inside the SMTD_Private_SanityCheckFunctions struct so the full command is
2. Type what kind of error this is. I would go for a Could Be Fixable = #fix
3. Enter an error message to show to the user.
4. Now enter the function to fix the issue. Same setup as above. Struct name + function name.
5. End with true. To be honest I have not looked up what this does, but it is included in all the checks in the General file.
My custom line then looks like this:
#(SMTD_Private_SanityCheckFunctions.CheckForVFB, #fix, "V-Ray Frame Buffer Enabled, but not Render Channels. Any Render Elements will not be saved!", SMTD_Private_RepairFunctions.FixVFB, true)
That should be it! Let’s test this out!
TADA! Works as a charm. If you right click the warning it will turn off the VFB in render settings.
There is one thing to keep in mind. If you create more functions you need to separate each functions with a comma after the end bracket. This goes for everything except the last function in any struct. Again look at the General Sanity Check file and how this is set up. I have included an image of my full script below should you have any issues.
Since this is one of the first blog posts I am sure there’s a few things that needs to be worked out. Feel free to contact me for any suggestions or if you see any mistakes in the post!