Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2024-03-19 04:41:03



Reply to topic  [ 10 posts ] 
Lua Windlight Settings 
Author Message

Joined: 2011-09-17 11:12:19
Posts: 360
Reply with quote
Question. Is there a way to change the viewers Windlight Settings from Lua without 'use local environment' getting toggled on?


2021-01-26 21:01:26
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
No, because all settings applied via Lua (or RestrainedLove @setenv) are either EE settings (from the inventory Settings folder) or Windlight settings translated into EE settings, even in Windlight rendering mode.


2021-01-27 00:07:21
Profile WWW

Joined: 2011-09-17 11:12:19
Posts: 360
Reply with quote
Ah ok. I will try some detection on changes and override.

If you get the time, exposing 'Use Local Environment' from the environment settings to the debug settings, would be nice, but it's just a nice to have. I'll figure out another solution.


2021-01-27 08:57:01
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
Catten wrote:
exposing 'Use Local Environment' from the environment settings to the debug settings
Nope ! This particular debug setting is extremely sensitive since it governs transitions and translations between WL and EE; it is for internal use only and this is why it is a hidden debug setting (that cannot directly be changed in any way by the user, but only indirectly, via settings or rendering modes selection).


2021-01-27 09:15:07
Profile WWW

Joined: 2011-09-17 11:12:19
Posts: 360
Reply with quote
Ah ok, no problem


2021-01-27 09:19:14
Profile

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
I was playing around in this area a bit last night and noticed that when region/estate time is toggled off, no OnWindlightChange event is fired. I wasn't sure if there should be though. Would it be useful to know when the environment was set back to default?


2021-01-27 12:47:08
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
ZaneZimer wrote:
I was playing around in this area a bit last night and noticed that when region/estate time is toggled off, no OnWindlightChange event is fired. I wasn't sure if there should be though. Would it be useful to know when the environment was set back to default?

Care to give reproduction steps ?... Unless it is triggered from Lua itself (in which case OnWindlightChange() is not called to prevent infinite recursions), the toggling off of region/estate time does result in an event being posted (with either "sunrise", noon", "sunset", "midnight" or "local" pseudo sky settings names passed, depending on which setting you choose from the viewer main menu, or with the appropriate Windlight settings name when the sky is changed from the Windlight floater).


2021-01-27 13:29:18
Profile WWW

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
Henri Beauchamp wrote:
Care to give reproduction steps ?... Unless it is triggered from Lua itself (in which case OnWindlightChange() is not called to prevent infinite recursions), the toggling off of region/estate time does result in an event being posted (with either "sunrise", noon", "sunset", "midnight" or "local" pseudo sky settings names passed, depending on which setting you choose from the viewer main menu, or with the appropriate Windlight settings name when the sky is changed from the Windlight floater).
I put a print() in the OnWindlightChange() callback to dump the function's parameters and noticed that when toggling the menu item Estate/region time off (no other menu items selected), no event comes in. If I choose another TOD option, yes, the event does come in with its name.

Also, I understand the above conversation about 'Use local environment' being set when using the Lua functions. Should that also be the case when using WL render and selecting a preset from the Windlight Editor dialog? I've just been confused by the difference in menu options when I chose, say, 'Coastal Afternoon' from the dialog or do ApplySkySettings('Coastal Afternoon') from within my Lua script.


2021-01-27 14:38:20
Profile

Joined: 2009-03-17 18:42:51
Posts: 5523
Reply with quote
ZaneZimer wrote:
[when toggling the menu item Estate/region time off (no other menu items selected), no event comes in. If I choose another TOD option, yes, the event does come in with its name.
I added a "local" OnWindlightChange() event (that will also trigger for @setenv_daytime, or when changing the time slider in the Windlight floater for the first time), but it will have the side effect of triggering two OnWindlightChange() events in a raw (first with "local", then with the new setting name) when currently in region/estate time and changing to any fixed setting.

Quote:
Also, I understand the above conversation about 'Use local environment' being set when using the Lua functions. Should that also be the case when using WL render and selecting a preset from the Windlight Editor dialog? I've just been confused by the difference in menu options when I chose, say, 'Coastal Afternoon' from the dialog or do ApplySkySettings('Coastal Afternoon') from within my Lua script.
The difference is that the Lua (and @setenv) functions apply to any setting (either EE settings present in inventory or, as a fallback, any valid WL setting); to achieve this result, WL settings are translated into EE local settings (while EE settings are directly applied as local settings).

The Windlight editor floater, on its side, only applies to the Windlight settings (just like the EE settings editor only applies to the EE settings); in WL rendering mode, it directly affects the environment, but in EE rendering mode, you must press its "Preview frame" button so that the WL settings are translated into local (and fixed) EE settings that are then applied to the EE renderer.


2021-01-27 17:15:11
Profile WWW

Joined: 2016-06-19 21:33:37
Posts: 337
Location: Columbus area, OH, USA
Reply with quote
Henri Beauchamp wrote:
The Windlight editor floater, on its side, only applies to the Windlight settings (just like the EE settings editor only applies to the EE settings); in WL rendering mode, it directly affects the environment, but in EE rendering mode, you must press its "Preview frame" button so that the WL settings are translated into local (and fixed) EE settings that are then applied to the EE renderer.
Thanks for the explanation. I have been storing off parcel WL configuration for later 'playback' when entering the parcel again. It worked well prior to EE but the complexities now of the various states, makes it a bit problematic but I'm trying to get by. I don't really use it often, but a fun programming exercise nonetheless. :-)


2021-01-27 18:38:37
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.