I have tried to modify the disable_mmb_zoom.py code, so that it works on Nuke13-16. Thanks to Adam Bob Kelway (https://www.nukepedia.com/tools/python/ui/disable_mmb_zoom) for developing this code.
Disable middle mouse buttom to zoom in-out in DAG
It preserves all normal mouse behavior (including MMB drag pan) and only blocks the MMB click zoom/zoom-to-fit in the Node Graph. It retries installation until Nuke’s Qt UI is ready, then distinguishes click vs drag using a small cursor-movement threshold.
The problem here is that Nuke doesn’t natively support turning off this behaviour. There are no preferences, and there are no python API calls either. To be able to tweak this behaviour you rather have to hack into the Qt widget stack that is making up the GUI in Nuke. You got to find the correct widget, in this case the DAG, and install an event filter on it which makes it possible to get a callback to your own function whenever something you are listening in on is happening. In this case the events we are listening for are middle clicks. What we then do is catching that event, and doing some hacks to get the behaviour we are after. There are some filtering for only triggering our override when you middle click (actually middle press and then middle release close to the same coordinates), and not when you are using the middle mouse (read: Wacom pen) button to pan around. We also create and delete a Dot node, and send a left mouse button click instead of the middle click to the DAG to make it work seamlessly in the background.

Comments