Resource icon

Next Scene and Previous Scene Hotkeys v1.3

SimonGZ

New Member
SimonGZ submitted a new resource:

Next Scene and Previous Scene Hotkeys - Add hotkeys to move to the next or previous scene in OBS

This Lua script adds hotkeys for Next Scene and Previous Scene, which let you cycle through your scenes in OBS from the keyboard.

I use OBS like a slideshow/presentation deck so this helps me cycle through dozens of scenes during a broadcast.

It can be installed using the Tools --> Scripts menu in OBS.

DISCLAIMER: I'm new to OBS and quickly rigged this up because every other plugin/script seemed to be a very complicated scene switcher and all I wanted was a basic hotkey. I believe I've...

Read more about this resource...
 

allsorts

New Member
Hi,

Very new to OBS (days..) and also wanted a simple "next" sequential scene switcher. As you say everything else is event/time based or very complex for a newbie. To be honest I was surprised that this feature was missing from OBS. Stumbled across your script, brilliant, just what I was looking for, thank you.

Being curious as to what a script looked like, I took a peek at the code and noticed in script_load() you have:
Code:
local prev_hotkey_save_array = obs.obs_data_get_array(settings, "prev_scene.trigger")
...
obs.obs_data_array_release(hotkey_save_array)
Shouldn't that be obs.obs_data_array_release(prev_hotkey_save_array) as it is in the block of code before it dealling with next?

NFR:
Currently it just stops when it gets to the end of the scene list. Might be nice to have a "pop-up" informing the user that the end of the list has been reached, with an option to loop back to the begining. Maybe have the pop-up optional as well so the script automatically loops back.

Haven't the faintest idea if pop-ups/script options like that are possible. Thanks again.
 

acbury

New Member
Well done, this is exactly what I was looking for in my current studio I'm setting up.

If there is anyway possible to make loop back to the beginning of the list once it reaches the end I would ecstatic. Unfortunately, I don't have the skills to do it myself.

Thanks!
 

SimonGZ

New Member
SimonGZ updated Next Scene and Previous Scene Hotkeys with a new update entry:

Quick Bug Fix

Fixing a bug flagged by allsorts. Thanks!

Read the rest of this update entry...
 

SimonGZ

New Member
Thanks for spotting that mistake in the code! I've fixed it.

I'll think about the other requests. The looping is easy, the part I don't know how to do is to offer the options, but I know it's possible.
 

SimonGZ

New Member

SimonGZ

New Member
If there is anyway possible to make loop back to the beginning of the list once it reaches the end I would ecstatic. Unfortunately, I don't have the skills to do it myself.

You got it. I've added this feature with an optional checkbox. You can download the new version of the script and check the box in the Scripts menu where you installed the script.
 

Petrichord

New Member
Thank you so much for this. I am teching a virtual play using OBS and couldn't use timed transitions for things and was going crazy trying to find a simple solution to scene transitions.

Thank you thank you thank you!
 

jeroppi

New Member
Hi.
Total beginner here.
I installed the script but I don´t know how to use it.
How or where should I input the hotkeys?
I can't find the interface showed on the picture ( obs-next-scene.png )
Any help sincerely appreciated!
 

jeroppi

New Member
Ah, nevermind, I found it!
After installing Python and entering the path in Tools > scripts > Python settings,
I found the place to enter the hotkeys (File > Settings > Hotkeys > Next Scene / Previous Scene).
 

IveTechMedia

New Member
Thanks for this very useful script fixing a missing feature. Presently it switches to the Program Output directly in Studio Mode. Is it possible to adapt this to switch to the Preview window? Then it's possible to scroll down (next and previous) and confirm the right scene before using transition to put to line. I use a Stream Deck which has hotkey buttons (set to next/prev/transition) and it would be nice to set up the next scene, confirm it's correct in the preview window and then use transition to go to program. That way I don't need to use the keyboard or mouse during a show. Thanks again.
 

SimonGZ

New Member
Thanks for this very useful script fixing a missing feature. Presently it switches to the Program Output directly in Studio Mode. Is it possible to adapt this to switch to the Preview window? Then it's possible to scroll down (next and previous) and confirm the right scene before using transition to put to line. I use a Stream Deck which has hotkey buttons (set to next/prev/transition) and it would be nice to set up the next scene, confirm it's correct in the preview window and then use transition to go to program. That way I don't need to use the keyboard or mouse during a show. Thanks again.

Just noticed your message. I personally don't use studio mode much but I believe what you're describing is possible without too much trouble. I would probably want to add an additional option to the menu so users could toggle the behavior. I'll investigate it.
 

SimonGZ

New Member
SimonGZ updated Next Scene and Previous Scene Hotkeys with a new update entry:

Adding a new "Preview Mode" option

In response to a request from user IveTechMedia, I've added a feature called Preview Mode.

When the Preview Mode checkbox is checked in settings and Studio Mode is being used in OBS, the next scene and previous scene hotkeys will change the preview mode rather than the active program view. This means you can use the hotkeys to change your previews and then use a transition to update...

Read the rest of this update entry...
 

IveTechMedia

New Member
I have just seen this update and response to my request. Impressed and many thanks. However.... If I am using it correctly while the next and previous do indeed change the preview window and not the Program, but when the transition key is used the preview (in studio mode) goes back to the previous scene that was just showing. So if you are working through a sequence of scenes then it's necessary to press next twice to preview the next slide. So it's Transition, Next, Next, Transition. When live on air this is not good and prone to errors. Useful operation would be Transition/Next/Transition/Next. Or even better Preview showing next automatically after Transition. I may have missed something because I've not found a "Preview mode" in Settings as mentioned above but a "Change Preview" in Tools Scripts. Is this what you meant? Thanks.
 

Talonis

Member
A really nice feature. Unfortunatelty it seems it doesn't work with Stream Deck hotkey functions (on a Mac at least).

Using the physical keyboard works fine but putting that keyboard shortcut into a Stream Deck elicits no response when pressing the hotkey action.
 

SimonGZ

New Member
re: Stream Deck

I've had that issue with the Stream Deck and OBS as well. I don't think it's specific to this script. What I ended up doing (which is admittedly complicated) is I set up several hotkeys in the macOS scripting system HammerSpoon which I then trigger with StreamDeck, and then when Hammerspoon receives those hotkeys, it then sends a hotkey directly to OBS. It's an annoying extra step.

If anyone is curious, this is the script I use:

Lua:
-- Adding these to help stream deck talk to OBS
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "]", function()
    hs.eventtap.event.newKeyEvent(hs.keycodes.map.f4, true):post(hs.application.get'OBS')
end)

hs.hotkey.bind({"cmd", "alt", "ctrl"}, "[", function()
    hs.eventtap.event.newKeyEvent(hs.keycodes.map.f3, true):post(hs.application.get'OBS')
end)

hs.hotkey.bind({"cmd", "alt", "ctrl"}, "\\", function()
    hs.eventtap.event.newKeyEvent(hs.keycodes.map.f1, true):post(hs.application.get'OBS')
end)
 

NoSignal_UK

New Member
This is so useful, I have a question. I have some extra scenes that just contain elements used in other scenes I don't want to cycle through as part of this. Is there a way to exclude these when cycling through?

Context: I stream VR a lot, and would be nice to cycle through scenes but exclude scenes such as my "Stream starting..." scene etc.

Thanks :)
 

SimonGZ

New Member
Couple months late to reply but... Unfortunately that's not a feature I'd want to build in at this time because I want to keep this script very bare bones and focused on simply providing a hotkey to go to the next or previous scenes. But I bet that one of the more complicated switchers like Advanced Scene Switcher might be able to suit your needs if you played around with it.
 
Top