Advanced Scene Switcher

Advanced Scene Switcher 1.36.1

There is no crash log available and I cannot get into the setting on the plug in as it crashes as soon as I try to load OBS with the plug in activated. I can only open OBS in safe mode if Advanced Scene Switcher is active.

I really don't want to have to do a complete clean install of OBS and the plug in as I have quite a bit set up in my scenes that would require a few hours to put it all back together again.
 
There is no crash log available and I cannot get into the setting on the plug in as it crashes as soon as I try to load OBS with the plug in activated. I can only open OBS in safe mode if Advanced Scene Switcher is active.

I really don't want to have to do a complete clean install of OBS and the plug in as I have quite a bit set up in my scenes that would require a few hours to put it all back together again.
Can you share your scene collection json file?

You can usually find it here:
C:\Users\<your username here>\AppData\Roaming\obs-studio\basic\scenes

Maybe the plugins settings are somehow corrupted and are causing the issue.

If you are familiar with json files / syntax you can try to remove the "advanced-scene-switcher" block from the file.
(But always keep a backup of the original file just in case).
 
This is the only scene JSON available besides the back up. I am not a fan of modifying files unless I am 100% sure what I am doing.

I added the .txt to the end of the file to allow it to be uploaded.
 

Attachments

This is the only scene JSON available besides the back up. I am not a fan of modifying files unless I am 100% sure what I am doing.

I added the .txt to the end of the file to allow it to be uploaded.
Thanks for sharing your settings!
I think I have spotted the problematic macro:

1788453958639.png


The "Show Image" macro will cause an endless loop:

If the source "Subscribe" in your case - or "Color" in my adapted macro - becomes active - which happens on OBS startup - it will execute a random macro from a list of macros.
That list of random macros only contains a single macro - the "Show Image" macro itself.
Thus it executes the "Show Image" macro.
This in turn then again picks a random macro to execute, of which there is only a single possible selection, ... and so on.

Usually you should be greeted by this popup in case such a freeze was detected:

1788454168845.png


If you choose to not start the plugin, you should be able to open the settings dialog and disable the problematic macro.

In case that is not an option for you, I have attached the "cleaned up" version of your scene collection file, in which the "Show Image" macro was removed.

Hope that helps!
 

Attachments

Last edited:
Thank you. That fixed it. The subscribe macro was created through AI (and I guess I learned not to trust it). What I was trying to do was create a scene that would flash a "Subscribe" image onto the screen for about 20 seconds on a random time period of at least 5 minutes between each occurance and it must stay on screen if the scene shifts while it is on screen. If all that makes sense. I was told to create a scene with the image and then build the macro and I was doing that when the whole thing came down on me.

So I am not sure if it is (a) possible and (b) if using the plug in is the correct way to go about it.
 
Thank you. That fixed it. The subscribe macro was created through AI (and I guess I learned not to trust it). What I was trying to do was create a scene that would flash a "Subscribe" image onto the screen for about 20 seconds on a random time period of at least 5 minutes between each occurance and it must stay on screen if the scene shifts while it is on screen. If all that makes sense. I was told to create a scene with the image and then build the macro and I was doing that when the whole thing came down on me.

So I am not sure if it is (a) possible and (b) if using the plug in is the correct way to go about it.
That is good to hear!

I would suggest to set it up like this:
1788459776353.png


The tricky part will be the "it must stay on screen if the scene shifts while it is on screen".
I think what you are looking for here is this plugin:

If you choose to go the "downstream-keyer" route you probably have to use the "Hotkey" action instead of "Scene item visibility" to show / hide the source.
The "Hotkey" action type will allow you to interact with the hotkey functions offered by other plugins.
(The hotkeys themselves don't need to be bound to any key)
 
I hope, it hasn't been answered the last 250 pages before, so I have accidentally overseen it.

As we're working with a Skaarhoj Panel, which is firing up the "Makros" via websocket, I'm trying to do this:

- first press uf button "Makro1" brings a scene to program with a different transition
- now the e.g. SloMo plays it contents
- next press on the button "Makro1" switches to another camera (unfortunately there is no preview to select)

I tried with variables, but then the transitions toggles directly for and back ;)

set a variable "skript1v" to 0 -> if variable is 0 then switch to scene, set variable to 1 -> and here is the next IF missing.

Any hint, how to solve this "thing"?

Thanks in advance
 
I hope, it hasn't been answered the last 250 pages before, so I have accidentally overseen it.

As we're working with a Skaarhoj Panel, which is firing up the "Makros" via websocket, I'm trying to do this:

- first press uf button "Makro1" brings a scene to program with a different transition
- now the e.g. SloMo plays it contents
- next press on the button "Makro1" switches to another camera (unfortunately there is no preview to select)

I tried with variables, but then the transitions toggles directly for and back ;)

set a variable "skript1v" to 0 -> if variable is 0 then switch to scene, set variable to 1 -> and here is the next IF missing.

Any hint, how to solve this "thing"?

Thanks in advance
Hopefully I understood the problem correctly:
You want the same trigger to cause different effects based on what "state" you are currently in.
In the initial state it should trigger a scene switch to, let's say 'Scene A'.
In the next state it should instead switch to 'Scene B'.
And so on.

There are multiple ways to achieve this.
You could use variables or you could simply "un-/pause" macros as needed.

Your macro setup could look something like this:

1788719795534.png

1788720000785.png

... and so on ...

You might also want to create a macro which sets the initial state when the plugin is started, which might look something like this:

1788719941053.png


I hope that helps!
 
Hopefully I understood the problem correctly:
You want the same trigger to cause different effects based on what "state" you are currently in.
In the initial state it should trigger a scene switch to, let's say 'Scene A'.
In the next state it should instead switch to 'Scene B'.
And so on.

There are multiple ways to achieve this.
You could use variables or you could simply "un-/pause" macros as needed.

Your macro setup could look something like this:

View attachment 121136
View attachment 121139
... and so on ...

You might also want to create a macro which sets the initial state when the plugin is started, which might look something like this:

View attachment 121138

I hope that helps!
Thanks :) I'll give it a try :) Reply will take some days, as I´m out on production till Friday
 
Found an interesting issue today while trying to use the Run action with a python script. Using `os.getenv` to retrieve environment variables does not work, but works just fine running from my terminal. Is there some different context that the Run action uses that strips away user environment variables?
 
Found an interesting issue today while trying to use the Run action with a python script. Using `os.getenv` to retrieve environment variables does not work, but works just fine running from my terminal. Is there some different context that the Run action uses that strips away user environment variables?
Which OS are you experiencing this issue on?
Is the whole environment cleared or just a few variables?

I just gave it a quick try on Windows with this macro / script combination and it produced the expected output:

1788901330906.png


Python:
import os


with open("C:/Users/Admin/Downloads/tmp/out.txt", "w") as f:
    for key in sorted(os.environ):
        env_str = f"{key}={os.environ[key]}\n"
        f.write(env_str)

Just a guess:
Could it be that the terminal process and OBS process already have a different set of environment variables and thus the spawned child processes' environment differs as well?
(For example, the terminal might parse some terminal specific file(s), like .bashrc, but an application launched from a GUI / desktop launcher might not)
 
@Warmuptill: Thank you very much for your suggestions, I appreciate!

I made it at the end a little bit different, to be more flexibel, and to be more Broadcast-Like ;) For the buttons on the Skaarhoj-panel I made it in my bridge, that I can toggle them, or one-time pressed. So, I can make it now in the settings, e.g. Makro 1, as a "normal" Makro, that will be fired, if I press the button. Or I can make it toggle, if I Have in the .js "Makro 1 An", "Makro 1 Aus" (On, Off). So for all 36 Makros on the panel, I can choose, better pre-program, pre-layout, if it will be toggling or not. So I am total flexibel, if I have, e.g. sports, or concerts.

Just ine thing I have to figure out, or look, if it's missing, that I can say, at the end of an action "and now bring back the transition to cut". I´m struggling with this at the moment in the macros. Some days till next production to play around :) ;)
 
@Warmuptill: Thank you very much for your suggestions, I appreciate!

I made it at the end a little bit different, to be more flexibel, and to be more Broadcast-Like ;) For the buttons on the Skaarhoj-panel I made it in my bridge, that I can toggle them, or one-time pressed. So, I can make it now in the settings, e.g. Makro 1, as a "normal" Makro, that will be fired, if I press the button. Or I can make it toggle, if I Have in the .js "Makro 1 An", "Makro 1 Aus" (On, Off). So for all 36 Makros on the panel, I can choose, better pre-program, pre-layout, if it will be toggling or not. So I am total flexibel, if I have, e.g. sports, or concerts.

Just ine thing I have to figure out, or look, if it's missing, that I can say, at the end of an action "and now bring back the transition to cut". I´m struggling with this at the moment in the macros. Some days till next production to play around :) ;)
Glad to hear that you got it to work! :)

You can change the active transition type using the "Transition" action:
1789241797212.png


Just to mention it, on the General tab you can also configure the "Switch scene" action to rely on transition overrides instead of changing the global transition type:

1789241855751.png
 
OBS has announced that version 33 will have a completely revamped directory structure. There's some sort of scary comments in their release notes specifically about a new location for plugins. I'm patiently waiting for the general availability release of OBS 33. I expect to have to reinstall Advanced Scene Switcher. Will that install be compliant with the new OBS rules? Is this version 1.36.1 already compliant? Your release date of August 7 seems more or less coincident with the first notifications I started getting about an impending OBS 33. But it's not crystal clear. I'm perfectly happy to install a new Advanced Scene Switcher when OBS 33 lands. But I want to know I'm getting the version of Advanced Scene Switcher that understands the new regime. Any guidance would be greatly appreciated. Thank you.
 
OBS has announced that version 33 will have a completely revamped directory structure. There's some sort of scary comments in their release notes specifically about a new location for plugins.

[NB: DISCLAIMER: I use OBS Studio exclusively under Windows, so my knowledge on and experience with the matter is based on this. I cannot (yet) help with either Linux or macOS installations.]

Actually, this is not new. It's been around for a while. I've been using this layout for a while now. What is new is that it's now being used as the default rather than an alternative. It's been in the planning stages for a little more than four years. From other documentation, OBS 33 will actually solidify %PROGRAMDATA%\obs-studio\plugins as the new default location with the OBS Studio install tree being relegated to "legacy" status. OBS 34 will move the old in-tree "intermingled" installation into the OBS tree as "deprecated" and "unsupported".

Expressing it in Windows environment variables, it's %PROGRAMDATA%\obs-studio\plugins. On most systems, that will translate to C:\Windows\ProgramData\obs-studio\plugins.

There are several big downsides for using the "current default" which is within the OBS Studio installation tree, e.g. C:\Program Files\obs-studio\obs-plugins and C:\Program FIles\obs-studio\data\obs-plugins:
  1. Plugins you install get intermingled with the default ones bundled with OBS Studio by default. If you "unzipped" ones into the OBS Studio tree, you have to pull out files in multiple locations.
  2. While I'm talking about C:\Program Files\obs-studio, it requires administrative access to even write in this area, along with the rest of C:\Program Files in general. Likewise, if you need to remove plugins that you've unzipped, you will need that kind oof access to do so.
  3. If you feel the need to uninstall OBS Studio then reinstall to handle situations where OBS Studio would do better with a fresh reinstall, doing so will remove everything, including all your installed plugins in the install tree. EVERYTHING. You don't get to pick and choose.
Taking the above list, now, I describe the advantages:
  1. Each plugin will get their own tree within %PROGRAMDATA%\obs-studio\plugins. Very easy to maintain since one directory entry therein is just one plugin and any pertinent support files. Very easy to track, especially when building up a new streaming setup based on an older setup like I have done recently.
  2. This method does not require any elevated or even what I like to call "altered" access to maintain what's in there. Simply put, you don't need to worry about the dreaded UAC prompt.
  3. By far, the biggest seller for me here. Once I moved to this methodology, I can pop out and even track my plugin updates, the method of maintaining OBS Studio itself is much cleaner. Plugins are in their own space and OBS Studio itself can even take being completely uninstalled then installed afresh as an update method.
For those who like "portable" installs, OBS 33 addresses this as well. The directory structure has a "plugins" directory anchored at the base of the portable install and is identical to as other plugin developers and I like to call the "programdata" location, plugins/(plugin name).

Anyway, I'm planning a video geared particularly to the VTuber community about the forthcoming changes to OBS Studio based on my own experiences, so I will publish something when I'm ready.

--Katt. =^.^=
 
Thanks @KattPhloxworthy. It sounds like the best approach for me (Windows 11 & portable OBS) is going to be a total obliteration of my current C:\OBS-studio tree except for the root, which I will leave behind as an empty shell, & just reinstall everything there. So I'll have to redefine my sources. So what? That doesn't take very long. I don't have many. And there's a few settings tweaks I'll have to reinstate, again, not many. On the other hand, there is a profile export. I don't have a tremendous lot of sources but if I could preserve them, it would save a bit of tedium. Ditto for my settings. I don't have a lot of other things like scenes. The open question is will OBS 33 import something exported from OBS 32? And the Advanced Scene Switcher is my only plugin. I have notes for recreating the one macro I have defined. So the pain will probably be minimal for me. That leaves open my original question: Is the latest version of Advanced Scene Switcher going to install by conforming to the new directory structure or will it take a newer release than 1.36.1 to get an installer that is compatible with OBS 33? My question is triggered by the release not too long ago of OBS 33 RC 1, which means they're getting close.
 
OBS has announced that version 33 will have a completely revamped directory structure. There's some sort of scary comments in their release notes specifically about a new location for plugins. I'm patiently waiting for the general availability release of OBS 33. I expect to have to reinstall Advanced Scene Switcher. Will that install be compliant with the new OBS rules? Is this version 1.36.1 already compliant? Your release date of August 7 seems more or less coincident with the first notifications I started getting about an impending OBS 33. But it's not crystal clear. I'm perfectly happy to install a new Advanced Scene Switcher when OBS 33 lands. But I want to know I'm getting the version of Advanced Scene Switcher that understands the new regime. Any guidance would be greatly appreciated. Thank you.
The "old" plugin layout is still supported until OBS 34.
Complete overhaul to plugin loading [FiniteSingularity/PatTheMav] (#13594)
[...]
  • Existing third-party plugins will continue to load from the legacy locations until OBS Studio 34.0
So for OBS 33 you won't have to do anything just yet.
 
Thanks for your answer @Warmuptill. I'm not one to procrastinate. If it's on the horizon, I'd rather deal with it now . . . well, when OBS 33 lands . . . than later. What is your plan for packaging the plugin to conform to the new directory structure? If I continue to use the old directory structure with OBS 33, it just means that at some point, I'm going to have to rip out Advanced Scene Switcher & reinstall it according to the new protocol. It has to happen eventually. I'd rather take care of it at the same time I install OBS 33.
 
Thanks for your answer @Warmuptill. I'm not one to procrastinate. If it's on the horizon, I'd rather deal with it now . . . well, when OBS 33 lands . . . than later. What is your plan for packaging the plugin to conform to the new directory structure? If I continue to use the old directory structure with OBS 33, it just means that at some point, I'm going to have to rip out Advanced Scene Switcher & reinstall it according to the new protocol. It has to happen eventually. I'd rather take care of it at the same time I install OBS 33.
I didn't look into the changes yet in detail, but the plugin installer for Windows already defaults to the ProgramData path / layout.
It will only fall back to the old path, if it can find an existing installation under the old legacy path.
This fallback was implemented to avoid having multiple instances of the plugin being loaded at the same time.

So, in theory all you need to do is:
  1. Backup your plugin settings just in case
  2. Uninstall the plugin
  3. Reinstall the plugin
And it should then be in C:\ProgramData\obs-studio\plugins\advanced-scene-switcher.

If you don't want to use an installer and want to install it by hand you can already use the advanced-scene-switcher-1.36.1-windows-x64.zip archive to do so.
It already adheres to the ProgramData specific layout.

If you run into any issues please do let me know!
 
Since I am using portable OBS, I assume I would need to use portable Advanced Scene Switcher. I'm looking at the documentation for OBS 33 on the subject of the plugin directory structure. I have also downloaded Advanced Scene Switcher 1.36.1 portable for Windows. The OBS 33 doc says there's going to be 2 directories. In my case, they will be named:

C:\OBS-studio\plugins\Advanced Scene Switcher
C:\OBS-studio\plugins\Advanced Scene Switcher\data

I am trying to fit the directories in the portable plugin zip archive for 1.36.1 into the OBS explanation. In your zip archive at the highest level of the tree, you have 2 directories: obs-plugins, data. I am assuming that I will drill down in your zip archive to directory obs-plugins\64bit, a tree structure that will be flattened out of existence in OBS33. From within that directory, I will copy the 2 dll files & the 2 pdb files into my C:\OBS-studio\plugins\Advanced Scene Switcher directory. I will copy the subdirectory named advanced-scene-switcher-plugins from your zip archive into that same directory.

For the data, I will drill down in you zip archive through another directory structure that will also be flattened out of existence, this time it's data\obs-plugins\advanced-scene-switcher. There's 3 subdirectories at that level of your zip archive: licenses, locale, res. I am assuming I will copy those 3 directories into C:\OBS-studio\plugins\Advanced Scene Switcher\data.

This is my attempt to reconcile the old directory structure that appears in your zip archive with the OBS documentation at https://obsproject.com/kb/legacy-plugin-locations in the section with the heading Windows (Portable). Do I have this right? Will I be able to use the advanced-scene-switcher-1.36.1-windows-x64-portable.zip with OBS 33 when it lands? Or will you have to recode anything & issue a new zip file with an updated directory structure? Just to be clear. I'm using portable OBS so I assume I need to use the portable zip file of Advanced Scene Switcher. Is this correct?
 
Last edited:
Back
Top