Cool VL Viewer forum

View unanswered posts | View active topics It is currently 2017-12-16 14:44:17



Reply to topic  [ 4 posts ] 
Lua scripting: ApplySkySettings() 
Author Message

Joined: 2010-04-07 08:23:18
Posts: 165
Reply with quote
Hello Henri,

are there any specifics to consider when using ApplySkySettings() beyond what you posted? Somehow it doesn't seem to do anything for me beyond causing a slight jump in cloud rendering.

This is my script:
Code:
function OnLogin(location)                                                                                         
        SideBarButton(1, "\u{1f5be}", "AutomationMessage('photo_off')", "Disable photo settings")                 
        SideBarButton(2, "\u{1f5bc}", "AutomationMessage('photo_on')", "Enable photo settings")                   
        SideBarButton(3, "\u{2699}", "OpenFloater('preferences')", "Opens the Preferences floater")               
        SideBarButton(4, "\u{1f505}", "AutomationMessage('dark_room')", "Dark room setting")                       
        SideBarHideOnRightClick()                                                                                 
        SideBarHide(false)                                                                                         
end                                                                                                               


function OnSideBarVisibilityChange(visible)                                                                       
        if visible then                                                                                           
                StatusBarLuaIcon("")                                                                               
        else                                                                                                       
                StatusBarLuaIcon("SideBarHide(false)", "Shows the Lua buttons side bar")                           
        end                                                                                                       
end                                                                                                               


function SetPhotoModeOn()                                                                                         
        print("Photo mode on");                                                                                   
        SetDebugSetting("TextureLoadFullRes", true)                                                               
        SetDebugSetting("RenderVolumeLODFactor", 6.0)                                                             
        SetDebugSetting("RenderAvatarLODFactor", 3.0)                                                             
        SetDebugSetting("RenderRiggedMeshShadow", 3)                                                               
        SetDebugSetting("RenderDepthOfField", true)                                                               
end                                                                                                               


function SetPhotoModeOff()                                                                                         
        print("Photo mode off");                                                                                   
        SetDebugSetting("TextureLoadFullRes", false)                                                               
        SetDebugSetting("RenderVolumeLODFactor", 3.0)                                                             
        SetDebugSetting("RenderAvatarLODFactor", 1.0)                                                             
        SetDebugSetting("RenderRiggedMeshShadow", 0)                                                               
        SetDebugSetting("RenderDepthOfField", false)                                                               
end                                                                                                               


function SetDarkRoom()                                                                                             
        print("Dark room on");                                                                                     
        ApplySkySettings("A-12AM");                                                                               
end                                                                                                               
                                                                                                                   
                                                                                                                   
function OnAutomationMessage(text)                                                                                 
        if text == "photo_on" then                                                                                 
                SetPhotoModeOn()                                                                                   
        elseif text == "photo_off" then                                                                           
                SetPhotoModeOff()                                                                                 
        elseif text == "dark_room" then                                                                           
                SetDarkRoom()                                                                                     
        end                                                                                                       
end                                                                                                               

No matter what preset I am using, the effect does remain the same. I'm stumped.

Oh, and is there a way to trigger the equivalent of "Revert to region default"? Because loading "Default" would obviously not do that.

Love,
Lia


2017-03-11 15:09:31
Profile

Joined: 2009-03-17 18:42:51
Posts: 3655
Reply with quote
Apparently, the A-12AM setting only works when you first override the region settings.

Try CTRL SHIFT Y (set to mid-day) then "/lua ApplySkySettings("A-12AM")" -> working.
Now try "World" -> "Environment settings" -> "Revert to region default" and "/lua ApplySkySettings("A-12AM")" -> not working.

Windlight always was an ugly mess...

Quote:
Oh, and is there a way to trigger the equivalent of "Revert to region default"? Because loading "Default" would obviously not do that.

I'll add a new Lua function for it in next release (I already implemented an OnWindlightChange() event too)...


2017-03-11 17:12:47
Profile WWW

Joined: 2010-04-07 08:23:18
Posts: 165
Reply with quote
Hello again Henri,

thank you for looking into it. I was beginning to doubt my sanity. :lol: You wrote:
Henri Beauchamp wrote:
Apparently, the A-12AM setting only works when you first override the region settings.
Well, it's not just that setting, but all of the presets, standard or custom, it seems. As soon as you move away from the region default, they will load, at region default they won't, just as you stated.

Henri Beauchamp wrote:
I'll add a new Lua function for it in next release (I already implemented an OnWindlightChange() event too)...
Thank you. I'm no expert, but wouldn't it be cleaner and more intuitive to trigger that with an empty string? I actually wondered if it might have been implemented that way in the first place.

Love,
Lia


2017-03-12 07:51:25
Profile

Joined: 2009-03-17 18:42:51
Posts: 3655
Reply with quote
Amalia Illios wrote:
Well, it's not just that setting, but all of the presets, standard or custom, it seems. As soon as you move away from the region default, they will load, at region default they won't, just as you stated.
Well, since I'm always overriding the region time, I did not notice this weird "feature" when I performed the tests...

Amalia Illios wrote:
Henri Beauchamp wrote:
I'll add a new Lua function for it in next release (I already implemented an OnWindlightChange() event too)...
Thank you. I'm no expert, but wouldn't it be cleaner and more intuitive to trigger that with an empty string? I actually wondered if it might have been implemented that way in the first place.
No, because the new function will allow to both deactivate and reactivate region time...


2017-03-12 09:13:23
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 2 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:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.