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

Add transition event to prevent blink #15

Closed BlankSourceCode closed 7 months ago

BlankSourceCode commented 7 months ago

This PR fixes an issue with changing scenes when the transform applied to the source in each scene is different.

Issue: When changing scenes we release the sceneitem and revert the transform back to the original to prevent a bad state with the source layout. In the new scene we find the new sceneitem (assuming it exists) and apply the zooming filter settings. This would cause a noticeable blink if the source had a different transform set as you would see it in the old state before we applied the new settings

Fix: The fix is to listen to the transition_start event so that we can release the sceneitem before the new scene has loaded. This prevents seeing the wrong filter settings applied, so the 'blink' goes away.

Also added a new None option for the zoom source, selecting this will revert the transform back to the original and remove the zoom filter settings. This allows users to modify the transform and re-apply the zoom calculations much easier than what the Force Transform Update button was trying to do. So that button has now been removed.