obsproject / obs-studio

OBS Studio - Free and open source software for live streaming and screen recording
https://obsproject.com
GNU General Public License v2.0
57.29k stars 7.72k forks source link

Copy-pasting a source doesn't copy the "Scale filtering" property #3633

Open matoi974 opened 3 years ago

matoi974 commented 3 years ago

Platform

Operating system and version: Windows 10 2004 OBS Studio version:26.0.2

Expected Behavior

"Scale filtering" property should be inherited when copying and pasting a source.

Current Behavior

Currently, it un-sets to "Disabled" (aka bilinear).

Steps to Reproduce

  1. Create a text source.
  2. Set font to "Dpix_8pt Regular", size to 28pt, Anti-aliasing to Off.
  3. Resize the source to approximately 250px height and let obs-studio auto-fit the width. Set scaling type to "Point".
  4. Copy it and use Paste(reference) in the same scene. Screenshot: image

Additional information

Font file (ttf): dpix_8pt.zip

ogmkp commented 3 years ago

Reproduced on 26.0.2-0obsproject1~focal. Don't know if this is a issue or a feature.

WizardCM commented 3 years ago

"Paste (Reference)" and "Add Existing" both use the same code underneath, and both do a very simplified copy - they set the source reference, and visibility per the user's preference, but that's all.

https://github.com/obsproject/obs-studio/blob/fff45a41144e894ad11b046c6bedb720848f3f7a/UI/window-basic-source-select.cpp#L161-L162

The main reason why, is because scale filtering is per-scene-item, just like alt-crop. When you click Copy, or Add Existing, you're choosing a source rather than a scene-item, so at the time of pasting or Add Existing. It doesn't know exactly which instance of that source you originally copied, and therefore doesn't know what the crop or scale filter is.

Because of this, I believe this is by design. I'm not sure what the correct solution would be - and any potential solution would require a bit of a rework to store more than just the name of the source when copying. It'd also make the user experience a little more complicated.