Interface: RenderElementMgr
<boolean>AddRenderElement <maxObject>element
Adds a specific element. Returns True if Successful, False otherwise
<boolean>RemoveRenderElement <maxObject>element
Removes a specific element. Returns true is successful and false otherwise.
<void>RemoveAllRenderElements()
Removes all elements in the list.
<integer>NumRenderElements()
Returns number of elements in list
<maxObject>GetRenderElement <integer>index
Returns a specific element, index is 0 based.
<void>SetElementsActive <boolean>active
Sets a boolean indicating elements are active, ie. will be created during a render.
<boolean>GetElementsActive()
Gets a boolean indicating elements are active, ie. will be created during a render.
<void>SetDisplayElements <boolean>display
Sets boolean indicating elements will be displayed after they are created.
<boolean>GetDisplayElements()
Gets boolean indicating elements will be displayed after they are created.
<void>SetCombustionOutputEnabled <boolean>enabled
Enables or disables output to combustion .cws file.
<boolean>GetCombustionOutputEnabled()
Gets boolean indicating enabled output to combustion .cws file.
<void>SetCombustionOutputPath <string>pathname
Sets the filename of the .cws file.
<string>GetCombustionOutputPath()
Gets the filename of the .cws file.
Example:
-- set a list of render elements.
elementlist = #(specular,diffuse,self_illumination,reflection,refraction,shadowrenderelement,atmosphere,blend,z_depth,alpha,backgroundrenderelement)
re = maxOps.GetCurRenderElementMgr() -- get the current render element manager
re.removeallrenderelements() -- remove all renderelements
re.numrenderelements() -- get number of render elements
prod = maxOps.GetRenderElementMgr #Production
draft = maxOps.GetRenderElementMgr #Draft
prod.numrenderelements()
draft.numrenderelements()
-- adds all renderelements to be rendered.
for n in elementlist do
(
re.addrenderelement (n elementname:("foo_" + (n as string)))
format "\nAdded % renderelement" n
)
rendoutputfilename = "c:\\test.tga"
rendsavefile = true
setsilentmode true -- used to avoid error message when checking the filename of element
-- get all render elements set and return name of render element and output filename
for n = 0 to (prod.numrenderelements()- 1) do
(
el = re.getrenderelement n
format "\nGetting % render element" el.elementname
format "\nRender element outputfilename: %" el.bitmap.filename
--el.filename
)
See also