Sergey Pogosyan

cg artist + cg developer

New version of BatchCameraRender script: 1.9.6 по-русски

13 Mar 2011

tags: scripts, BatchCameraRender

Current Version: 1.9.6

Release Date: 13 March 2011
 
Finally managed to update BatchCameraRender render. I didn't mean to update it anymore since I'm working on version 2 in which will be possible to have multiple settings per camera. But I had some cool feature requests in Todo list so I've decided to continue development of this script and most likely I will upload several version of BatchCam1 until BatchCam2 comes out.

Main New Features and Improvements:

Many new keywords added. Here're some of them, the rest will be shown later, they relate to some other new features:
  • %scenepath% and %scenefolder% - returns full path of the scene.
  • %projectpath% added as an alias for the %projectfolder% -returns full path of the 3ds max project.
  • %elementname% and %elementtype% - return type and name of the Render Element, works only in the Render Element (Sub)Folder field and in Render Elements name template described later.
  • %up% - this keyword changes the preceding path by going up-folder. Example: C:\Users\Documents\3dsMax\scenes\%up%\render returns C:\Users\Documents\3dsMax\render. Very helpful for specifing paths relative to the scene root.

New elements in Options rollout (formerly System Options):

Render Try Counter - counts how many times the Render button was pressed. This info can be placed into all customizable fields of the script by inserting %trynum% keyword. It is very useful for tests rendering - if keyword is placed into the main output filename script creates new filename every time the Render button is pressed and old renderings will not overwriting. Counter reset to 1 on new file creation, on file opening and on max reset. Also you can enter any number to the counter and it counts from that value.
 
User Key and User Value parameters. These fields allow user to define custom template keywords. User Key contains the keyword and User Value contains computable expression - e.g. you can enter any maxscript expression into it and it will be computed for every camera before the rendering. For example, if you want to use username in the file or folder name you just enter word "username" to the User Key and sysInfo.username expression to the User Value field. After that %username% keyword will be replaced with actual username of the user who sends the job to the rendering. If the expression could not be computed it is replaced by "ErrUserVal" string. Make sure your expression works in maxscript listener before you use it in the User Value field.
 
Backburnder job name and Render Elements name templates. In older versions BB jobs was composed by using hardcoded template - "scene name + camera name + order number" and Render Elements by using other hardcoded template - "mainoutputfile_renderelementtype_renderelementname". Now you can specify your own templates by using all available keywords, and now you have new %mainoutput% keyword for the Render Elements Name template. This keyword returns main output file name.
 
User keywords, BB Job Name and Render Element Name templates are saved to the scene file, e.g. if you open this scene on other computer all settings remain the same. Also you can specify default values for these settings. You can do so by entering some values into the fields and pressing the Save as default button located in this section. Next few lines will be added to the INI file:
 
BatchCameraRender_UserKey1=
BatchCameraRender_UserKey2=
BatchCameraRender_UserKey3=
BatchCameraRender_UserVal1=
BatchCameraRender_UserVal2=
BatchCameraRender_UserVal3=
BatchCameraRender_bbJobName=
BatchCameraRender_elementName=
 
Values of that lines will be used for the empty fields in the new scenes. If BB Job Name and Render Element Name fields are empty and no default values are given then the hardcoded templates mentioned above will be used.

Some less global improvements:

  • Paths of Vray maps are now treated as relative if non-absolute path entered. Empty fields mean that maps will placed in main output folder.
  • The Render Setup window is now closed without a warning before the rendering starts.
  • Rendered camera becomes visible (if it is hidden) before the rendering to make 3ds max always consider correction/vertical shift parameters.
  • No paths are created if Save File checkbox is unchecked in main output section. And render elements are not rendered in this case too. This is done to prevent error pop-ups if render element paths does not exist.

Different fixes:

  • All paths are checked for the leading and trailing spaces.
  • By design script stores all the parameters before the rendering and restores them after the rendering. Also it creates temporary render preset with all sections including environment. But loading render preset with environment resets the environment map settings, so in this version render presets are restored (reloaded) only if render preset parameter is set in the script by the user. So, if render preset is specified environment map settings are still reset. It is not good solution, rather quick-fix. The possible way to prevent this kind of bug is to analyze all the cameras and to save only those section of render preset which is set by the user, or to not save environment section at all. Any feedback on this question is much appreciated.
  • The Lighting state is also restored only if specified in the script. This will make script a little faster. In future versions I'm planning to get rid of this section. By introducing scene state section Lighting State section became redundant. Ironically Lighting section was the main reason I started to write this script.
  • This version of the script is no longer compatable with older (pre-1.9.2) versions of the script. In newer versions User Properties was replaced by AppData to store script settings, and some compatability kept by checking User Property values. Now this checking is no longer happens, and that should improve script's performance.
Download and full description here.

blog comments powered by Disqus