Using the API to Toggle Scene/Source Behavior in Studio-Mode

XLCOLDJ

Member
Is there a way to directly control the state of 'Duplicate Scene', 'Duplicate Sources', and 'Swap Preview...' using the API?

1. I read the manual and the API docs
2. I asked Chat GPT (waste of time SMH)
3. I browsed the config files looking for these settings

Am I overlooking something? Thanks.


1693250416693.png

I
 
Most OBS developers seem to hang out on Discord, so if my notes here don't help, you might ask there.

All three settings are stored in the [BasicWindow] section of global.ini, (stored in C:\Users\your-account-name\AppData\Roaming\obs-studio on Windows)

Duplicate Scene is SceneDuplicationMode, Duplicate Sources is EditPropertiesMode, Swap Preview/Program is SwapScenesMode

You can read and write elements of an ini file using the functions described at https://docs.obsproject.com/reference-libobs-util-config-file
I THOUGHT I had seen functions to deal with global.ini directly, but I am not finding them now, so I may be hallucinating even without ChatGPT.

Changing global.ini BEFORE you run OBS should work. Changing it while OBS is running is likely to be a problem: you would need to see when OBS reads and writes the file. It presumably reads at startup; I don't know if there are other times. Writing MIGHT happen when you change a setting, or it might happen only as OBS shuts down, in which case it might overwrite changes you made to the file while OBS was running.
 
Top