Skip to content

Commit

Permalink
fix: ensure the reference object origin is restored when cancelling a…
Browse files Browse the repository at this point in the history
… new circular array operation
  • Loading branch information
tristan-hm committed Jun 1, 2022
1 parent 48b5040 commit 00be593
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions replicate/circular_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ def prepare_new_operator(self, context):
self.reference_obj_prev_rotation = self.reference_obj.rotation_euler.copy()
self.reference_obj.location = context.active_object.location.copy()
self.reference_obj.rotation_euler = context.active_object.rotation_euler.copy()
self.reference_obj_matrix_world_backup = self.reference_obj.matrix_world.copy()

self.rotator_obj = bpy.data.objects.new("empty", None)
self.rotator_obj.name = "ND — Circular Array Rotator"
Expand Down Expand Up @@ -381,6 +382,9 @@ def revert(self, context):
bpy.data.objects.remove(self.rotator_obj, do_unlink=True)

if not self.single_obj_mode:
if not self.faux_origin:
set_origin(self.reference_obj, self.reference_obj_matrix_world_backup)

self.reference_obj.location = self.reference_obj_prev_location
self.reference_obj.rotation_euler = self.reference_obj_prev_rotation

Expand Down

0 comments on commit 00be593

Please sign in to comment.