Vray lightcache prerender?

Discussion and Support of Deadline, the Render Management System
squeakybadger
Posts: 56
Joined: Tue Jul 28, 2009 9:50 am

Vray lightcache prerender?

Postby squeakybadger » Wed Apr 19, 2017 12:17 pm

Hi,

I'm trying to sort out a simple workflow for the artists when for tile rendering/jigsaw rendering with high-res still images.

Is it possible to get deadline to send 2 jobs when running the SMTD? I want it to send a prerender that calculates the light cache and dumps that file in the output directory (that doesn't render the final image), and then the other render is able to load the precalculated light cache once that dependancy is completed.

So to break it down:

Submit to deadline script
Render final image is disabled, light cache is set to render in the output dir
Job sends to deadline
Render final image is enabled, lc is switched to "from file" and uses the precalced light cache
Job sends to deadline with the first as a dependency.

Any ideas how to accomplish this?

Thanks for any pointers!

eamsler
Posts: 1398
Joined: Thu Dec 16, 2010 1:02 pm
Location: Winnipeg, MB, Canada

Re: Vray lightcache prerender?

Postby eamsler » Thu Apr 20, 2017 9:44 am

Not yet. This is a semi-common request, but it'll require some heavy rebuild of STMD. There are plans to build some pretty elaborate workflow features one day, but they need some fleshing out and heavy lifting to do right.
Edwin Amsler
Head of Support
Thinkbox Software Inc
1-866-419-0283 ext 804

Winnipeg

User avatar
Bobo
Posts: 5851
Joined: Tue Nov 15, 2005 10:26 am
Location: Vancouver, Canada
Contact:

Re: Vray lightcache prerender?

Postby Bobo » Thu Apr 20, 2017 12:56 pm

As Edwin suggested, the current SMTD does not have this built in yet, but you could script your own submitter UI based on the SMTD functions and settings. In fact, you could pretty much use the SMTD UI for everything, and write a simple MacroScript that sets up the lighting pass, calls the submit function of the SMTD UI, then sets up the dependent render pass, and submits that too.

If you want to discuss the details, please let me know.
Borislav "Bobo" Petrov
Product Specialist
Thinkbox Software Inc.

squeakybadger
Posts: 56
Joined: Tue Jul 28, 2009 9:50 am

Re: Vray lightcache prerender?

Postby squeakybadger » Mon Apr 24, 2017 5:10 am

Hi Bobo,

Yes, I would love the details on how to get that lighting pass working.

Thanks!

eamsler
Posts: 1398
Joined: Thu Dec 16, 2010 1:02 pm
Location: Winnipeg, MB, Canada

Re: Vray lightcache prerender?

Postby eamsler » Mon Apr 24, 2017 9:45 am

Heh. I'm curious too Bobo! :D
Edwin Amsler
Head of Support
Thinkbox Software Inc
1-866-419-0283 ext 804

Winnipeg

User avatar
Bobo
Posts: 5851
Joined: Tue Nov 15, 2005 10:26 am
Location: Vancouver, Canada
Contact:

Re: Vray lightcache prerender?

Postby Bobo » Mon Apr 24, 2017 5:51 pm

Ok, here is a very basic implementation of the steps outlined in the original request:

Code: Select all

(--start local scope
   
--If SMTD has not been opened yet, or has been closed since the start of 3ds Max, launch its UI:
if SMTD_MainRollout == undefined or not SMTD_MainRollout.open do macros.run "Deadline" "SubmitMaxToDeadline"

local theRenderer = renderers.current               --get the current renderer
if isKindOf theRenderer VRay do                     --if it is VRay, we are good to go
(
   --Render final image is disabled, light cache is set to render in the output dir
   local oldRenderDialogState = renderSceneDialog.isopen()      --see if the render dialog was open
   renderSceneDialog.close()                        --close it before submission
   rendSaveFile = false                              --disable output file saving
   theRenderer.options_dontRenderImage = true         --disable the rendering
   local lcpath = getFileNamePath rendOutputFilename + getFileNameFile rendOutputFilename + ".vrlmap"   --build the LC path name
   theRenderer.lightcache_autoSave = true               --enable LC auto-save
   theRenderer.lightcache_autoSaveFileName = lcpath         --and set the file name to the cache path
   
   --Job sends to deadline
   SMTDSettings.PreviousJobsArray = #()                --clear the dependencies list
   SMTDSettings.SubmitAsDependent = false                --disable dependencies for first job submission

   SMTD_MainRollout.getNameFromMaxScene()            --update the job name in the UI
   local oldJobName = SMTDSettings.JobName             --store the current job name
   SMTDSettings.JobName = oldJobName+" [VRay LC]"         --set the LC job's name
   local batchName = oldJobName + " [VRay LC + Render]"      --a batch name to combine the two jobs
   SMTDFunctions.SubmitJobFromUI batchName:batchName      --submit the job to Deadline as part of the batch

   --Render final image is enabled, lc is switched to "from file" and uses the precalced light cache
   rendSaveFile = true                           --re-enable output file saving
   theRenderer.options_dontRenderImage = false            --re-enable rendering
   theRenderer.lightcache_autoSave = false               --disable the auto save mode
   local old_lightcache_mode = theRenderer.lightcache_mode   --store the old mode
   theRenderer.lightcache_mode = 2                  --set LC mode to From File
   theRenderer.lightcache_loadFileName = lcpath            --set the load file to the cached path from the previous submission

   --Job sends to deadline with the first as a dependency.
   SMTDSettings.SubmitAsDependent = true               --enable dependencies
   SMTDSettings.DependencyJobItems = #{1}               --set the dependency on the first entry from the list
   SMTDSettings.DependOnPreviousJobMode = #last         --set the mode to last, so only the last job is concidered
   SMTDSettings.JobName = oldJobName+" [VRay Render]"      --set the job name
   SMTDFunctions.SubmitJobFromUI batchName:batchName      --submit to Deadline as part of the same batch

   SMTDSettings.JobName = oldJobName               --restore the job name
   SMTDSettings.SubmitAsDependent = false               --disable dependencies
   SMTDSettings.DependencyJobItems = #{}               --and clear the dependency jobs bitarray flags
   theRenderer.lightcache_mode   = old_lightcache_mode       --restore the old cache mode
   
   if oldRenderDialogState do renderSceneDialog.open()       --reopen the render dialog if needed
)--end if
)--end local scope


Some notes:
  • I assumed Deadline 9 here. The call for opening Deadline 8's SMTD is

    Code: Select all

    macros.run "Deadline" "SubmitMaxToDeadline8"
  • Currently it assumes that the 3ds Max render output filename is being used. It uses it to build the LC name, and to save the image. If the VRay VFB is to be used, it would require some modifications.
  • All current settings of SMTD are being used (pools, groups, priority etc.). However, the multi-job submission options will be skipped - these include Stereo Camera submission, Batch Job submission, and State Sets submission. It would be possible to respect those, but I would need to modify the code a bit.
  • The automatic Sanity Check will not be performed even if it was enabled in the SMTD UI.
  • It is not handling the case where Jigsaw or other region rendering mode might have been selected. It would require some additional code to turn that off when submitting the LC job.
  • The Job Name is set from the MAX file, and the same is used for the Batch name. If the same MAX scene is submitted more than once, the jobs will gather in the same batch group.
  • Other than most SMTD scripting tutorials you might have seen, this one operates at a very high level, basically just opening the SMTD UI and calling the function that is more or less triggered by the SUBMIT button. So it is rather artist friendly and does not require deep understanding of SMTD's functions and settings.
Borislav "Bobo" Petrov
Product Specialist
Thinkbox Software Inc.

squeakybadger
Posts: 56
Joined: Tue Jul 28, 2009 9:50 am

Re: Vray lightcache prerender?

Postby squeakybadger » Tue Apr 25, 2017 5:05 am

Hi Bobo,

Thanks for having a look at it, it will make things a lot easier for our guys.

Saying that, it's not working for me :)

It seems to send the render job, not both (and no dependency)

This is the submit log:

Code: Select all

-- BEGIN - 25-4-2017 10:41:48 - WKS18/jaime - 3ds Max 2016
---- OPEN DIALOG : 25-4-2017 10:41:48 ----
[10:41:49] : >Querying Maximum Priority...
[10:41:50] : +Maximum Priority of 100 Queried in 1.218 sec.
[10:41:50] : >Collecting Pools...
[10:41:51] : +5 Pools Collected in 1.036 sec.
[10:41:51] : >Collecting Groups...
[10:41:53] : +14 Groups Collected in 1.13 sec.
[10:41:53] : +Current 3ds Max Scene: C:\Users\jaime\Desktop\temp.max
[10:41:53] : +Job Name Changed To Scene Name [temp]
[10:41:53] : >Job Submission Started...
[10:41:53] : >BatchName: [temp [VRay LC + Render]]
[10:41:53] : >Checking For Missing External Files...
[10:41:53] : +State Sets Dialog Closed.
[10:41:53] : +Closed Material Editor...
[10:41:53] : +Cleared Material Editor...
[10:41:53] : >Purifying the Render Elements Names...
[10:41:53] : >Submitting 3dsmax Render Job to Local Repository...
[10:41:53] : >Saving Scene For Submission to [C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\25_04_2017_10_41_53\temp.max]
[10:41:53] : >Initiating Regular Job Submission...
[10:41:53] : >Submitting All Frames In One Job...
[10:41:54] : >Region Mode: none | Assembler Mode: DRAFT
[10:41:54] : Command Line Arguments: [-outputfiles
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\25_04_2017_10_41_53\submitOutput.txt
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\25_04_2017_10_41_53\submitExitCode.txt
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\25_04_2017_10_41_53\max_submit_info.job
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\25_04_2017_10_41_53\max_job_info.job
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\25_04_2017_10_41_53\temp.max
]


[10:41:54] : +Restored the Material Editor Samples...
[10:41:54] : >Job Submission Started...
[10:41:54] : >BatchName: [temp [VRay LC + Render]]
[10:41:54] : >Checking For Missing External Files...
[10:41:55] : >Missing Files:
[10:41:55] :    \\p\Projects\2017\R_n_D\bfbf\temp.vrlmap
[10:41:55] : +State Sets Dialog Closed.
[10:41:55] : +Closed Material Editor...
[10:41:55] : +Cleared Material Editor...
[10:41:55] : >Purifying the Render Elements Names...
[10:41:55] : >Submitting 3dsmax Render Job to Local Repository...
[10:41:55] : >Saving Scene For Submission to [C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\25_04_2017_10_41_54\temp.max]
[10:41:55] : >Initiating Regular Job Submission...
[10:41:56] : >Submitting All Frames In One Job...



Also, is the script able to submit the render as a tile rendering job? (128 tiles for whatever image size with a padding of 200)

Am I right in guessing I can just add in the commands to save out an irradiance map as well as the light cache (we are moving to brute force, but irrmap at the moment whilst everything gets tested)

Thanks again.

User avatar
Bobo
Posts: 5851
Joined: Tue Nov 15, 2005 10:26 am
Location: Vancouver, Canada
Contact:

Re: Vray lightcache prerender?

Postby Bobo » Tue Apr 25, 2017 12:02 pm

We will have to add some debug prints (or log entries) to understand what is going on in your case.
What version of Deadline are you using?
In general, each time a job is submitted, SMTD should add its data to the SMTDSettings.PreviousJobsArray property.
It would be nice to add a

Code: Select all

print SMTDSettings.PreviousJobsArray

to the code right after to first occurrence of SMTDFunctions.SubmitJobFromUI batchName:batchName to see whether it is being populated correctly.

From the log it is not possible to tell anything, since you did not include all the SMTDSettings being dumped to it. Just attach the whole LOG file so I can go through the details.

Tiles could be done, but will require some special handling - for the LC job you would have to turn off region rendering so only one job would be submitted, then restore its state so if you are doing animation, many jobs can be submitted, one for each tile.

You can add whatever you want to the code, I don't see why not. But let's first get it working in basic terms. It worked in my tests, but it is possible that our Deadline versions are different...
Borislav "Bobo" Petrov
Product Specialist
Thinkbox Software Inc.

squeakybadger
Posts: 56
Joined: Tue Jul 28, 2009 9:50 am

Re: Vray lightcache prerender?

Postby squeakybadger » Wed Apr 26, 2017 3:50 am

Hi Bobo,

I can't find an actual full log file, but this is the output from the listener:

Code: Select all

Resolving Network Path: 1517ms
SMTD_AutoLoadSuccessful = true
Running submission script "\\piknas003\DeadlineRepository9\submission/3dsmax/Main\RegionManipulator.ms"
Loading RegionManipulator.ms: 43ms
Running submission script "\\piknas003\DeadlineRepository9\submission/3dsmax/Main\TileManipulator.ms"
Loading TileManipulator.ms: 7ms
Running submission script "\\piknas003\DeadlineRepository9\submission/3dsmax/Main\SubmitMaxToDeadline_Functions.ms"
Loading SubmitMaxToDeadline_Functions.ms: 5024ms
Running submission script "\\piknas003\DeadlineRepository9\submission/3dsmax/Main\SubmitMaxToDeadline_SanityCheck_Private.ms"
Loading SubmitMaxToDeadline_SanityCheck_Private.ms: 74ms
Running submission script "\\piknas003\DeadlineRepository9\submission/3dsmax/Main\SubmitMaxToDeadline_SanityCheck_General.ms"
Loading SubmitMaxToDeadline_SanityCheck_General.ms: 10ms
Running submission script "\\piknas003\DeadlineRepository9\submission/3dsmax/Main\SubmitMaxToDeadline_SanityCheck.ms"
Loading SubmitMaxToDeadline_SanityCheck.ms: 8ms
Running submission script "\\piknas003\DeadlineRepository9\submission/3dsmax/Main\SubmitMaxToDeadline.ms"
Loading SubmitMaxToDeadline.ms: 9ms
Running submission script "\\piknas003\DeadlineRepository9\submission/3dsmax/Main\SubmitMaxToDeadline_Defaults.ini"
Loading SubmitMaxToDeadline_Defaults.ini: 8ms
Running submission script "\\piknas003\DeadlineRepository9\submission/3dsmax/Main\SubmitMaxToDeadline_StickySettings.ini"
Loading SubmitMaxToDeadline_StickySettings.ini: 12ms
Total SMTD Launcher Time: 14647ms
-- Error occurred in i loop; filename: C:\Users\jaime\AppData\Local\Autodesk\3dsMax\2016 - 64bit\ENU\scripts\SubmitMaxToDeadline_Functions.ms; position: 185226; line: 4081
--  Frame:
--   i: 1
--   called in CreateSubmitInfoFile(); filename: C:\Users\jaime\AppData\Local\Autodesk\3dsMax\2016 - 64bit\ENU\scripts\SubmitMaxToDeadline_Functions.ms; position: 185283; line: 4083
--  Frame:
--   theSlaveListString: ""
--   theRenderOutput: undefined
--   reExtension: undefined
--   kvpIndex: undefined
--   customFrameSequence: ""
--   formattedComment: "3ds Max 2016 Scene Submission"
--   pluginToUse: "3dsmax"
--   outputDirectoryIndex: undefined
--   LimitGroups: undefined
--   formattedExtraInfo8: undefined
--   rendererID: undefined
--   outputFilenameIndex: undefined
--   paddingString: undefined
--   formattedExtraInfo3: undefined
--   theKeyword: "Blacklist"
--   RPMDataNet: undefined
--   is_fxr: undefined
--   customPlugin: unsupplied
--   theSpecialLabel: undefined
--   Delimiter: undefined
--   includeBothOutputs: false
--   SubmitInfoFile: <File:C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_58\max_submit_info.job>
--   isperpassdependency: undefined
--   framesSS: undefined
--   reFilename: undefined
--   formattedExtraInfo5: undefined
--   currentTileString: ""
--   theRenderer: undefined
--   reFilenameOnly: undefined
--   formattedExtraInfo0: undefined
--   batchName: "temp [VRay LC + Render]"
--   basePath: undefined
--   baseType: undefined
--   elementsToSkip: undefined
--   rendID: undefined
--   formattedJobName: "temp [VRay Render]"
--   previouslysubmittedJobs: undefined
--   stereoCameraToken: undefined
--   formattedExtraInfo7: undefined
--   theJobs: #(1)
--   doPassDependency: undefined
--   PADDING: undefined
--   formattedExtraInfo2: undefined
--   theBlackWhiteList: #()
--   theFilenameProps: undefined
--   tileRender: undefined
--   stereoCameraLabel: ""
--   totalRegions: undefined
--   stereoCameraNameToken: undefined
--   limitGroupsToUseArray: undefined
--   formattedExtraInfo9: undefined
--   filename: "C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_58\max_submit_info.job"
--   depJobIds: ""
--   activeRegions: undefined
--   tempFile: undefined
--   CoronaRenderer: undefined
--   formattedExtraInfo4: undefined
--   customOutputFile: unsupplied
--   passDependencyList: undefined
--   filenameOnly: undefined
--   baseName: undefined
--   coronaVersion: undefined
--   is_exr: undefined
--   frameMode: #both
--   NotificationNote: undefined
--   currentJobsArray: #()
--   frames: undefined
--   reCount: undefined
--   rend_type: undefined
--   oldJobName: "temp [VRay Render]"
--   ChunkSize: undefined
--   theFile: undefined
--   reManager: undefined
--   formattedExtraInfo6: undefined
--   overrideExtraInfo: false
--   rpmdata: undefined
--   theIndex: undefined
--   alreadyExported: undefined
--   formattedExtraInfo1: undefined
--   called in SubmitJobFromUI(); filename: C:\Users\jaime\AppData\Local\Autodesk\3dsMax\2016 - 64bit\ENU\scripts\SubmitMaxToDeadline_Functions.ms; position: 567453; line: 11836
--  Frame:
--   backupSceneFileSaved: false
--   renderMsg: "--"
--   extension: undefined
--   MultiRegionRendering: false
--   VRAY_lowThreadPriority: undefined
--   theMaxFileName: undefined
--   oldrendOutputFilename: undefined
--   val: undefined
--   theSceneXRefsCount: 0
--   oldAmarettoExportMode: undefined
--   theFilterTime: undefined
--   RPMDataNet: undefined
--   txt: "File"
--   oldSSDialogState: false
--   theFn: undefined
--   oldMaxScriptFile: ""
--   theBitmapsFileName: ""
--   TempMaxFile: "C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_58\temp.max"
--   initialArgsFile: <File:C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_58\initialArgsFile.txt>
--   result: false
--   oldSubmitMaxScript: false
--   theAnswer: undefined
--   queryExternalFiles: true
--   oldVRayVFBState: false
--   failedToRemove: undefined
--   directory: undefined
--   filenameToRender: undefined
--   batchName: "temp [VRay LC + Render]"
--   oldMatEditorOpenState: false
--   theLine: undefined
--   taskLimit: undefined
--   warnAboutMissingFiles: true
--   previouslysubmittedJobs: undefined
--   sizeInMB: undefined
--   Amaretto: undefined
--   BRAZIL_lowThreadPriority: undefined
--   initialArgsFileName: ""C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_58\initialArgsFile.txt""
--   badRegions: 0
--   oldRenderDialogState: false
--   doPassDependency: undefined
--   theTime: undefined
--   forceCamera: ""
--   ssPi: dotNetObject:Autodesk.Max.StateSets.Plugin
--   theEFLFile: undefined
--   stereoCameraLabel: ""
--   canSubmitQT: true
--   oldSceneExplorerStates: #()
--   oldMeditLockedState: true
--   initialArgs: StringStream:"-outputfiles
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_58\submitOutput.txt
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_58\submitExitCode.txt
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_58\max_submit_info.job
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_58\max_job_info.job
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_58\temp.max
"
--   externalFilesList: ""
--   activeRegions: 0
--   retCode: #success
--   path: undefined
--   filename: undefined
--   oldPriority: undefined
--   passDependencyList: undefined
--   ssP: dotNetObject:Autodesk.Max.StateSets.Plugin
--   imsqFilename: undefined
--   oldStereoPriority: 100
--   theNetworkPath: undefined
--   TilesRendering: false
--   bitmapFilenames: #()
--   BitmapsCopyData: undefined
--   numViews: undefined
--   copyresult: undefined
--   done: undefined
--   theXRefObjects: #()
--   rpmdata: undefined
--   theMessage: "The Scene Contains 1 Missing External File.

"
--   OutputFilenameByUserPattern: undefined
--   called in anonymous codeblock; filename: ; position: 3079; line: 42
--  Frame:
--   old_lightcache_mode: 0
--   lcpath: "\\piknas003\Projects\2017\R_n_D\bfbf\temp.vrlmap"
--   theRenderer: V_Ray_Adv_3_50_04:V_Ray_Adv_3_50_04
--   batchName: "temp [VRay LC + Render]"
--   oldRenderDialogState: true
--   oldJobName: "temp"
-- No ""get"" function for undefined


And the SMTD log output:

Code: Select all

-- BEGIN - 26-4-2017 09:36:49 - WKS18/jaime - 3ds Max 2016
---- OPEN DIALOG : 26-4-2017 09:36:49 ----
[09:36:50] : >Querying Maximum Priority...
[09:36:52] : +Maximum Priority of 100 Queried in 1.589 sec.
[09:36:52] : >Collecting Pools...
[09:36:53] : +5 Pools Collected in 1.418 sec.
[09:36:53] : >Collecting Groups...
[09:36:55] : +14 Groups Collected in 1.363 sec.
[09:36:55] : +Current 3ds Max Scene: C:\Users\jaime\Desktop\temp.max
[09:36:55] : +Job Name Changed To Scene Name [temp]
[09:36:55] : >Job Submission Started...
[09:36:56] : >BatchName: [temp [VRay LC + Render]]
[09:36:56] : >Checking For Missing External Files...
[09:36:56] : +State Sets Dialog Closed.
[09:36:56] : +Closed Material Editor...
[09:36:56] : +Cleared Material Editor...
[09:36:56] : >Purifying the Render Elements Names...
[09:36:56] : >Submitting 3dsmax Render Job to Local Repository...
[09:36:56] : >Saving Scene For Submission to [C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_56\temp.max]
[09:36:56] : >Initiating Regular Job Submission...
[09:36:56] : >Submitting All Frames In One Job...
[09:36:57] : >Region Mode: none | Assembler Mode: DRAFT
[09:36:58] : Command Line Arguments: [-outputfiles
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_56\submitOutput.txt
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_56\submitExitCode.txt
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_56\max_submit_info.job
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_56\max_job_info.job
C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_56\temp.max
]


[09:36:58] : +Restored the Material Editor Samples...
[09:36:58] : >Job Submission Started...
[09:36:58] : >BatchName: [temp [VRay LC + Render]]
[09:36:58] : >Checking For Missing External Files...
[09:36:58] : >Missing Files:
[09:36:58] :    \\piknas003\Projects\2017\R_n_D\bfbf\temp.vrlmap
[09:36:58] : +State Sets Dialog Closed.
[09:36:58] : +Closed Material Editor...
[09:36:58] : +Cleared Material Editor...
[09:36:58] : >Purifying the Render Elements Names...
[09:36:58] : >Submitting 3dsmax Render Job to Local Repository...
[09:36:58] : >Saving Scene For Submission to [C:\Users\jaime\AppData\Local\Thinkbox\Deadline9\temp\26_04_2017_09_36_58\temp.max]
[09:36:59] : >Initiating Regular Job Submission...
[09:36:59] : >Submitting All Frames In One Job...


Using Deadline 9.0.1.1


Thanks.

User avatar
Bobo
Posts: 5851
Joined: Tue Nov 15, 2005 10:26 am
Location: Vancouver, Canada
Contact:

Re: Vray lightcache prerender?

Postby Bobo » Wed Apr 26, 2017 11:17 am

JFYI, the full log of SMTD can be opened by pressing one of the two buttons at the very bottom of the SMTD UI (Open Log In Notepad or Open Log In Default Editor), or by going to the Tools menu of SMTD, and selecting "Explore SMTD Log Folder", then locating the most recent file.

It looks like the first job fails to submit, and the second causes an error because PreviousJobsArray is empty, and we try to read the first entry from it, but there are zero entries. So the MAXScript error in the Listener is from the second job's submission crashing. Now we need to understand why the first submission does not succeed. The full log would have had the message, but...

I have added prints of the results of the submission functions to the Listener:

Code: Select all

(--start local scope
   
--If SMTD has not been opened yet, or has been closed since the start of 3ds Max, launch its UI:
if SMTD_MainRollout == undefined or not SMTD_MainRollout.open do macros.run "Deadline" "SubmitMaxToDeadline"

local theRenderer = renderers.current               --get the current renderer
if isKindOf theRenderer VRay do                     --if it is VRay, we are good to go
(
   --Render final image is disabled, light cache is set to render in the output dir
   local oldRenderDialogState = renderSceneDialog.isopen()      --see if the render dialog was open
   renderSceneDialog.close()                        --close it before submission
   rendSaveFile = false                              --disable output file saving
   theRenderer.options_dontRenderImage = true         --disable the rendering
   local lcpath = getFileNamePath rendOutputFilename + getFileNameFile rendOutputFilename + ".vrlmap"   --build the LC path name
   theRenderer.lightcache_autoSave = true               --enable LC auto-save
   theRenderer.lightcache_autoSaveFileName = lcpath         --and set the file name to the cache path
   
   --Job sends to deadline
   SMTDSettings.PreviousJobsArray = #()                --clear the dependencies list
   SMTDSettings.SubmitAsDependent = false                --disable dependencies for first job submission

   SMTD_MainRollout.getNameFromMaxScene()            --update the job name in the UI
   local oldJobName = SMTDSettings.JobName             --store the current job name
   SMTDSettings.JobName = oldJobName+" [VRay LC]"         --set the LC job's name
   local batchName = oldJobName + " [VRay LC + Render]"      --a batch name to combine the two jobs
   local result = SMTDFunctions.SubmitJobFromUI batchName:batchName      --submit the job to Deadline as part of the batch
   format "%\n" result

   if SMTDSettings.PreviousJobsArray.count == 0 do return false
      
   --Render final image is enabled, lc is switched to "from file" and uses the precalced light cache
   rendSaveFile = true                           --re-enable output file saving
   theRenderer.options_dontRenderImage = false            --re-enable rendering
   theRenderer.lightcache_autoSave = false               --disable the auto save mode
   local old_lightcache_mode = theRenderer.lightcache_mode   --store the old mode
   theRenderer.lightcache_mode = 2                  --set LC mode to From File
   theRenderer.lightcache_loadFileName = lcpath            --set the load file to the cached path from the previous submission

   --Job sends to deadline with the first as a dependency.
   SMTDSettings.SubmitAsDependent = true               --enable dependencies
   SMTDSettings.DependencyJobItems = #{1}               --set the dependency on the first entry from the list
   SMTDSettings.DependOnPreviousJobMode = #last         --set the mode to last, so only the last job is concidered
   SMTDSettings.JobName = oldJobName+" [VRay Render]"      --set the job name
   local result = SMTDFunctions.SubmitJobFromUI batchName:batchName      --submit to Deadline as part of the same batch
   format "%\n" result
   
   SMTDSettings.JobName = oldJobName               --restore the job name
   SMTDSettings.SubmitAsDependent = false               --disable dependencies
   SMTDSettings.DependencyJobItems = #{}               --and clear the dependency jobs bitarray flags
   theRenderer.lightcache_mode   = old_lightcache_mode       --restore the old cache mode
   
   if oldRenderDialogState do renderSceneDialog.open()       --reopen the render dialog if needed
)--end if
)--end local scope


What I don't understand is why there is no submission report in the Log you sent me. Right after the command line arguments there should be the actual report from the deadline command call, but there is nothing, just the Restored the Material Editor Samples row. I have never seen anything like that... Let's see what the modified script will print, if anything.
Borislav "Bobo" Petrov
Product Specialist
Thinkbox Software Inc.


Return to “Thinkbox Software - Deadline”

Who is online

Users browsing this forum: No registered users and 1 guest