1
[Max] I need help! / Re: Select the light mix list item by light
« on: Today at 09:27:58 »
You can reference this post about the lightmix, which has valuable information on scripting the lightmix:
https://forum.corona-renderer.com/index.php?topic=32697.0
From that post I put this together for you, you can also use more loops to do other stuff but the basics are here. Its a bit quick so you can clean it up for your use but you should get the point:
Also if you want to select all the lights in say Light_Select 2, remove the last line (select coronaLights[1][1]) and use this instead:
Or just have it do multiple for loops, like for i in coronaLights for j in i etc..
https://forum.corona-renderer.com/index.php?topic=32697.0
From that post I put this together for you, you can also use more loops to do other stuff but the basics are here. Its a bit quick so you can clean it up for your use but you should get the point:
Code: [Select]
coronaLights = #()
for i in getclassinstances CShading_LightSelect do
(
-- Adds array, eg Light_Select 2 might have 3 lights, etc.
append coronaLights i.includedNodes
)
-- select the light in the first Light_Select - 1 light in this array
select coronaLights[1][1]
Also if you want to select all the lights in say Light_Select 2, remove the last line (select coronaLights[1][1]) and use this instead:
Code: [Select]
--select the lights in the second Light_Select - 2 or more lights in this array
lightSel = for j in coronaLights[2] collect j
select lightSel
Or just have it do multiple for loops, like for i in coronaLights for j in i etc..