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
60.13k stars 7.96k forks source link

Pasting filters only applies to the last item selected. #4290

Closed AskMP closed 2 weeks ago

AskMP commented 3 years ago

Platform

Operating system and version: Windows OBS Studio version: 26.1.1 OBS Log file: N/A

Expected Behavior

Selecting multiple sources within a scene and applying the "Paste Filters" option should paste the previously copied filters on all the selected items, not just the one at the lowest of the source list.

Current Behavior

Pasting only applies the filter(s) to the most lowest source item.

Steps to Reproduce

  1. Select a source that has a filter or apply any filter to the source
  2. Copy the filter using the right click popout menu item option
  3. Select multiple sources using the multi-select mouse hotkey applicable to your platform
  4. Right click on any of the selected sources and apply the filter via the "paste filter" option
  5. Select any of the sources that are not the lowest source in the list (note that it doesn't matter the order, it's simply the lowest in the list) to confirm the filter is not applied.
bershanskiy commented 3 years ago

I can reproduce the issue on the same setup, but with two exceptions:

@AskMP could you please check again to make sure I understood you correctly?

I think the issue is caused by OBSBasic::on_actionPasteFilters_triggered() calling GetCurrentSceneItem() to get only that one source here: https://github.com/obsproject/obs-studio/blob/753de748e5dd8c796d5eb2290adfc777bdae3501/UI/window-basic-main.cpp#L7868

We probably can create another helper which returns an array of OBSSceneItems with all selected ones and apply filters to each of them on with obs_source_copy_filters().

Edit: This proof-of concept patch works as expected. I'll file a PR tomorrow.

AskMP commented 3 years ago

I'm scene prepping for an event right now so I am cautious of implementing a patch but based on your event call stack labels, I think I can verify that it is exactly that. Thank you! I look forward to seeing the new implementation. 48 source groups in a single shot needing to be individually had their shot filter pasted onto them later... This is great that it's fixed.

bershanskiy commented 3 years ago

I didn't have time to file the PR today, but I'll do that this week.

Fenrirthviti commented 2 weeks ago

Closing as stale. If this is still an issue please open a new issue with updated reproduction steps on the latest version of OBS.