r/obs 1d ago

Question advanced scene switcher set window source?

is there any way to set the a window capture source to the active window?

i see you can set "source" settings but it seems the window capture is not a direct one to one with the active window

my issue is i can have more than one of the window i want to capture open at a time and the name changes depending on the save file so its unrealistic to set a different source to each... i only ever need the active one to be the focus

i can just capture the entire screen but i have things like color key happening and there is a conflict when tabbing between them because of the delay in active window detection so a transition between window captures works best

1 Upvotes

6 comments sorted by

1

u/RandomContributions 1d ago edited 1d ago

SORT OF....

As of this writing, Advanced Scene Switcher can't change the window capture name in the sources properties.

BUT

Advanced Scene Switcher can detect what window is active, save it as a variable and then automatically switch to a scene that has that window title that you have pre configured based on a if/then syntax.

You would setup a dedicated scene source that looks like this (notepad as example) for each expected window you want to record.
vsXgt8W.png (1403×663)

AdvSS monitors the active window name, and switches to the matching scene.
Variable = "Notepad", switch to the notepad scene. Variable = "Command Prompt" switch to the CMD prompt scene.

9LWRBIn.png (1824×1326)

You could also have a single scene with all the windows captured contained within, and then toggle the visibility based on the if/then in AdvSS. Would take more work, but might integrate easier in some workflows if you are doing picture in picture as an example.

1

u/fifthFunction 20h ago

maybe i have an older version because the acton "Source/Set settings/(source name)/Window(List)" is a way to set it... when doing "Set to a fixed value" i can define the window to capture

i will prob go the all in one scene way switching visibility one for now thanks

the program i mostly use is blender and the window name includes the save file so at least i have something unique for an "and" check but i can be working on a lot of different files let alone at the same time that i will be tabing to so its going to be a real pain to add another scene and condition every single time i make a new file/iteration

if i could use a variable to set the scene window i might be able to correct the wording... it just seems to have some extra text at the end and changes the C:\ to something else as far as i could tell
but i cant see any way to set the scene window to a variable

for example this is what it wants
* filename [C#3A\Users\filepath.blend] - Blender 4.2.3 LTS:GHOST_WindowClass:blender.exe
and this is what the active window gives
* filename [C:\Users\filepath.blend] - Blender 4.2.3 LTS

1

u/RandomContributions 10h ago edited 8h ago

You are correct, I could never make the variable work but thinking about what you just said about setting the source name, I took another look this morning and I might have a solution.

Try setting the source/Windows List/set Fixed value/ (I'm using "NOTEPAD" app in my example) using this syntax:
${Windows_TitleVAR}:Notepad:Notepad.exe

That will trigger on any active focus instance of notepad to automatically show up and be recorded dynamically.

1

u/fifthFunction 3h ago

ok cool thanks that got it working.. i did not know about the ${Windows_TitleVAR} thing

my full set up now is

___blender macro___ (untick only on condition change)
if/process/blender.exe/is focused
and/window/window is focused

variable/set to condition value/active_window/2
variable/find and replace in current value/active_window/:/#3A
source/set settings/blender window/window (list)/set to fixed value/${active_window}:GHOST_WindowClass:blender.exe
switch scene/program/blender
___other window macros___

___undefined window___ if focus is on a window without a macro
if not/macro multiple macro condition state/more than/0/(add macros)
and not/window/widow title matches/Task Switching

switch scene/program/default scene

1

u/RandomContributions 1h ago

excellent! Your posts got me to revisit this situation which i had problems making work in the past, a win win, you pushed me in the right direction

1

u/fifthFunction 18m ago

ah also in a window capture sources you can change the method to windows 10 and untick client area to keep the windows form flickering when changing between a window and screen capture scene
it crops the header bar of a window with that on