Changing Zoom increments using middle wheel

Hi. Is there any way to modify the zoom increment with my middle wheel? I want slightly more options from my middle mouse between two positions.

Thank you

The link does not seem to have answers to my question.

1 Like

Give details of what options you want. We can only guess because we do not know what options you want.

Not possible in Blender. The operator
(bpy.ops.view3d.zoom(mx=0, my=0, delta=0, use_cursor_init=True) ) seems to have “delta” parameter, but it only seems to control direction, not speed. You could script a custom operator for that if you really really wanted this.

Thanks, just wanted to know if it was possible using Blender. I am not a programmer, so I will stick with the behaviour.

I meant, if it’s really important and you have a good reason Ctrl + MMB zooming doesn’t work for you, you cold seek further help with writing a zoom operator with control for speed. It’s not extremely complicated, you would have a good chance of getting help from the community.

1 Like

:smiley: Could start something like this :

bl_info = {
    "name": "Zoom2",
    "author": "...",
    "version": (1, 2),
    "blender": (3, 5, 1),
    "location": "View3D",
    "description": "Zoom with more speed control",
    "warning": "",
    "doc_url": "",
    "category": "3D View",
}

import bpy
from mathutils import Vector

class Zoom2(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "view3d.zoom2"
    bl_label = "Zoom 2"
    bl_description = "Zoom with speed control"
    bl_options  = {'REGISTER', 'UNDO'}
    dir: bpy.props.FloatProperty(default=1) #zoom direction
    increment: bpy.props.FloatProperty(default=0.1)
    @classmethod
    def poll(cls, context):
        return True

    def execute(self, context):
        context.region.data.view_location += Vector((1,0,0)) * self.dir
        
        # ... 
        # ... 
        # ... 
                
        return {'FINISHED'}

addon_keymaps = []
def register():
    bpy.utils.register_class(Zoom2)
    kcfg = bpy.context.window_manager.keyconfigs.addon
    if kcfg:
        km = kcfg.keymaps.new(name='3D View Generic', space_type='VIEW_3D')
        kmi = km.keymap_items.new("view3d.zoom2", 'F', 'PRESS', any=False, alt=True, ctrl=True,shift=True)
        addon_keymaps.append((km, kmi.idname))


def unregister():
    bpy.utils.unregister_class(Zoom2)
    for km, kmi_idname in addon_keymaps:
        for kmi in km.keymap_items:
            if kmi.idname == kmi_idname:
                km.keymap_items.remove(kmi)
    addon_keymaps.clear()


if __name__ == "__main__":
    register()
    
#for exprerimenting in console: bpy.context.window_manager.windows[0].screen.areas[2].regions[5].data (area index for 3d Viewport may differ)

You would only need to set proper hotkeys, and figure out how to move the view_matrix or view_location in the right direction based on view_rotation Those are in context.region.data. or bpy.context.window_manager.windows[0].screen.areas[2].regions[5].data if you test it from Python Console (the 2 in screen.areas[2] depends on areas you have in the UI). Auto Complete ( Tab ) is very useful:

image

1 Like

@SterlingRoth don’t you have a script for this?

Not quite, I helped someone change the FOV with the middle wheel:

View management is tough, my advice for @bruno is to make sure you recenter your camera regularly. [numpad .] will recenter on the selected object, and there is a center view to cursor operator as well:

The further from center your camera gets, the coarser you zoom increments become.

1 Like

I want to be able to decide the increments/steps using my middle mouse. As it is now I zoom in to objects at really big steps. I want smaller steps.

If a wheel turn represents moving forward by 1 m I want it to be 0.5 meters.

1 Like

Would be nice…one click of the mouse wheel sends my view halfway to Canada.

It is not that crazy, I mean the increments of zoom/mouse control are quite common in other apps.