Sergey Pogosyan

cg artist + cg developer

onSubmit script for BatchCameraRender по-русски

20 Jul 2011

tags: BatchCameraRender

If you ever wandered of the purpose of Scripts section in BatchCameraRender script, here is the first use case.

With the help of script shown below you can easily find the max files from which was rendered pictures in render folders.

Put this code to some script file, submit_info.ms for example, and point the Per Each Camera field to that file:


submitInfoFileName = \
pathConfig.appendPath (getFilenamePath (rendOutputFilename)) "submitInfo.txt"

submitInfoFile = ""
   
if (doesFileExist submitInfoFileName) then
    submitInfoFile = openFile submitInfoFileName mode:"a+"
else
    submitInfoFile = createfile submitInfoFileName   

dateClass = (dotnetclass "System.DateTime").Now
date_string = dateClass.ToString("yyyy-MM-dd HH:mm:ss")
submitInfo = date_string
format "====Submitted On: %====\n"  submitInfo to:submitInfoFile
   
submitInfo = filenameFromPath (rendOutputFilename)
format "Rendered Images: %\n"  submitInfo to:submitInfoFile

submitInfo = pathConfig.appendPath maxFilePath maxFileName
format "Submit scene: %\n"  submitInfo to:submitInfoFile

submitInfo = sysInfo.username
format "Username: %\n"  submitInfo to:submitInfoFile

submitInfo = sysInfo.computername
format "Computer: %\n"  submitInfo to:submitInfoFile
   
format "\n"  to:submitInfoFile

close submitInfoFile

Here's how script rollout looks like when submit script is set from the network path. Here at work I'm using this script all the time, so I've add this setting to INI file as a default for submit section and now all my scenes store submit information to render folders.

After each submit little text file gets created in the render folder with following information:


===============Submitted On: 2011-06-02 16:09:28===============
Rendered Images: livingroom .exr
Submit scene: \\bombey\work\...\...\sirevo main 17 42.max
Username: poserge
Computer: BOMBEY

To be more precise file created on first submit, all additional submit data is added to the end of file, so this text file contains some sort of history of render submits for the current folder.

All this information can be easily customized, this is why I'm showing you script here and not in scripts section.

Enjoy!

blog comments powered by Disqus