obsproject / obsproject/obs-studio

Websocket returns invalid bounds with GetSceneItemTransform

Open
#13,124 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
76.4k
Forks
10.2k
Avg merge
4d 23h
Merged PRs (30d)
12

Description

Operating System Info

Ubuntu 24.04

Other OS

No response

OBS Studio Version

Other

OBS Studio Version (Other)

32.0.2

OBS Studio Log URL

https://obsproject.com/logs/1mPntWVs75nTXZPZ

OBS Studio Crash Log URL

No response

Expected Behavior

I expected the return object from GetSceneItemTransform to be directly valid to use in SetSceneItemTransform.

Current Behavior

When using request GetSceneItemTransform on an item whose bounds have not been modified the websocket returns 0 for boundsHeight and boundsWidth.

{
  "d": {
    "requestId": "a",
    "requestStatus": {
      "code": 100,
      "result": true
    },
    "requestType": "GetSceneItemTransform",
    "responseData": {
      "sceneItemTransform": {
        "alignment": 5,
        "boundsAlignment": 0,
        "boundsHeight": 0,
        "boundsType": "OBS_BOUNDS_NONE",
        "boundsWidth": 0,
        "cropBottom": 0,
        "cropLeft": 0,
        "cropRight": 0,
        "cropToBounds": false,
        "cropTop": 0,
        "height": 50,
        "positionX": 0,
        "positionY": 1030,
        "rotation": 0,
        "scaleX": 1,
        "scaleY": 1,
        "sourceHeight": 50,
        "sourceWidth": 50,
        "width": 50
      }
    }
  },
  "op": 7
}

If you try to use the returned sceneItemTransform in a SetSceneItemTransform request the websocket returns

{
  "d": {
    "requestId": "a",
    "requestStatus": {
      "code": 402,
      "comment": "The field value of `boundsWidth` is below the minimum of `1.000000`",
      "result": false
    },
    "requestType": "SetSceneItemTransform"
  },
  "op": 7
}
Steps to Reproduce
  1. Create a new source. (I've only tested the colour and text sources)
  2. Use the GetSceneItemTransform request.
  3. Take the transform object from that request and make a SetSceneItemTransform request with it.
  4. OBS returns the error message
Anything else we should know?

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the GetSceneItemTransform and SetSceneItemTransform request handling in the OBS WebSocket API. Reproduce the round trip with a colour or text source using the provided transform data, then verify that the returned object can be accepted by SetSceneItemTransform without the bounds validation error.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.