Interface: RenderElementMgr

 

RenderElementMgr interfaces:

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, 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 <filename>pathname

Sets the filename of the .cws file.

<filename>GetCombustionOutputPath()

Gets the filename of the .cws file.

<void>SetRenderElementFilename <integer>index <filename>filename

Set the output file name for the indexed render element to the specified filename string.

<filename>GetRenderElementFilename <integer>index

Get the output file name of the indexed render element.

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

 

theManager = maxOps.GetRenderElementMgr #Production

theManager.numrenderelements()

rendoutputfilename = "c:\\test.tga"

-- adds all renderelements to be rendered.

for n in elementlist do

(

re.addrenderelement (n elementname:("foo_" + (n as string)))

format "\nAdded % renderelement" n

)

rendsavefile = true

setsilentmode true -- used to avoid error message when checking the filename of element

renderSceneDialog.open() -- open Render Dialog

-- get all render elements set and return name of render element and output filename

for n = 0 to (theManager.numrenderelements()- 1) do

(

el = re.getrenderelement n

format "\nGetting % render element" el.elementname

format "\nRender element outputfilename: %" (re.GetRenderElementFileName n)

)

See also

MaxOps Interface