Add proper bounds to nested scenes for correct scaling

- 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 <noreply@anthropic.com>
This commit is contained in:
Decobus 2025-07-20 17:32:30 -04:00
parent caca548c45
commit d2f53b8037

View file

@ -401,12 +401,28 @@ async function createStreamGroup(groupName, streamName, teamName, url) {
if (!nestedSceneInTeam) { if (!nestedSceneInTeam) {
try { try {
await obsClient.call('CreateSceneItem', { const { sceneItemId } = await obsClient.call('CreateSceneItem', {
sceneName: groupName, sceneName: groupName,
sourceName: streamGroupName, sourceName: streamGroupName,
sceneItemEnabled: true sceneItemEnabled: true
}); });
console.log(`Added nested scene "${streamGroupName}" to team scene "${groupName}"`); 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) { } catch (e) {
console.error('Failed to add nested scene to team scene:', e.message); console.error('Failed to add nested scene to team scene:', e.message);
} }