Skip to content

Commit

Permalink
fix for rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
doakey3 committed Mar 1, 2018
1 parent 3d22c1d commit 84ced81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
7 changes: 1 addition & 6 deletions operators/rotate/apply_strip_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ def apply_strip_rotation(self, strip, rot, init_rot, init_t, event):
event : bpy.types.Event
Allows us to check if ctrl is pressed
"""
if init_rot < -180:
init_rot = 360 + init_rot
if init_rot > 180:
init_rot = -360 + init_rot

flip_x = 1
if strip.use_flip_x:
flip_x = -1
Expand All @@ -36,7 +31,7 @@ def apply_strip_rotation(self, strip, rot, init_rot, init_t, event):
if strip.use_flip_y:
flip_y = -1

strip_rot = init_rot + flip_x * flip_y * rot
strip_rot = init_rot + (flip_x * flip_y * rot)

if event.ctrl:
strip_rot = math.ceil(strip_rot / self.stepwise_increment)
Expand Down
8 changes: 6 additions & 2 deletions operators/rotate/rotate.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ def modal(self, context, event):

rot = float(self.rot_prev)

if abs(self.init_rot - (rot - 360)) < abs(self.init_rot - rot):
rot = rot - 360

process_input(self, event.type, event.value)
if self.key_val != '':
try:
Expand Down Expand Up @@ -163,6 +166,7 @@ def invoke(self, context, event):


self.tab = ensure_transforms()
active_strip = scene.sequence_editor.active_strip

for strip in self.tab:
strip.select = True
Expand Down Expand Up @@ -195,8 +199,6 @@ def invoke(self, context, event):
self.center_area = Vector(pos)

elif context.scene.seq_pivot_type == '3':
active_strip = scene.sequence_editor.active_strip

flip_x = 1
if strip.use_flip_x:
flip_x = -1
Expand Down Expand Up @@ -234,6 +236,8 @@ def invoke(self, context, event):

self.vec_prev = Vector(self.vec_init)

self.init_rot = active_strip.rotation_start

args = (self, context)
self.handle_line = bpy.types.SpaceSequenceEditor.draw_handler_add(
draw_px_point, args, 'PREVIEW', 'POST_PIXEL')
Expand Down

0 comments on commit 84ced81

Please sign in to comment.