Re: MaxScript usage with Octane 3dsMax - Render output - setting main filename and render element filenames
Posted: Thu Apr 24, 2025 3:14 am
Render output - setting main filename and render element filenames
The main output filename (editable in Render settings / Common tab) can be read by
mainOutFilename = rendOutputFilename -- current output filename, as set in the 'Common' tab of render settings [eg "C:\temp\outTst3\mySceneCC.png"]
it can be set by assigning the same 3dsMax global variable rendOutputFilename :
rendOutputFilename = "C:\\temp\\outTst3\\mySceneDD.png"
or
rendOutputFilename = "C:/temp/outTst3/mySceneDD.png"
(Note that the Render settings dialog should be closed when setting this variable. ref: https://help.autodesk.com/view/3DSMAX/2 ... 6ECCDD6D20)
(rendTimeType, rendOutputFilename and rendSaveFile are 3ds Max variables)
Render Elements
For the render elements, by default, each render element filename is set automatically by 3dsmax to be in the same folder as the main render output filename, with a prefix using the element name.
For example, when adding a Diffuse render element when the current name output is "C:\temp\outTst3\mySceneCC.png", the element filename is set to "C:\temp\outTst3\mySceneCC_Diffuse.png"
Octane has some options to set those render element filenames differently, in the 'Passes Output' rollout of the Kernel tab.
See the 'Overwrite default Render Element folder' and 'Overwrite root path' check boxes, and the related options.
Those options are accessible with maxscript the same way as the other render settings variables (reminder : use showproperties renderers.current for full list)
.renderOutput_enable_MultiLayerEXR : boolean
.renderOutput_enable_stdRgbOut : boolean
.renderOutput_singleEXR_AsOctane : boolean
.renderOutput_exrCompression : integer
.renderOutput_exrDWACompressionLevel : float
.renderOutput_exrUseTonemap : boolean
.renderOutput_exrUseFloat16 : boolean
.renderOutput_exrFileType : integer
.renderOutput_ColorSpace : string
.renderOutput_OCIOLook : string
.renderOutput_ForceToneMap : boolean
.outputFolders_enableOverwrite : boolean
.outputFolders_overwriteBasePath : boolean
.outputFolders_basePath : string
.outputFolders_useCommonSubFolder : boolean
.outputFolders_CommonSubFolder : string
.outputFolders_usePassSubFolder : boolean
.outputFolders_removeBaseName : boolean
.outputFolders_removePassName : boolean
.renderOutput_OctDigitCount : integer
for example:
rd = renderers.current
rd.outputFolders_enableOverwrite = true
rd.outputFolders_usePassSubFolder = true
will save each render element in its own folder (eg "C:\temp\outTst3\Diffuse\mySceneCC_Diffuse.png")
If those options are not enough for a particular purpose, those element filenames can be set / accessed as follow:
re = maxOps.GetCurRenderElementMgr()
elemCount = re.numrenderelements() -- get number of render elements
--- manually set all render element filenames:
mainOutFilename = rendOutputFilename -- current output filename, as set in the 'Common' tab of render settings
mainOutShortname = filenameFromPath mainOutFilename --eg "mySceneCC.png" cf 'File Name Parsing' : https://help.autodesk.com/view/MAXDEV/2 ... 00E0B9D604
mainOutBasename = getFilenameFile mainOutFilename --eg "mySceneCC"
mainOutPath = getFilenamePath mainOutFilename -- eg "C:\temp\outTst3\"
for n = 0 to (elemCount - 1) do
(
el = re.getrenderelement n -- access one of the render element
elemName = el.elementname -- eg "Diffuse"
relem_filename = mainOutPath + mainOutBasename + "_ELEM_" + elemName + ".png" -- re-create a full path and filename. eg "C:\temp\outTst3\mySceneCC_ELEM_Diffuse.png"
re.SetRenderElementFilename n relem_filename -- change the render element filename
}
The main output filename (editable in Render settings / Common tab) can be read by
mainOutFilename = rendOutputFilename -- current output filename, as set in the 'Common' tab of render settings [eg "C:\temp\outTst3\mySceneCC.png"]
it can be set by assigning the same 3dsMax global variable rendOutputFilename :
rendOutputFilename = "C:\\temp\\outTst3\\mySceneDD.png"
or
rendOutputFilename = "C:/temp/outTst3/mySceneDD.png"
(Note that the Render settings dialog should be closed when setting this variable. ref: https://help.autodesk.com/view/3DSMAX/2 ... 6ECCDD6D20)
(rendTimeType, rendOutputFilename and rendSaveFile are 3ds Max variables)
Render Elements
For the render elements, by default, each render element filename is set automatically by 3dsmax to be in the same folder as the main render output filename, with a prefix using the element name.
For example, when adding a Diffuse render element when the current name output is "C:\temp\outTst3\mySceneCC.png", the element filename is set to "C:\temp\outTst3\mySceneCC_Diffuse.png"
Octane has some options to set those render element filenames differently, in the 'Passes Output' rollout of the Kernel tab.
See the 'Overwrite default Render Element folder' and 'Overwrite root path' check boxes, and the related options.
Those options are accessible with maxscript the same way as the other render settings variables (reminder : use showproperties renderers.current for full list)
.renderOutput_enable_MultiLayerEXR : boolean
.renderOutput_enable_stdRgbOut : boolean
.renderOutput_singleEXR_AsOctane : boolean
.renderOutput_exrCompression : integer
.renderOutput_exrDWACompressionLevel : float
.renderOutput_exrUseTonemap : boolean
.renderOutput_exrUseFloat16 : boolean
.renderOutput_exrFileType : integer
.renderOutput_ColorSpace : string
.renderOutput_OCIOLook : string
.renderOutput_ForceToneMap : boolean
.outputFolders_enableOverwrite : boolean
.outputFolders_overwriteBasePath : boolean
.outputFolders_basePath : string
.outputFolders_useCommonSubFolder : boolean
.outputFolders_CommonSubFolder : string
.outputFolders_usePassSubFolder : boolean
.outputFolders_removeBaseName : boolean
.outputFolders_removePassName : boolean
.renderOutput_OctDigitCount : integer
for example:
rd = renderers.current
rd.outputFolders_enableOverwrite = true
rd.outputFolders_usePassSubFolder = true
will save each render element in its own folder (eg "C:\temp\outTst3\Diffuse\mySceneCC_Diffuse.png")
If those options are not enough for a particular purpose, those element filenames can be set / accessed as follow:
re = maxOps.GetCurRenderElementMgr()
elemCount = re.numrenderelements() -- get number of render elements
--- manually set all render element filenames:
mainOutFilename = rendOutputFilename -- current output filename, as set in the 'Common' tab of render settings
mainOutShortname = filenameFromPath mainOutFilename --eg "mySceneCC.png" cf 'File Name Parsing' : https://help.autodesk.com/view/MAXDEV/2 ... 00E0B9D604
mainOutBasename = getFilenameFile mainOutFilename --eg "mySceneCC"
mainOutPath = getFilenamePath mainOutFilename -- eg "C:\temp\outTst3\"
for n = 0 to (elemCount - 1) do
(
el = re.getrenderelement n -- access one of the render element
elemName = el.elementname -- eg "Diffuse"
relem_filename = mainOutPath + mainOutBasename + "_ELEM_" + elemName + ".png" -- re-create a full path and filename. eg "C:\temp\outTst3\mySceneCC_ELEM_Diffuse.png"
re.SetRenderElementFilename n relem_filename -- change the render element filename
}