Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

ECto-Monkey

New Member
Unfortunately without more context it will be really difficult to say what the issue might be / to analyse potential problems.

What type of macros are you using when the problem happens?
Do you have a log file of the issue?
Does OBS crash at some point and if so do you have a crash report?

I do yes, here is the most recent from moments ago: https://obsproject.com/logs/XsyydIaGSUgjj0U4

I figured a link is ok? Or would you/anyone prefer the full body of text?

I do not use any macros, just the Sequence tab for 4 different scenes.
 

Warmuptill

Active Member
I do yes, here is the most recent from moments ago: https://obsproject.com/logs/XsyydIaGSUgjj0U4

I figured a link is ok? Or would you/anyone prefer the full body of text?

I do not use any macros, just the Sequence tab for 4 different scenes.
In this case I would be very surprised if the advanced scene switcher is related to the OBS freeze.

I can't spot any obvious issues in the attached log either.
Maybe someone more knowledgable about the general OBS logs will be able to spot something in the log file.
 

Rozenman

Member
Dear Warmuptill,
It seems I did something wrong, but all my fancy plugin settings fell apart when switching from 1.27.2 to 1.28.0. The plugin behaves completely unpredictably and almost none of the macros work properly. I had to roll back to the old one for now, but I suspect that I missed some general setting. I would appreciate comments on the correct transition to 1.28.0
Thanks!
Alex
 

Warmuptill

Active Member
Dear Warmuptill,
It seems I did something wrong, but all my fancy plugin settings fell apart when switching from 1.27.2 to 1.28.0. The plugin behaves completely unpredictably and almost none of the macros work properly. I had to roll back to the old one for now, but I suspect that I missed some general setting. I would appreciate comments on the correct transition to 1.28.0
Thanks!
Alex
First of all - I apologize about those problems you are facing!
You shouldn't have to adjust anything for the transition to 1.28.0 in theory, but maybe I missed something.

Can you provide more details about what you have set up and is not working on 1.28.0?

You can export the individual problematic macros on the Macro tab or export all settings on the General tab.
If applicable an OBS log with verbose logging enabled might also point out what the issue is.
A minimal setup to reproduce the problem would be very helpful as well.
 

Rozenman

Member
Settings in the attachment. Examples of failures: the "Старт трансляции" macro runs immediately after the program starts and at any time, but should only run at 19:00 (the beginning of the lecture); the "Youtube (settings)" macro runs regardless of whether there is something in the clipboard or not, but should only run if there is something in the clipboard. Didn't dig deeper.
 

Attachments

  • adv-ss-ProfileSchool-Rozenmann.txt
    434.9 KB · Views: 4

Warmuptill

Active Member
Settings in the attachment. Examples of failures: the "Старт трансляции" macro runs immediately after the program starts and at any time, but should only run at 19:00 (the beginning of the lecture); the "Youtube (settings)" macro runs regardless of whether there is something in the clipboard or not, but should only run if there is something in the clipboard. Didn't dig deeper.
Thanks for sharing the settings!
I think I was able to track down the problem with the date condition in "Старт трансляции".
This issue was indeed introduced with 1.28.0, so thanks a lot for pointing that out.

A build with the fix will be available here in a few minutes:
I would highly appreciate if you could give this build a try and report back if your issue with "Старт трансляции" was resolved.
(If it is I will release a new version with the fix right away)
Unfortunately, you will have to be logged into GitHub to be able to download it.
If that should not be an option for you, let me know and I will try to share it with you via other means.

I was not able to reproduce the clipboard issue, however.
If you can provide more details or possibly an OBS log file with verbose logging please let me know.
Maybe it was just a side effect of "Старт трансляции" firing incorrectly? (I couldn't check all your macros)

Thanks again for reporting the problem!
 

Rozenman

Member
Dear Warmuptill,
Thanks for the update! Everything works fine.
I would also like to ask you, if you have a chance, to look at the Clipboard. The problem is that all the proposed condition options work exactly the same, i.e. any filling of the clipboard leads to the macro being triggered. This is not a big problem, not critical, but I would like the Clipboard to confidently distinguish a text buffer (in particular, a URL) from any other content. And it would be really great if there was an option to fill the source settings in scenes with a text buffer.
Thanks!
 

Warmuptill

Active Member
I would like the Clipboard to confidently distinguish a text buffer (in particular, a URL) from any other content.
The "Clipboard" condition type has the option to check if the clipboard content contains an URL:
1730636238915.png

But as written in the note it can be if you are copying some files they might be interpreted as URLs also.
If that is an issue for you, you can also directly "look at" the clipboard content and try to match its content using a regular expression:
1730636419710.png

(This is a regular expression that came up on Google when searching for "regex url")

And it would be really great if there was an option to fill the source settings in scenes with a text buffer.
I am not sure I fully understand what you mean by this.
If you want to change what is being displayed by a text source you can use an action like this to change the text:
1730636557340.png


I am using a LUA script for zoom/follow, but would like to tweak the settings from AdvSS.

Is there a way to access/change variables that are from a script being ran within OBS?
I don't think so unless you modify the script itself to be able to interact with the advanced scene switcher plugin.
You could refer to variables defined within the advanced scene switcher to control the script.

More details about the scripting interface can be found here:

If you have more questions or need more support in setting this up, do not hesitate to ask!
 

Rozenman

Member
And yet I would like to ask: is there any way to automatically dump the text contents of the clipboard into the browser settings?

Let me explain: my students sometimes send a YouTube link as homework. I copy it to the clipboard and dump it into the OBS-browser settings. Manually (only the settings themselves pop up automatically). But I would like it so that after cmd+C the contents of the clipboard would end up in the right place and all that remains is to press Enter. And playback starts.

Thank you!
 
While I understand what you said about scripting, I and not “getting” how I could either change a LUA script to interface with AdvSS, or use AdvSS to access whatever variables might exist for a LUA script.

Here is more info on my dilema:

The LUA script, for some reason, even if I edit it first in a text editor to set certain values — such as “zoom_to” from the default of “2” to a value of “1.5” — always gets loaded and shows the default value of “2”.

Once the script is loaded, I can change the value to “1.5”, and that value seems to be stored elsewhere, but the script does work as I want.

However, if I make a new version of the script, giving it a different name to indicate the “zoom_to” value of “2.5”… upon load, the value is set at “2”, and I have to change it to “2.5”. before I see the zoom work as desired.

So, to better get the behaviour I want, I am thinking I need to be able to change the value on the fly with AdvSS, so I can use just one instance of the LUA script.
 
Further info:

I am trying to set up the zoom function to give me this kind of behaviour:

If (zoom_to is at 1 and ZOOM-IN hotkey is pressed) then Set zoom_to to 1.5

If (zoom_to is at 1.5 and ZOOM-IN hotkey is pressed) then Set zoom_to to 2.0

If (zoom_to is at 2.0 and ZOOM-IN hotkey is pressed) then Set zoom_to to 2.5


With the use of one hotkey, I could “zoom in” is steps.

I could also use a 2nd hotkey to zoom back out.

The dilema is the zoom scripts I have found to not offer such functionality, so I want to try to add it myself.

btw… your Macro functionality is awesome — so much power there… and I appreciate your work!!!
 

Warmuptill

Active Member
And yet I would like to ask: is there any way to automatically dump the text contents of the clipboard into the browser settings?

Let me explain: my students sometimes send a YouTube link as homework. I copy it to the clipboard and dump it into the OBS-browser settings. Manually (only the settings themselves pop up automatically). But I would like it so that after cmd+C the contents of the clipboard would end up in the right place and all that remains is to press Enter. And playback starts.

Thank you!
I think this example might do something similar to what you are looking to set up:

You can of course expand the setup to only change the browser source settings if other conditions are met so you don't accidentally change the browser source when you don't intend it to be changed.

While I understand what you said about scripting, I and not “getting” how I could either change a LUA script to interface with AdvSS, or use AdvSS to access whatever variables might exist for a LUA script.

Here is more info on my dilema:

The LUA script, for some reason, even if I edit it first in a text editor to set certain values — such as “zoom_to” from the default of “2” to a value of “1.5” — always gets loaded and shows the default value of “2”.

Once the script is loaded, I can change the value to “1.5”, and that value seems to be stored elsewhere, but the script does work as I want.

However, if I make a new version of the script, giving it a different name to indicate the “zoom_to” value of “2.5”… upon load, the value is set at “2”, and I have to change it to “2.5”. before I see the zoom work as desired.

So, to better get the behaviour I want, I am thinking I need to be able to change the value on the fly with AdvSS, so I can use just one instance of the LUA script.
Can you share the script?
Then I can give modifying it a try.
 
The script is called “obs-zoom-to-mouse.lua”,
available here on obsproject.com.

 
Last edited:

Warmuptill

Active Member
The script is called “obs-zoom-to-mouse.lua”,
available here on obsproject.com.

You can find the modified script attached.
I have applied the following changes:
Diff:
diff --git a/obs-zoom-to-mouse.lua b/obs-zoom-to-mouse-advss.lua
index 4864bd2..03e72fa 100755
--- a/obs-zoom-to-mouse.lua
+++ b/obs-zoom-to-mouse-advss.lua
@@ -822,7 +822,12 @@ function on_toggle_zoom(pressed)
                 log("Zooming in")
                 -- To zoom in, we get a new target based on where the mouse was when zoom was clicked
                 zoom_state = ZoomState.ZoomingIn
-                zoom_info.zoom_to = zoom_value
+                local advss_zoom = advss_get_variable_value("custom zoom value")
+                if advss_zoom ~= nil and tonumber(advss_zoom) > 0 then
+                    zoom_info.zoom_to = tonumber(advss_zoom)
+                else
+                    zoom_info.zoom_to = zoom_value
+                end
                 zoom_time = 0
                 locked_center = nil
                 locked_last_pos = nil
@@ -1385,3 +1390,30 @@ function populate_zoom_sources(list)
         obs.source_list_release(sources)
     end
 end
+
+-------------------------------------------------------------------------------
+-- ADVSS Variables
+-------------------------------------------------------------------------------
+
+-- The advss_get_variable_value() function can be used to query the value of a
+-- variable with a given name.
+-- nil is returned in case the variable does not exist.
+function advss_get_variable_value(name)
+    local proc_handler = obs.obs_get_proc_handler()
+    local data = obs.calldata_create()
+
+    obs.calldata_set_string(data, "name", name)
+    obs.proc_handler_call(proc_handler, "advss_get_variable_value", data)
+
+    local success = obs.calldata_bool(data, "success")
+    if success == false then
+        obs.script_log(obs.LOG_INFO, string.format("failed to get value for variable \"%s\"", name))
+        obs.calldata_destroy(data)
+        return nil
+    end
+
+    local value = obs.calldata_string(data, "value")
+
+    obs.calldata_destroy(data)
+    return value
+end

This results in the script attempting to use the variable named custom zoom value from the advanced scene switcher, if it is available.

You can then use macros like this to increase or decrease the zoom level by 0.5:
1730744372530.png

1730744405616.png


You can import the example macros using this code:
Code:
AAAStHic7VhbT+tGEP4r1j61pzF1QiCXNy45aiTgpITDQytUbeyxvcLZtXbXKRzEf+/M+k449KWqqiqRiJzZue0334xHvLAtD7UybP77C5N8C2zOflNqywYs0arI2dzqAqofl9xyNn9hocoynhuI2DzmmcFjI76h5ej1ddB4WcpQAzfg2RS8bz2XlVHOCwNrvoNzSPlOKM3mQSXt6GieZZA1AiUvUi4TqBMzjyJfPEH4Ra4t17bNyKr8LLRCSbOMb5S9VLL1SnFTpe2F0GEh7GLHs4KTblfjokAf2wslI0FHFymEj0tpQaN2oxd+qPTCyDN0HoKj0ezNZ8Dsc05HrxhWCutQ2IE2Lp8hSiMVPq7BWiETQ740JMJgjCaLlJvbQp4X1pJJCQzKVgTlnhRxsoW54psOqqlI0gz/7DJu7mLudNFCpmv/d/CEKTKMx6pi9eQuJqOb7J99LWV4GvaClBlVSm18j2tkD54f9Sw+U0IfmbiMyYZwWyJJGY92xviO6T4J/QBGYXy6AX8yOw388XgY+ZtoPPL5ZBpPw5BPJuOYvamCMy8p1QRc55mwWImVMqLkD7ZRTu00CgJqBvc8nM1eHyoHC8ytdPJ92+HppLENyLIu+C/KPsKz6XdQKUTrhwb1rsiqJMlg9Vbc4uniGki2IG2XZftd3jRFnzxhV8aun73MPSJkgsBPy6gDlqlEhI7dUaFdu12rSMSCiPzCrNjCH5iVsZoLWXaBAUrTvN9Iwd81DnUOmPC9WeRlsMMUBwwzOxcyqjCh7l1pMO7SxDwCn4f/Ckw7rgXfZNQdIOkhqnu2PrkpB2vpp7xGCUarMrqphy+eiMhz8mwDnoEM3D0YjUZ9X4LIgsEJCmSxvd+D96QLb8MWNj8e1Cgsoyc294f4u9isrUZAqhHceun6aLXcy+J9JWQ6PK049QXGYkefWCW75jZMXcT3DWOs4i0pkkIJYPclYkVnaKu8qmhtiHlhMJomnlUeSVzYPOMh9M8qofensGmdGk6DWCQfxS3r2Au75TZdPOVENgcr+8Ebej95I++Td+z96P3sjVmHSSuttnn7chMyL2wtY2foIpElFyjHmgzz0sPSKVPWqcqizltD7B0w3wd6eXkWr+v7joo7oZWkct/3afh1vbhd3X75vLxaEKdCkLBuSEb9XJZmUO8DRHQL2xzd9I5FzSLXBW+HrvO7RLuljKBb/GG3+JHQdeDA8RtZdgUywRp9xyLnUYRKuEtgNuMpMhzHw12dUycFHADQjGxTzgkHXA2Hk3X2nks47D2Hvec/uvdEwMcRnMT+LKC9Jz7m/oZPZn48nQZ8iF8RPz7sPf+bvWdvFh32nsPec9h7DnvPP7b3PLQ92Psf0nvNanDlOavSHdGMinmR2bolR6wdOr8WUEAVtMmJDY9G06Mhe/0LB8lt1g==

Let me know if you run into any issues. :)
 

Attachments

  • obs-zoom-to-mouse-advss.zip
    12.9 KB · Views: 0
Top