Activate Render Elements


I have modified a bit of script from the maxscript online help files and it does everything i need it to do except actually tick the "elements active" box.

i have tried putting SetElementsActive = true in various places but cant get it to work.

please help! thanks


elementlist = #(alphaRenderElement, materialIDRenderElement, objectIDRenderElement)

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

-- adds all renderelements to be rendered.
for n in elementlist do
re.addrenderelement (n elementname:("_" + (n as string)) ShadowOn:true)
format "\nAdded % renderelement" n