Page 1 of 2

Is it possible to change a Twilight Light's color via DC?

Posted: Tue Jul 05, 2016 1:21 pm
by derei
I made a Dynamic Component Ligth that uses Twilight Light elements (IES) and I would like to be able to change its light color either from SketchUp, or even better from the DC's menu. Would it be possible? At this moment, the only way of changing a light's color I see from Edit Light window.
I tried to change the color of "TwiLight2" material that appeared in my materials list, but that one seems to have no effect on my light's color.

Thank you very much.

Re: Is it possible to change a Twilight Light's color via DC

Posted: Tue Jul 05, 2016 3:26 pm
by Fletch
Can't one build the dynamic component with different color lights on different layers and enable only the layer with the color you wish too see?

Re: Is it possible to change a Twilight Light's color via DC

Posted: Tue Jul 05, 2016 8:38 pm
by Chris
Multiple lights with different "hard-coded" colors, and just turning them on or off with layers or DC visibility, would be the easiest way but wouldn't be very flexible.

I have not worked with Dynamic Components at all, so I don't know what's possible off hand. Let me take look at DCs and see if they support the necessary property editing that changing the TWR light color would require.

Re: Is it possible to change a Twilight Light's color via DC

Posted: Wed Jul 06, 2016 12:56 pm
by derei
The simplest way would be to link the material that TL applies to the Light Geometric Representation with the actual Light's Color (that cone for spotlight, or the graphical IES, the two intersected disks for Point Light).
In this way, if the material's color is changed in SketchUp, it will reflect in Twilight Light element. And changing material colors using DC is already doable.
Would it be difficult to do this? Of course, that means every light that needs its color changed individually will require its own material. Has to be figured out how to decide which lights are "cloned" and which are individual ones. Maybe using component instances?

Re: Is it possible to change a Twilight Light's color via DC

Posted: Wed Jul 06, 2016 2:32 pm
by Chris
derei wrote:The simplest way would be to link the material that TL applies to the Light Geometric Representation with the actual Light's Color
This isn't how color for Twilight Render lights work (and never has been). There are reasons that go all the way back to the first version of TWR V1. There are ways to do it (that work around a couple of weird issues with components and materials), but we've never done it that way (the more complicated way) because there wasn't a need for it. But I like the idea of being able to change color using dynamic components so I'm interested in looking into making that change. I can't make any guarantees but I'll look at it.

Re: Is it possible to change a Twilight Light's color via DC

Posted: Wed Jul 06, 2016 5:17 pm
by derei
So, you say there is no way to "collect" a color from a SU material and use it directly as TL Light color? Basically it would need just to read material's color and apply it progrmmatically, rather than requiring user interaction. Reading a material's color is easy using ruby. From there, to collect it and pass it forward to twilight, hopefully is not much difficult either... or is it?

Re: Is it possible to change a Twilight Light's color via DC

Posted: Wed Jul 06, 2016 6:43 pm
by Chris
derei wrote:So, you say there is no way to "collect" a color from a SU material and use it directly as TL Light color? Basically it would need just to read material's color and apply it progrmmatically, rather than requiring user interaction. Reading a material's color is easy using ruby. From there, to collect it and pass it forward to twilight, hopefully is not much difficult either... or is it?
No, I never said anything like that. It's entirely possible. It's just not the best idea. Basically you are making it so every property of the lights is edited in the light editor, but you have to go to a different editor (The SU material editor) to change the color. For 99% of users, that makes no sense. Yes, it would work great for dynamic components, but that is really the only place it would have value.

Now in case you are thinking, "edit the color in both places", that quickly becomes a problem. What happens when a user changes the material on one of the lights, but on other instances of the same light, they don't. Which one gets edited in the light editor?

I like the idea of using the material for the light color. It's just not practical.

Re: Is it possible to change a Twilight Light's color via DC

Posted: Thu Jul 07, 2016 9:58 am
by derei
Well, here comes the idea of "instances". All instances of the same light should act like component instances. Change one, they change all. You want a light that is similar in properties, but different color, then you will have to make it unique, or to create another light, separate from the instances set.
And if the issue is that editing the material will override the lights editor settings, and the editor settings will override the material, I see no problem here too. It will just have two places where to edit things. Each user can choose.
Of course, you select ONE light and change its color in editor, if that light has more instances, there should be a warning "want to change color for all its instances"? and if NO, then automatically that individual light is made UNIQUE. This way the changes will affect only one light.

The main reason why I raised this, is because I created a IES LED stripe, resizable using DC. But there are many colors of LED stripes, different color temperatures and I would need to make as many components as colors are availabe. But if I could control all the IES instances in one move just by changing a HEX (or RGB) value, then I would have a real scalable DC LED Stripe.
But this would also apply to stage lights, or other lights where it makes sense to quickly change color without much hassle.

Re: Is it possible to change a Twilight Light's color via DC

Posted: Thu Jul 07, 2016 2:18 pm
by Chris
derei wrote: The main reason why I raised this, is because I created a IES LED stripe, resizable using DC. But there are many colors of LED stripes, different color temperatures and I would need to make as many components as colors are availabe. But if I could control all the IES instances in one move just by changing a HEX (or RGB) value, then I would have a real scalable DC LED Stripe.
Sure, that makes sense. Being able to change the color with dynamic components would be great. Though, if all the lights in the strip are instances of the same light, you could just open it in the light editor and change the color. :?

Re: Is it possible to change a Twilight Light's color via DC

Posted: Thu Jul 07, 2016 8:56 pm
by derei
If I only need a purely random color, that is just fine. But what if my colors have to be accurate, like the LED color temperatures, there are (white) LEDs from 2700K to 7000K. Unless I keep a note or I memorize each color, it will be difficult for me to adjust the color correctly with the exact model that I am using.
The whole point of the DC-controllable color was to have a single light appliance with more "presets" saved in it. This would replace having to create 10-20 different components (each for every color). Instead would be one with a list of colors to pick from.
This would also work for other lights to present them as Incandescent vs LED, or whatever...externalizing the control of the light color, so it can be accessed by SketchUp maybe could be used even in animation (disco lights, baby)