obs-websocket-dotnet icon indicating copy to clipboard operation
obs-websocket-dotnet copied to clipboard

[ISSUE] SetSceneItemScaleFiltering (and GetSceneItemScaleFiltering)

Open Piripe opened this issue 2 years ago • 2 comments

  • Feature Request

I would like to change (and get) the scale filtering of a scene item,

Thanks in advance!

Versions OBS Version: 28.0.3 OBS WebSocket Dotnet (this library) Version: 5.0.0.2

Piripe avatar Oct 12 '22 13:10 Piripe

In obs-websocket 4.9.1 they added "scale.filter" to SceneItemTransform.

I am not sure if it is the case that they removed it in 5 or this project just doesn't expose it.

brendan-mccoy avatar Jun 05 '23 17:06 brendan-mccoy

Trying to use the normal Filters UI instead of the Scaling Filters menu, I found there is a "Scaling/Aspect Ratio" filter.

Since I'm just trying to apply the filter to (square) pixel art, I naturally set Scale Filtering to "Point" and Resolution to "1:1". Oddly, I can't seem to get any filtering to work on 1:1 in this manner. If I manually set the resolution (say, to the 40x40 of the Pokemon sprite the base image is, though I could set anything), then it works. However, whatever you set here overwrites whatever you've set for SceneItemTransform. Updating SceneItemTransform to whatever you want doesn't appear to modify or break the SourceFilter, so going forward I set the SourceFilter then if say I was using ScaleX and ScaleY (or whatever transforms I like) I set those on SceneItemTransform

So my SourceFilterList on the source appears as follows:

{
  "Name": "Scaling/Aspect Ratio",
  "Kind": "scale_filter",
  "Index": 0,
  "IsEnabled": true,
  "Settings": {
    "resolution": "40x40",
    "sampling": "point"
  }
}

While I would prefer to be able to set the Scale Filtering as part of SceneItemTransform per what they added to 4.9.1, this gets me there.

brendan-mccoy avatar Jun 05 '23 18:06 brendan-mccoy