Chaos Corona Forum
Chaos Corona for 3ds Max => [Max] General Discussion => Topic started by: FlorianW. on 2018-06-20, 10:15:25
-
with the updated maxscript access on corona 2.0, will it be possible to write a script to generate a lightselect element from selected lights with one button? Setup Lightmix is good but not for inbetween tasks.
Cheers
-
This has been possible for a while:
foo = getCurrentSelection()
re = maxOps.GetCurRenderElementMgr()
re.addrenderelement (Cshading_LightSelect elementName:"myLightSelect" includedNodes:foo addEnvironment:false useDenoise:true)
-
nice!!! thanks so much. i didn't know about the "addrenderelement" command. Do you know if i can also access the "merge" button in the render elements tab.
Cheers
-
thanks again, tool is already up an running :)
(https://thumb.ibb.co/gMve0J/A.jpg) (https://ibb.co/gMve0J)
-
Excellent. You can also add in some sort of loop check to make sure that only valid objects are being included in the selection. Something like:
if classof blah == coronaLight do
(I'm not in front of a copy of Max right now)
-
Would it be possible to integrate a "Lightmix Checker" into the script, which looks for the lightmix node in the renderelements tab and if it doesn't exist, creates one?
So easily explained, can i look if a lightmix node exists via maxscript?
Thanks in Advance!!!
-
This would be easy to do. I'm not in front of a Corona license at the moment to actually write the code, but all you would have to do is collect all of the existing render elements in an array, check for the class of the specific light mix element, and if no match exists, simply create one.