Author |
Message |
Catten
Joined: 2011-09-17 11:12:19 Posts: 361
|
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 |
|
|
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 5546
|
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 |
|
|
Catten
Joined: 2011-09-17 11:12:19 Posts: 361
|
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 |
|
|
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 5546
|
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 |
|
|
Catten
Joined: 2011-09-17 11:12:19 Posts: 361
|
Ah ok, no problem
|
2021-01-27 09:19:14 |
|
|
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 342 Location: Columbus area, OH, USA
|
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 |
|
|
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 5546
|
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 |
|
|
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 342 Location: Columbus area, OH, USA
|
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 |
|
|
Henri Beauchamp
Joined: 2009-03-17 18:42:51 Posts: 5546
|
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. 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 |
|
|
ZaneZimer
Joined: 2016-06-19 21:33:37 Posts: 342 Location: Columbus area, OH, USA
|
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 |
|
|