Skip to content

Commit

Permalink
fix: ensure summoned ring_and_bolt operator reverts back to previous …
Browse files Browse the repository at this point in the history
…values on cancel
  • Loading branch information
tristan-hm committed Feb 7, 2022
1 parent b7f1ed7 commit 4dbc91c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions generators/ring_and_bolt.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,9 @@ def summon_old_operator(self, context, mods):
self.screwX = mods[mod_screw_1]
self.screwZ = mods[mod_screw_2]

self.width = self.screwX.screw_offset
self.segments = self.screwZ.steps
self.segments = self.screwZ.render_steps
self.inner_radius = self.displace.strength
self.segments_prev = self.segments = self.screwZ.steps
self.inner_radius_prev = self.inner_radius = self.displace.strength
self.width_prev = self.width = self.screwX.screw_offset

self.obj = context.active_object

Expand Down Expand Up @@ -237,6 +236,12 @@ def revert(self, context):
bpy.ops.object.delete()
elif self.had_decimate_mod or self.segments > 3:
self.add_decimate_modifier()

if self.summoned:
self.screwX.screw_offset = self.width_prev
self.screwZ.steps = self.segments_prev
self.screwZ.render_steps = self.segments_prev
self.displace.strength = self.inner_radius_prev

unregister_draw_handler()

Expand Down

0 comments on commit 4dbc91c

Please sign in to comment.