SceneSwitcher icon indicating copy to clipboard operation
SceneSwitcher copied to clipboard

Swap Preview/Program in "studio mode" fails when "Swap preview/program scenes after transitioning" is disabled in the transition menu

Open Overc1ocker opened this issue 2 months ago • 3 comments

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

32.0.1

Advanced Scene Switcher Version

1.31.0

Plugin settings

No response

OBS Studio Log URL

No response

OBS Studio Crash Log URL

No response

Expected Behavior

The functionality of a "cut button" on a real video switcher is replicated

Current Behavior

The macro only pushed preview to program, but did not push program to preview after.

Steps to Reproduce

  1. Disable the "swap preview/program" option in OBS
  2. Write a macro using studio mode > Swap preview/program
  3. Notice how the macro does not function as it is supposed to ...

Anything else we should know?

The goal with this issue is to

  1. Report the "bug"

  2. Request that Advanced scene switcher gain access to the transition menu giving us "Duplicate scene", "Duplicate Switcher", "Swap preview and program scenes after transitioning" options within A S S

My goal with A S S is to faithfully recreate the functionality of a real studio switcher using OBS (mostly for IMAG). I was able to get the program and preview busses working properly using a keyboard, however this requires I disable "Swap preview and program scenes after transitioning." Unfortunately doing that breaks all methods within OBS to have preview and program flip (which is sometimes but not always desired behavior)

Please let me know if you have questions or possible work arounds!

Thanks

Overc1ocker avatar Oct 27 '25 01:10 Overc1ocker

Unfortunately, it seems like there is no way to change those settings at runtime via the OBS API.

While I am able to change the underlying config file storing the settings for the Swap preview and program scenes after transitioning, ... via the OBS API, it will only be loaded at startup, and I can't seem to find a way to force a reload of those settings. So, I can't resolve this issue at the moment.

WarmUpTill avatar Oct 28 '25 17:10 WarmUpTill

Thanks. After careful review of the API, I realized there was probably no way to achieve this. Of course thanks to OBS being open source and chatgpt being amazing at helping with coding issues, I am pleased to report that I am pretty close to adding the missing API call!

Overc1ocker avatar Oct 29 '25 12:10 Overc1ocker

So it works. Hopefully it gets merged upstream

OBS test plugin code

bool test_swap_scenes_api(void)
{
    bool current = obs_frontend_get_swap_scenes_mode();
    blog(LOG_INFO, "SwapScenes mode helper: %s", current ? "enabled" : "disabled");
    return current;
}

void toggle_swap_scenes_mode(void)
{
    // Directly get/set swap scenes mode
    bool current = obs_frontend_get_swap_scenes_mode();
    obs_frontend_set_swap_scenes_mode(!current);

    blog(LOG_INFO, "SwapScenes mode toggled: %s", !current ? "enabled" : "disabled");
}

result:

info: SwapScenes mode toggled: enabled
info: SwapScenesMode set to: true
info: SwapScenes mode toggled: disabled
info: SwapScenesMode set to: false

New API calls added: obs_frontend_set_swap_scenes_mode(bool) obs_frontend_get_swap_scenes_mode() //returns bool

Overc1ocker avatar Oct 29 '25 14:10 Overc1ocker