obsproject / obs-websocket

Remote-control of OBS Studio through WebSocket
GNU General Public License v2.0
3.79k stars 701 forks source link

Bug: [WebSocket] SetSceneItemTransform sends "Failed" response, but succeds #1233

Closed hgdagon closed 2 weeks ago

hgdagon commented 2 weeks ago

Operating System Info

Windows 11

Other OS

No response

OBS Studio Version

Other

OBS Studio Version (Other)

30.1.2

obs-websocket Version

5.1.0

OBS Studio Log URL

https://obsproject.com/logs/CPH5DCmtBSJCbrfq

OBS Studio Crash Log URL

No response

Expected Behavior

Correct Response

Current Behavior

I'm using simpleobsws to change the transform of a GDI text source.

request = simpleobsws.Request('SetSceneItemTransform', {'sceneName': 'My_Scene', 'sceneItemId': 7, 'sceneItemTransform': {'width': 100'}})
response = await self.bot.ws.call(request)
print(response.requestStatus)

The status prints out as:

RequestStatus(result=False, code=703, comment='You have not provided any valid transform changes.')

The problem, however, is that the request actually succeeds, as in the width of the item does change.

Steps to Reproduce

  1. Send a SetSceneItemTransform WebSocket request providing only the width in sceneItemTransform
  2. ...

Anything else we should know?

WebSocket version is 5.4.2.

tt2468 commented 2 weeks ago

This fails because width is not a valid request parameter. Please consult the documentation before opening Github issues.

hgdagon commented 2 weeks ago

I don't get it. GetSceneItemTransform returns this:

{
  "sceneItemTransform": {
    "alignment": 8,
    "boundsAlignment": 0,
    "boundsHeight": 1.0,
    "boundsType": "OBS_BOUNDS_NONE",
    "boundsWidth": 1.0,
    "cropBottom": 0,
    "cropLeft": 0,
    "cropRight": 0,
    "cropTop": 0,
    "height": 61.90977478027344,
    "positionX": 960.0,
    "positionY": 630.0,
    "rotation": 0.0,
    "scaleX": 0.17290551960468292,
    "scaleY": 0.17293232679367065,
    "sourceHeight": 358.0,
    "sourceWidth": 2688.0,
    "width": 464.7700500488281
  }
}

So, how is width not valid?

tt2468 commented 2 weeks ago

width, height, sourceWidth, sourceHeight are all read-only values that only exist in GetSceneItemTransform. Use scaleX and scaleY to scale a scene item.