From d2f53b80375d616461bab242bea1422d6d2f4c83 Mon Sep 17 00:00:00 2001 From: Decobus Date: Sun, 20 Jul 2025 17:32:30 -0400 Subject: [PATCH] Add proper bounds to nested scenes for correct scaling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Set 1600x900 bounds on nested scenes when added to parent scenes - Use OBS_BOUNDS_SCALE_INNER to scale content to fit within bounds - Center alignment for proper positioning in source switchers - Ensures stream scenes scale correctly to match ss_large dimensions 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- lib/obsClient.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/obsClient.js b/lib/obsClient.js index b717728..8c5f7e0 100644 --- a/lib/obsClient.js +++ b/lib/obsClient.js @@ -401,12 +401,28 @@ async function createStreamGroup(groupName, streamName, teamName, url) { if (!nestedSceneInTeam) { try { - await obsClient.call('CreateSceneItem', { + const { sceneItemId } = await obsClient.call('CreateSceneItem', { sceneName: groupName, sourceName: streamGroupName, sceneItemEnabled: true }); console.log(`Added nested scene "${streamGroupName}" to team scene "${groupName}"`); + + // Set bounds to 1600x900 to match the source switcher dimensions + await obsClient.call('SetSceneItemTransform', { + sceneName: groupName, + sceneItemId: sceneItemId, + sceneItemTransform: { + alignment: 5, // Center alignment + boundsAlignment: 0, // Center bounds alignment + boundsType: 'OBS_BOUNDS_SCALE_INNER', // Scale to fit inside bounds + boundsWidth: 1600, + boundsHeight: 900, + scaleX: 1.0, + scaleY: 1.0 + } + }); + console.log(`Set bounds for nested scene to 1600x900`); } catch (e) { console.error('Failed to add nested scene to team scene:', e.message); }