Skip to content

requesthandler: Add scene item blend method requests - #1352

Open
Agash wants to merge 3 commits into
obsproject:masterfrom
Agash:feature/scene-item-blend-method
Open

requesthandler: Add scene item blend method requests#1352
Agash wants to merge 3 commits into
obsproject:masterfrom
Agash:feature/scene-item-blend-method

Conversation

@Agash

@Agash Agash commented Aug 11, 2026

Copy link
Copy Markdown

Description

Adds GetSceneItemBlendMethod and SetSceneItemBlendMethod, mirroring the existing GetSceneItemBlendMode / SetSceneItemBlendMode pair, and adds a sceneItemBlendMethod field to the scene item list array next to the existing sceneItemBlendMode.

Valid values are OBS_BLEND_METHOD_DEFAULT and OBS_BLEND_METHOD_SRGB_OFF, converted via a new nlohmann type converter for obs_blending_method.

Motivation and Context

Closes #1341.

Browser sources used as overlays need their blending method set to sRGB Off for transparency to composite correctly, otherwise semi-transparent pixels show colour fringing and broken blending. SetSceneItemBlendMode only covers the blending mode, so this was the one step of overlay setup that could not be automated and had to be done by hand in the UI.

How Has This Been Tested?

Built OBS Studio from source with this branch as the plugins/obs-websocket submodule, then drove the requests over the protocol against the running instance:

  • GetSceneItemBlendMethod returns OBS_BLEND_METHOD_DEFAULT on a fresh scene item
  • SetSceneItemBlendMethod to OBS_BLEND_METHOD_SRGB_OFF and back to OBS_BLEND_METHOD_DEFAULT, each confirmed by a readback
  • an unknown value is rejected with 400 InvalidRequestField, a non-string with 401, a missing field with 300, and an unknown sceneItemId with 600
  • the same set/get pair through a request batch
  • GetSceneItemList reports the updated sceneItemBlendMethod
  • after closing OBS, the scene collection on disk records blend_method: srgb_off for the item

Tested OS(s): Windows 11

Types of changes

  • New request/event (non-breaking)

Checklist:

  • I have read the Contributing Guidelines.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • My code is not on master or a release/* branch.
  • The code has been tested.
  • I have included updates to all appropriate documentation.

Agash added 3 commits August 11, 2026 23:22
Adds the following requests:
- `GetSceneItemBlendMethod`
- `SetSceneItemBlendMethod`

Browser sources used as overlays need their blending method set to sRGB
Off for transparency to composite correctly. That was previously only
reachable through the UI, leaving a manual step in otherwise automated
overlay setup.

Closes obsproject#1341
Mirrors the existing `sceneItemBlendMode` field, so the blending method
of a scene item can be read without a request per item.
@Agash
Agash marked this pull request as ready for review August 11, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add GetSceneItemBlendMethod / SetSceneItemBlendMethod requests

1 participant