From 00be593adf63ffde82ebef0ceeabd9b7dd0b759e Mon Sep 17 00:00:00 2001 From: Tristan Strathearn Date: Wed, 1 Jun 2022 22:00:15 +1000 Subject: [PATCH] fix: ensure the reference object origin is restored when cancelling a new circular array operation --- replicate/circular_array.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/replicate/circular_array.py b/replicate/circular_array.py index 277f4ea..f6d24f3 100644 --- a/replicate/circular_array.py +++ b/replicate/circular_array.py @@ -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" @@ -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