Skip to content

Commit

Permalink
Move the frame variable up in the scope and initialize it
Browse files Browse the repository at this point in the history
Should fix #131
  • Loading branch information
NathanLovato committed Jun 6, 2018
1 parent 6067582 commit 2470e34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions operators/mouse_trim.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class MouseTrim(bpy.types.Operator):

frame_start, frame_end = IntProperty(), IntProperty()
to_select = []

function = bpy.props.StringProperty("")

@classmethod
Expand All @@ -51,6 +50,7 @@ def poll(cls, context):

def invoke(self, context, event):
to_select = []
frame, channel = 1, 1
if not self.frame_start or self.frame_end:
x, y = context.region.view2d.region_to_view(
x=event.mouse_region_x, y=event.mouse_region_y)
Expand Down Expand Up @@ -84,5 +84,5 @@ def invoke(self, context, event):
bpy.context.scene.frame_current = min(self.frame_start, self.frame_end)
bpy.ops.sequencer.gap_remove()
else:
bpy.context.scene.frame_current = frame
bpy.context.scene.frame_current = self.frame_start if self.frame_start else frame
return {'FINISHED'}

0 comments on commit 2470e34

Please sign in to comment.