Author Topic: Script help - CShading lightselect - adding instance to same lightselect element  (Read 976 times)

2022-02-07, 10:11:10

Kelevra

  • Active Users
  • **
  • Posts: 10
    • View Profile
Hi,

I have tried to look for info on this topic on the forum and other places, but cannot see to find what I am looking for.
My script knowledge is pretty basic - so I am bit lost atm. Hopefully someone could give me some usefull insight.

So my challenge is:

I am using the lightmixer and CShading lightselect a lot.
Whenever I make an instance of a light I need to add that to the correct CShading Lightselect element.

I'd really want a script that checks what CShading lightselect element rest of the instances is added to.
So whenever I create an instance of a light - it ends up in the correct lightselect element (with the other instances) without me having to do anything.

This is basically how I like it to happen - i think;

I select a light - and hit the script button/hotkey.
1. It checks what lightselect element the light is in.
2. It creates and instance of that light and selects it
3. It adds that light to the lightselect element from #1.


I am struggling on checking what render elements a light or object is a part of.
Guess you will open the array of the elements and see if it exist in one of them?

No idea on how to do that.


Thanks for any help given!

2022-02-07, 18:16:56
Reply #1

Frood

  • Active Users
  • **
  • Posts: 1922
    • View Profile
    • Rakete GmbH
Hmm, what about something more generic? If you exactly stick to instances for every LightSelect element, then try the attached experimental (and badly/quickly written) startup script. It would

- go through all LightSelect render elements
- get all instances from the lights already there
- add those instances to the LightSelect element

automatically every time you either open render setup or start to render. Of course you could do something similar as you mentioned (hotkey/button).
There is no wrong and right when in comes to light sources in LightSelect elements, there are just very different requirements. So I cannot imagine a perfect, generic solution as well. But the script may give you a direction to continue, it works a bit as if there would be a ticked "Include instances" checkbox in the interface of the LightSelect render elements.


Good Luck


Never underestimate the power of a well placed level one spell.

2022-02-09, 13:41:18
Reply #2

Kelevra

  • Active Users
  • **
  • Posts: 10
    • View Profile
Hmm, what about something more generic? If you exactly stick to instances for every LightSelect element, then try the attached experimental (and badly/quickly written) startup script. It would

- go through all LightSelect render elements
- get all instances from the lights already there
- add those instances to the LightSelect element

automatically every time you either open render setup or start to render. Of course you could do something similar as you mentioned (hotkey/button).
There is no wrong and right when in comes to light sources in LightSelect elements, there are just very different requirements. So I cannot imagine a perfect, generic solution as well. But the script may give you a direction to continue, it works a bit as if there would be a ticked "Include instances" checkbox in the interface of the LightSelect render elements.


Good Luck

Thank you so much mr Frood!

I will give this a go and report back to you.