BlankSourceCode / obs-zoom-to-mouse

An OBS lua script to zoom a display-capture source to focus on the mouse
178 stars 15 forks source link

Issue when mask filter is applied #26

Closed anasak-dev closed 5 months ago

anasak-dev commented 5 months ago

Thanks for this amazing script, I am using it and it works well but issue is coming when mask filter is applied on screen capture.

Issue is when the screen zooms in, it crops out the mask from some corners and sometime from all corners, if there is any resolution for it pls let me know, adding some screenshots belo

Mask applied (normal)

mask-applied-normal

Mask when OBS Zoom is enabled

mask-changed-after-zoom

OBS zoom to mouse filter properties

obs-zoom-filter-properties

The mask I am using for rounded corners browser-mask

BlankSourceCode commented 5 months ago

@anasak-dev This is due to the script forcing the crop filter that it uses for zoom to always be at the bottom of the list so that it zooms in after the mask has already been rendered.

Since you aren't using any other filters, you could probably change the code to make it put the crop filter first, so that the mask renders on top of the zoom, giving you rounded corners after you've zoomed in.

To do that, change line 733 from:

obs.obs_source_filter_set_order(source, crop_filter, obs.OBS_ORDER_MOVE_BOTTOM)

to:

obs.obs_source_filter_set_order(source, crop_filter, obs.OBS_ORDER_MOVE_TOP)

Then just save and reload the script in OBS.

That should let you keep the rounded corners. If you add more filters later it may mess up the zooming especially if you add a custom crop/pad filter, so just something to keep in mind.

Good luck, and thanks for using the script.

anasak-dev commented 5 months ago

@BlankSourceCode thanks for your message and the code update.

Unfortunately after updating the said line of code, the issue remains same. If you need any more details from my end pls lmk, thanks again!

anasak-dev commented 5 months ago

@BlankSourceCode pls disregard my last comment, I must be using wrong version of script, upon updating to the script you mentioned and then updating the line of code did the trick I think, many thanks.