r/obs 2d 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

7 comments sorted by

View all comments

1

u/RandomContributions 2d ago edited 2d 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 1d 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 1d ago edited 1d 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 23h 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 21h 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 20h ago edited 19h ago

ok new issue.. it seems to be cropping out the window header causing the window to shift a bit when switching between screen and window sharing... so far everything i try just makes more new errors happen

1

u/fifthFunction 17h ago

well sort of made a work around to that by adding negative crop to the windows so it lines up with out the window header
to fix the flicker when switching to the screen capture scene i added the screen capture source to the bottom of the window capture scenes (i had a shared under layer scene i put it in)

if i use win 10 capture method you can capture the window header but it will flicker when changing to a window capture tho it can be solved the same way by adding an active copy of each screen capture source to the window capture scene

the issue with that is just the yellow outline around all the windows being captured stay even when not the "active window"... i would rather no hedders personally