-
Notifications
You must be signed in to change notification settings - Fork 81
Toggle visibility of scene items on a timer
This simple example macro shows a source with the name "Overlay Source" on the current scene for exactly 5 seconds every 3 minutes.
In the following example we will set up a series of macros which allow us to achieve the following effect:
- On a set interval the visibility of sources on a scene will be toggled so that only one of the source is visible at a time
- The automated loop can be started and stopped via the press of a hotkey
We will need to create macros for the following functionality:
- A macro running the "main" loop
- A macro to start the loop (*)
- A macro to stop the loop (*)
- A macro handling the hotkey (*)
(*) If you do not care about resetting the visibility of the sources (or performing other actions) after pausing / unpausing the main loop you will not have to set up separate macros for the hotkey handling or pausing / unpausing the main loop.
A hotkey to simply toggle the pause state of a macro will automatically be created for each macro and can be used instead.
The goal of this macro is to continuously perform a set of actions.
So we use the the "Plugin state" condition type and specify "Advanced scene switcher is running" as this will always be true while the plugin is active.
The actions we will perform will consist of two actions types - the "Wait" action and the "Scene item visibility" action.
The former will allow us to specify the duration to wait for before advancing to the next set of actions.
The latter will be used to show or hide particular sources on a scene.
In this example we will toggle the visibility of three sources - "Color Source", "Color Source 2", and "Color Source 3".
As we only want to have one of the color sources be visible at a time we have to make sure that the previously shown color source is hidden.
Once we have adjusted the viability of the scene items we follow it up with a wait action to make sure the source is actually visible before hiding it again in the next step.
This series of actions - "hide" -> "show" -> "wait" - has to be repeated for each source resulting in a setup similar to the one below:
One point that can be important is to mark this "main loop" macro to run in parallel to other macros by pressing the "Run macro in parallel to other macros" button as it would otherwise block the execution of any other macro while it is running.
We will use the option to pause or unpause macros to control the "main loop".
This macro will not need to any conditions as we will trigger it from another macro (the one handling the hotkey).
The actions of this macro consist of one "Macro" action to unpause the macro and (optionally) "Scene item visibility" actions to reset the loop.
This macro will work just the same as the one starting the loop, but instead of unpausing the main loop we will pause it this time.
Once again you could optionally add additional actions to reset the scene item visibility of the sources touched by the main loop.
We will use the "Hotkey" condition type to register a new OBS hotkey with the name "Toggle Image Source Loop".
When this condition is true (meaning the hotkey was pressed) we run the "Sequence" action type.
This action will allow us to define a list of macros of which only one at a time will be run, but the key point being that each time the action is triggered it will advance to the next macro in the list.
Make sure to set up a keybind for this new hotkey in the OBS settings menu.
- Show webcam only when speaking
- Twitch Category Changer
- Show text source with latest Twitch follower
- Detect elements on screen and hide them automatically
- Motion detection
- Start other programs when starting OBS
- Crossfading audio during scene changes
- Switch scenes randomly
- Re-shuffle VLC source
- Automatically switch scene if a game capture's target window no longer exists
- Audio based scene switching in podcast setting
- Switching scenes based on portrait or landscape mode resolution of a window capture source
- Set up a hotkey to start and stop recording with a fade from and to black
- Automatically cycle through a list of scenes
- Toggle visibility of scene items on a timer
- Advance through a list of scenes by hotkey
- Performing actions only when transitioning from A to B
- Media playlist with commercial interruptions
- Split recording of stream into chunks
- Switching scenes for Aitum Vertical plugin
- Using MIDI devices
- Change capture window of Window Capture source
- Show URLs in clipboard in browser source
- General tab overview
- Starting and stopping the plugin
- Macros explained
- Creating a macro
- Pausing macros
- Macro duration modifiers
- Exporting and importing individual macros
- Audio condition
- Cursor condition
- Date condition
- Hotkey condition
- Media condition
- Process condition
- Scene item transform condition
- Slide Show condition
- Video condition
- Audio action
- Http action
- Hotkey action
- Random action
- Scene item visibility
- Sequence action
- Action Queue example
- Variables
- Websockets
- Scripting
- Troubleshooting
- Saving and loading settings