I know with ctrl + middle mouse button I can view vertical zoom , but how do I do this in python?

Zoom vertically

  • 1
    To be able to view the current settings, this needs to be done without operators. For the 3d view, this information is held in, and can be set from 'context.area.spaces[0].region_3d' , but the space for the sequencer seems to have no equivalent. – Snu Oct 23 at 0:37

I guess that it is somehow connected to "bpy.ops.sequencer.view_ghost_border", but nothing happens when using that function(Click the "Zoom Y " button in the sequencer header menu):

import bpy

def MyFunction(context):
    if not bpy.context.scene.sequence_editor: #create sequence, if missing

    bpy.ops.sequencer.view_ghost_border(gesture_mode=0, xmin=0, xmax=200, ymin=0, ymax=200)

class MyOperator(bpy.types.Operator): 
    '''Tooltip for MyOperator'''
    bl_idname = "object.my_operator"  
    bl_label = "My Operator" 
    bl_options = {"REGISTER", "UNDO"} 

    def poll(cls, context): 
        if context.object != None: 
            return context.object.select
        return False

    def execute(self, context):

        return {'FINISHED'}

    def invoke(self, context, event): 
        return self.execute(context)

def menu_draw(self, context):

    self.layout.operator(MyOperator.bl_idname, "Zoom Y") 

def register():

def unregister():

if __name__ == '__main__': 

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.