Skip to content

Websocket returns invalid bounds with GetSceneItemTransform #13124

Open
obsproject/obs-websocket
#1367

Description

@SlackingSleeper

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions