I know the workaround to delete the Element entirely and genereate a new one with all included lights, but this is messing up the sorting of lightselect elements in the coronabuffer. so is there a way to merge them onto an existing one?
The question is: how you would identify the appropriate light select render element. Anyhow, something like this is basically what you would need:
mgr=maxOps.GetCurRenderElementMgr()
for i=0 to (mgr.NumRenderElements()-1) do (
rElement=mgr.getRenderElement(i)
format("Element %:\tName:'%'\tClass: %\n") i rElement.elementName (classof(rElement))
if (classof(rElement)==CShading_LightSelect) do (format "\tLight sources:%\n" rElement.includedNodes)
)
“includedNodes” is the ArrayParameter where you would add/remove items.
Yeah you’re right, but in out team the Sun LightselectElement always has the same string so this works fine. Not the ideal solution if someone else would work with this, but thats not necessary here.