Skip to content

Commit

Permalink
fix: match target object rotation in circular_array operator
Browse files Browse the repository at this point in the history
  • Loading branch information
tristan-hm committed Apr 28, 2022
1 parent e371881 commit 7ea17b0
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions power_mods/circular_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ def invoke(self, context, event):
set_origin(self.reference_obj, mx)

self.rotation_snapshot = self.rotator_obj.rotation_euler.copy()
self.reference_obj.rotation_euler = context.active_object.rotation_euler.copy()

self.add_array_modifier()
self.operate(context)

Expand Down Expand Up @@ -203,7 +205,9 @@ def revert(self, context):
bpy.ops.object.modifier_remove(modifier=self.array.name)

self.select_reference_obj(context)


self.reference_obj.rotation_euler = self.reference_obj_prev_rotation

if self.faux_origin:
modifier_names = [mod.name for mod in self.reference_obj.modifiers]
for name in modifier_names:
Expand All @@ -214,7 +218,6 @@ def revert(self, context):
set_origin(self.reference_obj, self.reference_obj_prev_matrix_world)

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

if self.new_empty:
bpy.context.scene.collection.objects.unlink(self.rotator_obj)
Expand Down

0 comments on commit 7ea17b0

Please sign in to comment.