Advanced Scene Switcher

Advanced Scene Switcher 1.28.1

Sperbus

New Member
That should be doable with the following set of macros:
You can import these example macros using the following settings:
Code:
{"macros":[{"name":"Get current slide name","pause":false,"parallel":false,"onChange":true,"skipExecOnStart":false,"group":false,"dockSettings":{"register":false,"hasRunButton":true,"hasPauseButton":true,"hasStatusLabel":false,"highlightIfConditionsTrue":false,"runButtonText":"Run","pauseButtonText":"Pause","unpauseButtonText":"Unpause","conditionsTrueStatusText":"Conditions are true.","conditionsFalseStatusText":"Conditions are false."},"registerHotkeys":false,"pauseHotkey":[],"unpauseHotkey":[],"togglePauseHotkey":[],"conditions":[{"collapsed":false,"id":"slideshow","logic":0,"durationModifier":{"time_constraint":0,"seconds":{"value":{"value":0.0,"type":0},"unit":0,"version":1}},"condition":0,"source":{"type":0,"name":"Image Slide Show"},"index":{"value":0,"type":0},"path":""},{"collapsed":false,"id":"slideshow","logic":102,"durationModifier":{"time_constraint":0,"seconds":{"value":{"value":0.0,"type":0},"unit":0,"version":1}},"condition":2,"source":{"type":0,"name":"Image Slide Show"},"index":{"value":0,"type":0},"path":""}],"actions":[{"collapsed":false,"id":"variable","enabled":true,"variableName":"Image Path","variable2Name":"invalid variable selection","strValue":"","numValue":0.0,"condition":5,"segmentIdx":1,"subStringStart":0,"subStringSize":0,"regexPattern":".*","regexMatchIdx":0,"findStr":"Text to find","replaceStr":"Text to replace with","regexConfig":{"enable":false,"partial":true,"options":0},"mathExpression":"( 1 + 2 * 3 ) / 4","useCustomPrompt":false,"inputPrompt":"Assign value to variable:"}]},{"name":"Set Caption","pause":false,"parallel":false,"onChange":true,"skipExecOnStart":false,"group":false,"dockSettings":{"register":false,"hasRunButton":true,"hasPauseButton":true,"hasStatusLabel":false,"highlightIfConditionsTrue":false,"runButtonText":"Run","pauseButtonText":"Pause","unpauseButtonText":"Unpause","conditionsTrueStatusText":"Conditions are true.","conditionsFalseStatusText":"Conditions are false."},"registerHotkeys":false,"pauseHotkey":[],"unpauseHotkey":[],"togglePauseHotkey":[],"conditions":[{"collapsed":false,"id":"variable","logic":0,"durationModifier":{"time_constraint":0,"seconds":{"value":{"value":0.0,"type":0},"unit":0,"version":1}},"variableName":"Image Path","variable2Name":"invalid variable selection","strValue":"","numValue":0.0,"condition":5,"regexConfig":{"enable":false,"partial":false,"options":0}}],"actions":[{"collapsed":false,"id":"source","enabled":true,"source":{"type":0,"name":"Text (GDI+)"},"action":2,"sourceSettingButton":{"id":"","description":""},"settings":"{\n    \"text\": \"${Image Path}\"\n}\n","deinterlaceMode":0,"deinterlaceOrder":0}]}],"version":"1.23.1"}

Let me know if you have any questions or need further details! :)
So this seems to work just fine, but is there a way to filter out the full path and file extension of it? I guess I can crop the window to hide the file path but it will still say .jpeg or .png in the captions
 

Warmuptill

Active Member
So this seems to work just fine, but is there a way to filter out the full path and file extension of it? I guess I can crop the window to hide the file path but it will still say .jpeg or .png in the captions
Yes that is possible.
For example, you can adjust the variable value like this:

Capture.PNG


You will of course have to adjust the file extension(s) and path prefix to your setup.

Here is the example macro from the screenshot in case you want to import it:
Code:
{"macros":[{"name":"Get current slide name","pause":false,"parallel":false,"onChange":true,"skipExecOnStart":false,"group":false,"dockSettings":{"register":false,"hasRunButton":true,"hasPauseButton":true,"hasStatusLabel":false,"highlightIfConditionsTrue":false,"runButtonText":"Run","pauseButtonText":"Pause","unpauseButtonText":"Unpause","conditionsTrueStatusText":"Conditions are true.","conditionsFalseStatusText":"Conditions are false."},"registerHotkeys":false,"pauseHotkey":[],"unpauseHotkey":[],"togglePauseHotkey":[],"conditions":[{"collapsed":false,"id":"slideshow","logic":0,"durationModifier":{"time_constraint":0,"seconds":{"value":{"value":0.0,"type":0},"unit":0,"version":1}},"condition":0,"source":{"type":0,"name":"Image Slide Show"},"index":{"value":0,"type":0},"path":""},{"collapsed":false,"id":"slideshow","logic":102,"durationModifier":{"time_constraint":0,"seconds":{"value":{"value":0.0,"type":0},"unit":0,"version":1}},"condition":2,"source":{"type":0,"name":"Image Slide Show"},"index":{"value":0,"type":0},"path":""}],"actions":[{"collapsed":false,"id":"variable","enabled":true,"variableName":"Image Path","variable2Name":"invalid variable selection","strValue":"","numValue":0.0,"condition":5,"segmentIdx":1,"subStringStart":0,"subStringSize":0,"regexPattern":".*","regexMatchIdx":0,"findStr":"Text to find","replaceStr":"Text to replace with","regexConfig":{"enable":false,"partial":true,"options":0},"mathExpression":"( 1 + 2 * 3 ) / 4","useCustomPrompt":false,"inputPrompt":"Assign value to variable:"},{"collapsed":false,"id":"variable","enabled":true,"variableName":"Image Path","variable2Name":"invalid variable selection","strValue":"","numValue":0.0,"condition":9,"segmentIdx":-1,"subStringStart":0,"subStringSize":0,"regexPattern":".*","regexMatchIdx":0,"findStr":".PNG","replaceStr":"","regexConfig":{"enable":false,"partial":true,"options":0},"mathExpression":"( 1 + 2 * 3 ) / 4","useCustomPrompt":false,"inputPrompt":"Assign value to variable:"},{"collapsed":false,"id":"variable","enabled":true,"variableName":"Image Path","variable2Name":"invalid variable selection","strValue":"","numValue":0.0,"condition":9,"segmentIdx":-1,"subStringStart":0,"subStringSize":0,"regexPattern":".*","regexMatchIdx":0,"findStr":"C:/Users/Till/Desktop/","replaceStr":"","regexConfig":{"enable":false,"partial":true,"options":0},"mathExpression":"( 1 + 2 * 3 ) / 4","useCustomPrompt":false,"inputPrompt":"Assign value to variable:"}]}],"version":"27e6bdc"}
 

Sperbus

New Member
Yes that is possible.
For example, you can adjust the variable value like this:

View attachment 96806

You will of course have to adjust the file extension(s) and path prefix to your setup.

Here is the example macro from the screenshot in case you want to import it:
Code:
{"macros":[{"name":"Get current slide name","pause":false,"parallel":false,"onChange":true,"skipExecOnStart":false,"group":false,"dockSettings":{"register":false,"hasRunButton":true,"hasPauseButton":true,"hasStatusLabel":false,"highlightIfConditionsTrue":false,"runButtonText":"Run","pauseButtonText":"Pause","unpauseButtonText":"Unpause","conditionsTrueStatusText":"Conditions are true.","conditionsFalseStatusText":"Conditions are false."},"registerHotkeys":false,"pauseHotkey":[],"unpauseHotkey":[],"togglePauseHotkey":[],"conditions":[{"collapsed":false,"id":"slideshow","logic":0,"durationModifier":{"time_constraint":0,"seconds":{"value":{"value":0.0,"type":0},"unit":0,"version":1}},"condition":0,"source":{"type":0,"name":"Image Slide Show"},"index":{"value":0,"type":0},"path":""},{"collapsed":false,"id":"slideshow","logic":102,"durationModifier":{"time_constraint":0,"seconds":{"value":{"value":0.0,"type":0},"unit":0,"version":1}},"condition":2,"source":{"type":0,"name":"Image Slide Show"},"index":{"value":0,"type":0},"path":""}],"actions":[{"collapsed":false,"id":"variable","enabled":true,"variableName":"Image Path","variable2Name":"invalid variable selection","strValue":"","numValue":0.0,"condition":5,"segmentIdx":1,"subStringStart":0,"subStringSize":0,"regexPattern":".*","regexMatchIdx":0,"findStr":"Text to find","replaceStr":"Text to replace with","regexConfig":{"enable":false,"partial":true,"options":0},"mathExpression":"( 1 + 2 * 3 ) / 4","useCustomPrompt":false,"inputPrompt":"Assign value to variable:"},{"collapsed":false,"id":"variable","enabled":true,"variableName":"Image Path","variable2Name":"invalid variable selection","strValue":"","numValue":0.0,"condition":9,"segmentIdx":-1,"subStringStart":0,"subStringSize":0,"regexPattern":".*","regexMatchIdx":0,"findStr":".PNG","replaceStr":"","regexConfig":{"enable":false,"partial":true,"options":0},"mathExpression":"( 1 + 2 * 3 ) / 4","useCustomPrompt":false,"inputPrompt":"Assign value to variable:"},{"collapsed":false,"id":"variable","enabled":true,"variableName":"Image Path","variable2Name":"invalid variable selection","strValue":"","numValue":0.0,"condition":9,"segmentIdx":-1,"subStringStart":0,"subStringSize":0,"regexPattern":".*","regexMatchIdx":0,"findStr":"C:/Users/Till/Desktop/","replaceStr":"","regexConfig":{"enable":false,"partial":true,"options":0},"mathExpression":"( 1 + 2 * 3 ) / 4","useCustomPrompt":false,"inputPrompt":"Assign value to variable:"}]}],"version":"27e6bdc"}
This works perfectly, thank you so much!

LAST question: this might require a different plugin, but is there a way to keep the text box the same and have the font size change to fit the bounding box instead of the other way around like it does?
 

Warmuptill

Active Member
LAST question: this might require a different plugin, but is there a way to keep the text box the same and have the font size change to fit the bounding box instead of the other way around like it does?
Unfortunately I am not familiar with such an option.
(Maybe someone on the OBS Discord can help with that)
 

AaronD

Active Member
This works perfectly, thank you so much!

LAST question: this might require a different plugin, but is there a way to keep the text box the same and have the font size change to fit the bounding box instead of the other way around like it does?
If you change the transform (size), then the text changes size to fit. If you just change the text, then the box changes as you found.

So, I think the solution is to change the text as above, then immediately change the transform back to what you want:
1692142834246.png
 

AaronD

Active Member
If you change the transform (size), then the text changes size to fit. If you just change the text, then the box changes as you found.

So, I think the solution is to change the text as above, then immediately change the transform back to what you want:
View attachment 96821
Okay, a bit of testing shows that the straightforward approach to this actually stretches/squashes the text to fit in the exact size specified.

So maybe the better solution would be an update to the Transform action, or maybe a new action, to keep one corner or the center or the center of an edge fixed, and keep or set the aspect ratio while changing just one dimension. Under the hood, it would read the transform, do that math, and then set the transform.
 

Warmuptill

Active Member

Important information for MacOS users:​


If you are running the OBS 30 beta releases on MacOS, the official releases of the Advanced Scene Switcher plugin will not function. In fact, having the plugin installed will result in OBS immediately crashing on startup and prompting you to start in "Safe mode" without any plugins!

Other platforms are *not* affected!

What do I need to do?​


The first step should be to back up your existing settings while using the previously compatible version of OBS again.
You will have to do this for each scene collection.


If you want to continue using the Advanced Scene Switcher plugin with the OBS 30 beta, you will have to use this development release of the plugin:


https://github.com/WarmUpTill/SceneSwitcher/actions/runs/5741802989?pr=800


Note that you will have to be logged into GitHub to be able to download it.
Also note that this version of the plugin is not compatible with OBS versions older than OBS 30.


Why is this happening?​


This is happening due to an incompatibility in the asio library, which was updated to version 1.28.0 with OBS 30.
The plugin will switch to this new version once OBS 30 was released officially.

(This information was also shared on GitHub)
 
Last edited:

Destroy666

Member
How does `Source` -> `Set settings` work exactly? Do I see correctly it replaces only the provided settings and leaves the rest in tact? What would be the easiest way to remove some settings? Just set them to blank/opposite values?
 
Last edited:

Destroy666

Member
And one more question - is there an easy way to check if the opposite of action X happens, if both macros have "Perform actions only on condition change" checked? I tried "If not Macro condition state of Somemacro is true", but that fired when the conditions in Somemacro were matched. If I changed "if not" to "if" the same thing happened.

I assume this is a problem related to "Perform actions only on condition change", but not sure. Any way around it, other than just reversing all conditions from the other macro in the new macro?

1692317393673.png
 

AaronD

Active Member
How does `Source` -> `Set settings` work exactly? Do I see correctly it replaces only the provided settings and leaves the rest in tact? What would be the easiest way to remove some settings? Just set them to blank/opposite values?
For me, it only affects what is actually present in the macro. Everything else is left as-is.

There's really no concept of "removing" settings either. All settings always exist, and they're always equal to something. The default is simply a particular something. If you want that back, you need to set it back. Kinda like a physical knob in that sense.

If you're asking about how to remove settings *from the macro*, then you just pare down the block of text while keeping the structure:
This, for example:
Code:
{
    "alignment": 5,
    "bottom": 0,
    "bounds": {
        "x": 1920,
        "y": 1080
    },
    "bounds_alignment": 0,
    "bounds_type": 2,
    "left": 0,
    "pos": {
        "x": 0,
        "y": 0
    },
    "right": 0,
    "rot": 0,
    "scale": {
        "x": 1,
        "y": 1
    },
    "size": {
        "height": 720,
        "width": 1280
    },
    "top": 0
}
might become this:
Code:
{
    "size": {
        "height": 720,
        "width": 1280
    }
}
Most of that is just keeping track of the matching braces: {}
 

Warmuptill

Active Member
And one more question - is there an easy way to check if the opposite of action X happens, if both macros have "Perform actions only on condition change" checked? I tried "If not Macro condition state of Somemacro is true", but that fired when the conditions in Somemacro were matched. If I changed "if not" to "if" the same thing happened.

I assume this is a problem related to "Perform actions only on condition change", but not sure. Any way around it, other than just reversing all conditions from the other macro in the new macro?

View attachment 96869
I am not sure I fully understand, so let me try to rephrase.
You are trying to detect when a macro's conditions are not true, regardless if "Perform actions only on condition change" is checked, right?

So for example, if you have a macro A with condition "if current scene is scene 1", you want to know when the conditions of A are not true, regardless of if the "on change" option is checked, correct?

In that case you could for example uncheck the "on change" option of macro A and instead move its actions to a "wrapper" macro which does have the option enabled.

Here is a screenshot of what I mean:
Capture.PNG

Capture2.PNG


This would allow you to still check for the state of the conditions of Macro A while performing the actions only "on change" in the "Wrapper" macro.

Alternatively you could use variables to indicate the state of the condition.

What approach is best is difficult to say without knowing more of what you are trying to set up.
Hope that helps! :)
 
Last edited:

Destroy666

Member
There's really no concept of "removing" settings either. All settings always exist, and they're always equal to something. The default is simply a particular something. If you want that back, you need to set it back. Kinda like a physical knob in that sense.

I see, thanks. Do all plugins follow this? I thought I've seen some properties in a source and later not.
What approach is best is difficult to say without know more of what you are trying to set up.

I'm basically just trying to minimize clutter wherever possible and was wondering what the easiest way to set up inverse condition "Perform only" macros would be :P Your way makes sense but doesn't really help with that aspect by adding extra macro per inversion, I'll just stick with the reversed conditions.

One more question - is there any way to get text value of text source that's set either from a bunch of various files and through text field? Basically the "displayed text" value. Nothing like that in settings. Maybe possible with reading current file value -> file contents or current text value based on the true/false property that defines where the text is from, an easier way I'm missing though?
 

Warmuptill

Active Member
One more question - is there any way to get text value of text source that's set either from a bunch of various files and through text field? Basically the "displayed text" value. Nothing like that in settings. Maybe possible with reading current file value -> file contents or current text value based on the true/false property that defines where the text is from, an easier way I'm missing though?
An easy but comparatively very resource intensive and potentially inaccurate alternative would be the video conditions's OCR capabilities.

OCR.PNG


Not sure if that is practical for what you would be using it for.
 

AaronD

Active Member
One more question - is there any way to get text value of text source that's set either from a bunch of various files and through text field? Basically the "displayed text" value. Nothing like that in settings. Maybe possible with reading current file value -> file contents or current text value based on the true/false property that defines where the text is from, an easier way I'm missing though?
There's this, but it might not necessarily be the displayed text in all cases:
1692401164080.png
 

Destroy666

Member
There's this, but it might not necessarily be the displayed text in all cases:
View attachment 96889
Yea, that's not what I'm looking for unfortunately, it doesn't work when file is chosen and the much more convoluted approach I mentioned would be required, if it even works.

An easy but comparatively very resource intensive and potentially inaccurate alternative would be the video conditions's OCR capabilities.

View attachment 96887

Not sure if that is practical for what you would be using it for.
I don't mind resources too much (for now), although OCR surely can take away some CPU power, but does it detect actual text changes? Doesn't seem to when I tested now. I also think it won't work in the long run regardless because that text source has obstructing animation going on every now and then, so it could detect the video as containing/not containing text intermittently.
 

peejaygee

New Member
Afternoon. So I already use your Advanced Scene Switcher (and what a tool it is, helps a lot) but I'm unsure if this option is available, I have looked through the options/settings, but due to wording and my description, I'm unsure if it's even possible and/or maybe add-able to the plugin? :)

Looking through the scene/sources choices it doesn't appear to jump out at me, but looking at what you can do with the scenes/sources, I'm thinking it 'may' be possible (if implemented)

So I have a random website that is intractable (that you'd click on) in my sources, when I switch to the scene, I right click and 'Interact' which pops it out, allowing me to click on it as I need during the time of use.

I was wondering if there is a setting, option or macro write up available that would make that one source 'interact' automatically when I switch to that scene?

Thanks for your time.
 

Warmuptill

Active Member
Looking through the scene/sources choices it doesn't appear to jump out at me, but looking at what you can do with the scenes/sources, I'm thinking it 'may' be possible (if implemented)
You didn't miss anything - currently this is not supported :)

I was wondering if there is a setting, option or macro write up available that would make that one source 'interact' automatically when I switch to that scene?
Just to clarify:
Is your intention to automatically open up the interaction dialog or to automate the interaction with the source itself?
The former should be rather straight forward to implement, while the latter might require quite a bit of work.

In case of the latter, can you provide more details what type of interaction is required? (mouse movement, key presses, etc.)

Update:
A build for the former functionality is available here:
Capture.PNG

Note that you have to be logged into GitHub to be able to download it.
Let me know if that should be a problem or if you run into issues with the build.
 
Last edited:
I was experimenting the websocket message to change the aitum vertical scene. It has been excellent. But is there a code to change it's scene transition? I want to have certain vertical scenes with specific scene transitions.
 

Warmuptill

Active Member
I was experimenting the websocket message to change the aitum vertical scene. It has been excellent. But is there a code to change it's scene transition? I want to have certain vertical scenes with specific scene transitions.
Unfortunately, it seems like the Aitum Vertical plugin does not support a way to change the transition or at least it is not obvious to me how to do so.

I would suggest you ask the plugin developers of Aitum Vertical directly if this is supported / if they are willing to implement it. (If it is already supported by them and they point how how I can of course help you setting up the corresponding websocket action. :))
 
Last edited:
Top