Force light to load IES data via Ruby

For all the users of Twilight Render (V1 & V2), to ask questions and get started
Post Reply
alexishungry
Posts: 4
Joined: Tue Aug 31, 2021 5:17 pm
OS: Windows 10
SketchUp: SketchUp Pro 2020

Force light to load IES data via Ruby

Post by alexishungry » Tue Aug 29, 2023 8:14 pm

Hi guys,

I'm trying to swap out the IES file that a Twilight light points to via Ruby scripting. I'm able to change the ies_Path in the AttributeDictionary, which is reflected in the "Edit Light" GUI, but it doesn't appear that the light actually loads that new data. Is there any way I can force the light to load the IES data?

Thanks for reading!

Chris
Posts: 5346
Joined: Sun Mar 08, 2009 3:00 am
OS: Win10
SketchUp: 2016

Re: Force light to load IES data via Ruby

Post by Chris » Wed Aug 30, 2023 1:43 pm

You are correct in that. Twilight Render actually stores the light data directly into the scene (kind of like how SketchUp stores images that it uses as textures). So changing the path isn't going to update the data.

Can you describe a bit of your workflow? Maybe we can expose a command via Twilight Render that would "reload" the data into the scene?

alexishungry
Posts: 4
Joined: Tue Aug 31, 2021 5:17 pm
OS: Windows 10
SketchUp: SketchUp Pro 2020

Re: Force light to load IES data via Ruby

Post by alexishungry » Wed Aug 30, 2023 4:32 pm

Thanks for the quick response, Chris.

In short, got a script with a dialog that allows for selecting a light fixture model and selecting a "lamp" for it, each lamp corresponding to different lumens, color, and IES data. The lumens and color have been straightforward enough to update in the AttributeDictionary. It's just getting the IES data to update that's been out of reach.

If you can, exposing a command to reload the IES data would be fantastic!

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 41 guests