Resource icon

Zoom to Mouse 1.0.1

B2Run

New Member
There isn't anything more to it than just deleting the script from OBS, it's just the single Lua file.

What version of OBS are you using? Is it 29? Do you have any other scripts or plugins that might be interfering with it? I'm not sure what else to suggest. Did you restart OBS between removing and re-adding the script? Maybe something got cached.
OBS version is 30.0.02. I have few plugin but all worked fine until I switched phisically 2 of my screen and then I changed the screen capture source. Anyway, I'll continue to try. Thanks again
 
OBS version is 30.0.02. I have few plugin but all worked fine until I switched phisically 2 of my screen and then I changed the screen capture source. Anyway, I'll continue to try. Thanks again
My guess is that OBS is reporting the size/position of your monitors incorrectly after you switched them.

Have you tried enabling set manual source position and filling in the x/y/width/height values?
 

B2Run

New Member
The screen I need to zoom has a negative value as the Y coordinate, and currently, it seems that it's not possible to insert it into the script
 
The screen I need to zoom has a negative value as the Y coordinate, and currently, it seems that it's not possible to insert it into the script
You must have a really old version of the script, even before v1.0.0, where did you even get it from?

If you can't download and use the latest from GitHub, try looking in your version for a line that looks like:

Lua:
local override_x = obs.obs_properties_add_int(props, "monitor_override_x", "X", 0, 10000, 1)
local override_y = obs.obs_properties_add_int(props, "monitor_override_y", "Y", 0, 10000, 1)

And then change the 0 to -10000 on both lines
 

B2Run

New Member
Got it! Finally I resolved! It seems that even if I overwrited the old version of script, it continue to be present. Now all it's fine. Thanks again!
 

sawizzle

New Member
Thank you for this amazing script! I might be over looking something and forgive me if I am, but was there any way for multiple sources to be used in conjunction with this script? As of right now I can only have one lua script of zoom-to-mouse added for all sources. I was hoping to add two more monitors but was not able to since one instance of the script can be applied for any given source at a time. Thank you for any advice or guidance and thank you again for this amazing script!
I wish to have this feature as well and also this script is incredible! Thank you!!! Even just a second monitor option would be incredible if there is a way.
 
I wish to have this feature as well and also this script is incredible! Thank you!!! Even just a second monitor option would be incredible if there is a way.
You should be able to add a second copy of the script (with a rename) and add that to obs too. Then in the second copy just point it at a different zoom source.

There isn't a great way to handle it beyond that right now. I did have plans to use a custom filter you could apply to different sources to mark it as command, but OBS has bugs with Lua made filters that made it unworkable.
 

Chubbuluss

New Member
The second I switch scene with the display capture within a group, then come back, the plugin just ceases to function until I remove it from the group, re-apply the plugin to that display capture and then re-add it to the group. Therefore rendering the entire script useless.
 

Daameer

New Member
I'm trying to combine your script with Aitum Vertical so all parts of the screen can be seen during vertical streaming with games where mouse moves. The script works well with the source if I wanted to zoom in on the horizontal stream (game source that remained as "jackbox game" on a 1080p monitor), but I can't make it go to all the corners on the vertical screen of Aitum Vertical.

Been trying to play with parameters to get it to work but no success... Do I need to change something in the script?


[obs-zoom-to-mouse.lua] Zoom crop filter removed
[obs-zoom-to-mouse.lua] Transform info reset back to original
[obs-zoom-to-mouse.lua] Transform crop reset back to original
[obs-zoom-to-mouse.lua] OBS Version: 30.1

[obs-zoom-to-mouse.lua] Current settings:
[obs-zoom-to-mouse.lua] {
[obs-zoom-to-mouse.lua] use_auto_follow_mouse = true,
[obs-zoom-to-mouse.lua] use_follow_outside_bounds = false,
[obs-zoom-to-mouse.lua] follow_speed = 0.4,
[obs-zoom-to-mouse.lua] follow_border = 50,
[obs-zoom-to-mouse.lua] follow_safezone_sensitivity = 2,
[obs-zoom-to-mouse.lua] use_follow_auto_lock = false,
[obs-zoom-to-mouse.lua] zoom_value = 1.83,
[obs-zoom-to-mouse.lua] zoom_speed = 0.02,
[obs-zoom-to-mouse.lua] use_monitor_override = true,
[obs-zoom-to-mouse.lua] monitor_override_x = 0,
[obs-zoom-to-mouse.lua] monitor_override_y = 0,
[obs-zoom-to-mouse.lua] monitor_override_w = 1920,
[obs-zoom-to-mouse.lua] monitor_override_h = 1080,
[obs-zoom-to-mouse.lua] monitor_override_sx = 1,
[obs-zoom-to-mouse.lua] monitor_override_sy = 1,
[obs-zoom-to-mouse.lua] monitor_override_dw = 1080,
[obs-zoom-to-mouse.lua] monitor_override_dh = 1920,

[obs-zoom-to-mouse.lua] debug_logs = true,
[obs-zoom-to-mouse.lua] }
[obs-zoom-to-mouse.lua] Adding transition_start listener to Cut
[obs-zoom-to-mouse.lua] Adding transition_start listener to Fade
[obs-zoom-to-mouse.lua] Adding transition_start listener to Stinger
[obs-zoom-to-mouse.lua] Adding transition_start listener to Luma Wipe
[obs-zoom-to-mouse.lua] Adding transition_start listener to Swipe
[obs-zoom-to-mouse.lua] Adding transition_start listener to Fade to Color
[obs-zoom-to-mouse.lua] Adding transition_start listener to stinger advanced
[obs-zoom-to-mouse.lua] Adding transition_start listener to Move

[obs-zoom-to-mouse.lua] Finding sceneitem for Zoom Source 'jacbox game'
[obs-zoom-to-mouse.lua] Looking in scene 'ingame'
[obs-zoom-to-mouse.lua] Found sceneitem 'jacbox game'
[obs-zoom-to-mouse.lua] Using source size: 1920, 1080
 
I'm trying to combine your script with Aitum Vertical so all parts of the screen can be seen during vertical streaming with games where mouse moves. The script works well with the source if I wanted to zoom in on the horizontal stream (game source that remained as "jackbox game" on a 1080p monitor), but I can't make it go to all the corners on the vertical screen of Aitum Vertical.

Been trying to play with parameters to get it to work but no success... Do I need to change something in the script?
Try taking a look at the GitHub issue (which actually links to another one)

Someone made a change that fixed it for their vertical case, hopefully it will also work for you.
 

Daameer

New Member
Thanks @BlankSourceCode, I wanted to reply since I figured it last night but was too busy by now.

My solution was changing the line that sets boundries when it crops. Since I don't need zoom (using zoom 1x in the end for max coverage in vertical layout) but I needed the "scroll left and right effect" I changed the line for crop.x with numbers that work out for my setup.

Lua:
crop.x = math.floor(clamp(-540, pos.x, 540))


If I knew how to watch variables for LUA I would probably make it using your logic... but this worked out for my setup.
People using actual zoom and not just scrolling will need to play more with the same line.
 

roqq

New Member
Does anybody know why this script is only moving the X axis and not really actually following the mouse, but just moves the screen, sortasay... :(
 
Top