Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

ExpertOBS

New Member
I think the state "Played to End" might work better here.

I think what is happening in the "error" case is that multiple media sources are in the state "ended" at the same time.
Then once the plugin switches to a specified scene the playback for the media source is started again - meaning the condition is which lead to this scene change is no longer true and the next one in the list is checked.
This will trigger another scene switch.
This in turn might lead to the playback that was started by the previous scene switch to end once again.
And this finally results in a loop of seemingly random scene switches.

Let me know if this works!
Think it did solve the issue. Thanks so much!
 

itsyourapp

New Member
Can you share the settings which are causing you trouble? (Export on the General tab)
Maybe I can spot the issue you are facing.


Thanks for the suggestion!
I will look into it.
Great thanks! What happens on a fresh launch with the attached export is that it correctly randomly cycles through the three scenes in the random list. Then I manually cue the Empty scene (which is programmed to trigger the sequence after 3 seconds). After 3 seconds the first scene in the sequence is triggered, great. It plays and as soon as it is finished, it continues to the second (and final) scene of the sequence (which I want to play indefinitely), at which point the scenes from the random list rapidly cycle through about one every second, jumping around quickly and creating a very visually overwhelming disturbance. Then the plugin is in a broken state. If I stop the plugin, manually cue up a scene from the random list, and start the plugin again, it still randomly cycles one scene per second. I have to restart OBS for the random sequences to work again.
 

Attachments

  • conflict.txt
    3.6 KB · Views: 17

Warmuptill

Active Member
Great thanks! What happens on a fresh launch with the attached export is that it correctly randomly cycles through the three scenes in the random list. Then I manually cue the Empty scene (which is programmed to trigger the sequence after 3 seconds). After 3 seconds the first scene in the sequence is triggered, great. It plays and as soon as it is finished, it continues to the second (and final) scene of the sequence (which I want to play indefinitely), at which point the scenes from the random list rapidly cycle through about one every second, jumping around quickly and creating a very visually overwhelming disturbance. Then the plugin is in a broken state. If I stop the plugin, manually cue up a scene from the random list, and start the plugin again, it still randomly cycles one scene per second. I have to restart OBS for the random sequences to work again.
That was indeed a bug in the random tab's behaviour - thanks for pointing it out.

You can find a build which includes a fix here in a few minutes:
(You will have to be logged into GitHub to be able to download it - let me know if that should be an issue)

Let me know if everything works as expected with the fixed build!
 

Warmuptill

Active Member
Hello @Warmuptill, thank you very much for this great plugin, now with the macro tab, your solution helped me to get rid of 2 other OBS companion software for automating.

I truly believe that 90% of the functions of your plugin could be transferred to the macro tab and work so much better. Since this is just the beginning, I'm using Noobs Commander (OBS Commands) to create bat files with some actions that are still not supported at the moment, but I'm sure eventually it will be added to it :)

I have just one question/suggestion for you, if you don't mind: opening the current logs window, I could see a couple of macros running over and over because of its trigger matches the current scene. For example: mute an audio output when this scene is currently showing. Since I've set it to run every 1000ms, it keeps muting the output audio at every 1 second. I know that it works since the audio is muted over and over but I have a couple of macros that executes a bat file that I just need it to do it once for every trigger. I also understand that audio level triggers should execute every x milliseconds, makes sense, but maybe an "execute once" or automatic identification of actions that only needs to run once would be brilliant. Also, the logs files at the end of my streams are almost 2mb TXT files haha

Do you think that this could be sorted somehow?

Again, thank you very much for your great work!

I now implemented the previously mentioned features.
  • Reduced logging in non-verbose mode
  • Add option to pause individual macros
  • Add macro action to pause macros
  • Add the interval macro condition
Example screenshot:
OneshotInterval.PNG


You can find a build containing these features here in a few minutes:
(You need to be logged into GitHub to be able to download it)

Feedback would be appreciated! :)
 

ASchneider

Member
I now implemented the previously mentioned features.
  • Reduced logging in non-verbose mode
  • Add option to pause individual macros
  • Add macro action to pause macros
  • Add the interval macro condition
Example screenshot:
View attachment 71422

You can find a build containing these features here in a few minutes:
(You need to be logged into GitHub to be able to download it)

Feedback would be appreciated! :)
Hello again sir!

Wow, just wow haha

I'll take it for a quick test drive and let you know, for sure.

Since I use LioranBoard, these are the ideas I had as suggestions for your plugin:

1. Text sources: use it on both trigger and action, so we could read (globally) a text source so if it matches some text, do something. On the action side, would be nice to change text sources.
2. Multiple trigger organization: I'm not really sure how AND and OR work here. How does the next OR, having an AND works? Like a parentheses on a mathematical equation, you could group those AND and OR for a better understanding and result.
3. Audio source trigger: being able to set audio status like muted/unmuted (globally) as trigger
4. Source/Scene filter trigger: same as the above (globally) but with filters visibility.
5. Wait/delay: does those actions stop when the trigger no longe matches the current scene?
6. Pause, stop, next/previous tracks: being able to do these actions on media sources, like VNC speacilly.
7. Variables: now that's a bit too much, maybe haha but being able to create and update local variables to use on other trigger or action settings would be nice. Again, I use LioranBoard and it is a much complex and suitable software for those kinds of things.

I really think your plugin is one of the most powerful ones available now, specially when you added the idea of MACROS, this is just awesome! Again, I think that more than 90% of the other tabs can be done only in the macro one and, going forward, it could be something of a LioranBoard killer for most people.

On last thought: maybe this plugin should be called OBS MACROS hahaha

Thank you very much for your work here, just amazing. Have a great day!
 
Last edited:

ASchneider

Member
Sorry, one last suggestion: Delete/change order of any actions/trigger: I think it is only possible to remove the last trigger/action, it would be nice to be able to dele anything in between, also changing its orders.
 

ASchneider

Member
Hello @Warmuptill, sorry to bother you but I ran into some problems while using the beta version. I've set the macro to disable a global source and after that, the VLC source in this case, was having problems. The source was enabled (manually) but the audio meters were not showing anything, very weird. I've set it to monitor and nothing. I have a source mirror that uses this VLC source to apply some filters on other scenes, the audio coming from that source mirror was OK (very odd). I had to create another quick macro to set it to enable that global source (VLC) and then it started showing something in the audio meter and playing sounds. Also, enabling and disabling some sources globally are not working for me.

It seems that your plugin is actually disabling a global source not showing in the UI. Here's an example:

1621720993151.png


Musicas - In game is a source mirror from Musicas (other scene). You can see the Musicas audio meter showing something but not the source mirror (musicas - in game). I've set a macro to disable the "Musicas - in game" and it did, but it does not shows in the UI (you can still see the eye icon on it).

Thanks.
 

ASchneider

Member
Hello again :)

Another feedback: I've set a couple of macros to pause each other at the end so it could act as a switch, to only run it once, like we had discussed before. This could work but a much better solution would be to have an option to "only run it once". That would help a lot to avoid errors when something happens and because of a sequence error, the switch doesn't work anymore.

Thanks.
 

itsyourapp

New Member
That was indeed a bug in the random tab's behaviour - thanks for pointing it out.

You can find a build which includes a fix here in a few minutes:
(You will have to be logged into GitHub to be able to download it - let me know if that should be an issue)

Let me know if everything works as expected with the fixed build!
That does seem to fix it the quick cycling. However once it gets to the final scene in the sequence the Randomizer takes over. That might be a feature not a bug. How do I have it stay on the final scene indefinitely so the randomizer does not take over?
 

Warmuptill

Active Member
That does seem to fix it the quick cycling. However once it gets to the final scene in the sequence the Randomizer takes over. That might be a feature not a bug. How do I have it stay on the final scene indefinitely so the randomizer does not take over?
That is indeed intended.
You could just "Pause" the scene switcher while on that scene. (See "Pause" tab)
 

Warmuptill

Active Member
Hello again sir!

Wow, just wow haha

I'll take it for a quick test drive and let you know, for sure.

Since I use LioranBoard, these are the ideas I had as suggestions for your plugin:

1. Text sources: use it on both trigger and action, so we could read (globally) a text source so if it matches some text, do something. On the action side, would be nice to change text sources.
2. Multiple trigger organization: I'm not really sure how AND and OR work here. How does the next OR, having an AND works? Like a parentheses on a mathematical equation, you could group those AND and OR for a better understanding and result.
3. Audio source trigger: being able to set audio status like muted/unmuted (globally) as trigger
4. Source/Scene filter trigger: same as the above (globally) but with filters visibility.
5. Wait/delay: does those actions stop when the trigger no longe matches the current scene?
6. Pause, stop, next/previous tracks: being able to do these actions on media sources, like VNC speacilly.
7. Variables: now that's a bit too much, maybe haha but being able to create and update local variables to use on other trigger or action settings would be nice. Again, I use LioranBoard and it is a much complex and suitable software for those kinds of things.

I really think your plugin is one of the most powerful ones available now, specially when you added the idea of MACROS, this is just awesome! Again, I think that more than 90% of the other tabs can be done only in the macro one and, going forward, it could be something of a LioranBoard killer for most people.

On last thought: maybe this plugin should be called OBS MACROS hahaha

Thank you very much for your work here, just amazing. Have a great day!
Thank you so much for the many suggestions and your feedback!
I really do appreciate it a lot! :)

>Multiple trigger organization
I agree, visually it could definitely be improved. I am just not sure how, yet.
At the moment the order of operations will be the following assuming you have 4 conditions and they are linked with "and", "and not" and "or":
((((Condition 0) && (Condition 1)) && (!(Condition 2))) || (Condition 3))

>Audio source trigger
I think I might have implemented that already as part of the version you tried, by allowing you to control the master volume in the audio action.

>Source/Scene filter trigger
Scene visibility and hiding filters per source is part of the test build, but I assume you want to disable "all filter with name abc" and "all item in scene 123" at once right?

>Wait/delay
No, it is just a simple wait for now.
The whole plugin goes to sleep during this time.
Good suggestion, but might be a bit complicated to implement.

>Pause, stop, next/previous tracks
Media source actions were already implemented but on a different branch.
I merged it into the pause-branch in case you want to give it a try:

>Variables
That seems very advanced indeed.
I will keep it in mind, but I doubt that I will introduce it any time soon ;)

>Delete/change order of any actions/trigger
Good suggestion - That is already on the todo list.

>I've set the macro to disable a global source
I think that behavior is intended from the point of view of the OBS API - I will see if there is a API call more fitting.
Just to clarify: What would you have expected to happen? (Audio, video and UI)
Would the scene visibility action maybe be more suited to this particular case?

>This could work but a much better solution would be to have an option to "only run it once"
What do you think about adding a "count" condition, which limits how often a macro can be run?
I agree that the current pause action is a bit more complicated to set up, but at the same time it should also be more powerful.
(There should be no harm in having multiple ways to achieve this besides UI clutter ;))
 
Last edited:

Warmuptill

Active Member
Hello Warmuptill!

Would it be possible to extend the "Network" feature by following options:
- include the "Preview" scene as well
- select for what scene what role (client/server) is used - e.g. for "Live" scene act as server, for "Preview" scene act as Client

I have a special use case for that in connection with the new Downstream Keyer from Exeldro, bringing in Graphics dynamically via NDI from a separate laptop. Your implementation would then allow on the "Live Production" laptop to show the graphics first in Preview before keying it on. All graphics handling is offloaded to a separate laptop in my setup
I now implemented the first feature of adding an option to synchronize the preview scene also.
You can find a test build here in a few minutes:
(You need to be logged into GitHub to be able to download it)
NetworkPreviewScene.png


The feature regarding client / server role selection per scene will take a bit more time and I am not yet sure when I will get around to it.
 

ASchneider

Member
Thank you so much for the many suggestions and your feedback!
I really do appreciate it a lot! :)

>Multiple trigger organization
I agree, visually it could definitely be improved. I am just not sure how, yet.
At the moment the order of operations will be the following assuming you have 4 conditions and they are linked with "and", "and not" and "or":
((((Condition 0) && (Condition 1)) && (!(Condition 2))) || (Condition 3))

>Audio source trigger
I think I might have implemented that already as part of the version you tried, by allowing you to control the master volume in the audio action.

>Source/Scene filter trigger
Scene visibility and hiding filters per source is part of the test build, but I assume you want to disable "all filter with name abc" and "all item in scene 123" at once right?

>Wait/delay
No, it is just a simple wait for now.
The whole plugin goes to sleep during this time.
Good suggestion, but might be a bit complicated to implement.

>Pause, stop, next/previous tracks
Media source actions were already implemented but on a different branch.
I merged it into the pause-branch in case you want to give it a try:

>Variables
That seems very advanced indeed.
I will keep it in mind, but I doubt that I will introduce it any time soon ;)

>Delete/change order of any actions/trigger
Good suggestion - That is already on the todo list.

>I've set the macro to disable a global source
I think that behavior is intended from the point of view of the OBS API - I will see if there is a API call more fitting.
Just to clarify: What would you have expected to happen? (Audio, video and UI)
Would the scene visibility action maybe be more suited to this particular case?

>This could work but a much better solution would be to have an option to "only run it once"
What do you think about adding a "count" condition, which limits how often a macro can be run?
I agree that the current pause action is a bit more complicated to set up, but at the same time it should also be more powerful.
(There should be no harm in having multiple ways to achieve this besides UI clutter ;))
Hello again :)

No worries, when I find something really cool and useful like this, I feel the need to help as much as possible, since you had put so much effort and work on this, this is the least I could do :)

Did you liked the first suggestion about Text GDI sources? That would be really useful if able to read a global source as a trigger or change text to any other sources. For example: If set the name of the game in the "starting soon" scene, OBS could change to the correct game overlay automatically in the "playing" scene. Even a per-scene voice control could be done using the closed caption plugin haha

About the "Source/Scene filter trigger" the idea is to be able to check any source if it is visible or not as a trigger. So a trigger would be: IF SOURCE something is ENABLED (globally). This would help as a condition to check if something elsewhere is hidden or not, to start the macro.

About the "I've set the macro to disable a global source" I was not able to express myself correctly, sorry. There's a problem (beta) when you set an action to hide/enable (same as visibility, right?) a source, if set it to a media player, for example, the music stops as the source is disabled but in the source list it keeps showing as visible (eye icon). I could not make it to play again, even switching the eye icon off and on again, I thought something broke here because that's not how OBS works, but I've managed to fix it by creating a temporary macro that just enables this media source again and it started to play again. So it seems that your plugin is disabling the source in the background in a way that is not possible to control it anymore in the user interface.

About the "only run it once" I totally agree that adding buttons everywhere would just clutter the user interface. I think a "count" condition would work just fine! I'm just not sure when this status is reseted? When the scenes changes or the conditions of the macro are again matched in the same scene?

Thank you very much for all explanations and effort in making this, possibly, the most powerful OBS plugin ever :)
 

Warmuptill

Active Member
Hello again :)

No worries, when I find something really cool and useful like this, I feel the need to help as much as possible, since you had put so much effort and work on this, this is the least I could do :)

Did you liked the first suggestion about Text GDI sources? That would be really useful if able to read a global source as a trigger or change text to any other sources. For example: If set the name of the game in the "starting soon" scene, OBS could change to the correct game overlay automatically in the "playing" scene. Even a per-scene voice control could be done using the closed caption plugin haha

About the "Source/Scene filter trigger" the idea is to be able to check any source if it is visible or not as a trigger. So a trigger would be: IF SOURCE something is ENABLED (globally). This would help as a condition to check if something elsewhere is hidden or not, to start the macro.

About the "I've set the macro to disable a global source" I was not able to express myself correctly, sorry. There's a problem (beta) when you set an action to hide/enable (same as visibility, right?) a source, if set it to a media player, for example, the music stops as the source is disabled but in the source list it keeps showing as visible (eye icon). I could not make it to play again, even switching the eye icon off and on again, I thought something broke here because that's not how OBS works, but I've managed to fix it by creating a temporary macro that just enables this media source again and it started to play again. So it seems that your plugin is disabling the source in the background in a way that is not possible to control it anymore in the user interface.

About the "only run it once" I totally agree that adding buttons everywhere would just clutter the user interface. I think a "count" condition would work just fine! I'm just not sure when this status is reseted? When the scenes changes or the conditions of the macro are again matched in the same scene?

Thank you very much for all explanations and effort in making this, possibly, the most powerful OBS plugin ever :)
>Did you liked the first suggestion about Text GDI sources?
Sounds interesting.
I will have to check how easy / difficult it will be to implement as I have never interacted with text sources before.

>About the "Source/Scene filter trigger"
Ah I see. By "enabled globally" you mean if the source is visible / hearable at the moment?
So probably this API:
Code:
bool obs_source_active(const obs_source_t *source)
Returns
true if active, false if not.
A source is only considered active if it’s being shown on the final mix

>action to hide/enable (same as visibility, right?) a source
It is not the same.

What you are looking for is probably scene visibility. (If you can think of a better name let me know)
This will also change the status of the "eye" symbol as you would expect.

Maybe I should add a warning that disabling sources cannot be undone via the UI of OBS.

>I'm just not sure when this status is reseted?
For now I would just add a button to reset the counter.
In future I might add a separate action to control counters of individual macros.
 

ASchneider

Member
>Did you liked the first suggestion about Text GDI sources?
Sounds interesting.
I will have to check how easy / difficult it will be to implement as I have never interacted with text sources before.

>About the "Source/Scene filter trigger"
Ah I see. By "enabled globally" you mean if the source is visible / hearable at the moment?
So probably this API:
Code:
bool obs_source_active(const obs_source_t *source)
Returns
true if active, false if not.
A source is only considered active if it’s being shown on the final mix

>action to hide/enable (same as visibility, right?) a source
It is not the same.

What you are looking for is probably scene visibility. (If you can think of a better name let me know)
This will also change the status of the "eye" symbol as you would expect.

Maybe I should add a warning that disabling sources cannot be undone via the UI of OBS.

>I'm just not sure when this status is reseted?
For now I would just add a button to reset the counter.
In future I might add a separate action to control counters of individual macros.
Hello @Warmuptill!

Ok, got it, so hide sources is not the same as source visibility. I'm trying to use it but choosing the desired scene visibility scene, I'm unable to select the group I intent to hide its visibility. Is that correct? I can all other sources there, except the group one.

Thanks.
 

ASchneider

Member
Hello again, after some tests, it seems that I can now select the sources from inside that group if I collapse it (click to show all sources from that group) but not the group source itself. Not sure if this is intended but if I close the group on the scene sources, they don't show in your plugin to select them anymore, neither the group source itself.

Group closed:

1621803580847.png

Group opened:

1621803630567.png
 

ASchneider

Member
Also, scene visibility is not working for me...

1621804184464.png


It does pause the current macro as set by the end of the macro so it is triggering. Not sure why source is not hidding.

Thanks.
 

Warmuptill

Active Member
Also, scene visibility is not working for me...

View attachment 71464

It does pause the current macro as set by the end of the macro so it is triggering. Not sure why source is not hidding.

Thanks.
Sorry about this and thank you for the tests and investigation!
I had only tested without these scene groups. (I didn't even know this feature existed to be honest)

I have fixed this behaviour and also allowed groups to be selected as the target of the scene visibility action.
You can find a build here in a few minutes:

 
I now implemented the first feature of adding an option to synchronize the preview scene also.
You can find a test build here in a few minutes:
(You need to be logged into GitHub to be able to download it)
View attachment 71441

The feature regarding client / server role selection per scene will take a bit more time and I am not yet sure when I will get around to it.

Hello Warumtill!

Did intensive tests today and it works fine! Thanks for the quick implementation! However double click automatically also switches the scene on my "Live Production" laptop so I have to be really careful :-)

Regarding the client / server role selection: It was initially not meant per scene - just in general for all scenes - so your checkbox solution is perfectly well but it should work and be named "Synchronize ONLY preview scene when running in Studio mode"

Hope this is just a few lines of code in your business logic, or is it more complicated?

Kind regards
Andreas
 
Top