Chaos Corona Forum
Chaos Corona for 3ds Max => [Max] I need help! => Topic started by: TYCHE on 2020-10-15, 15:24:11
-
Is that possible?
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?
Thanks!
-
Possible, yes. But what keeps you from adding/removing lights by UI?
Good Luck
-
Because we develop an inhouse toolbar where we want to easiliy add and remove Lights. Opening the render elements dialog isn't qick enough for me.
-
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.
Good Luck
-
Thanks so much!
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.
Thank you for your help!