diff --git a/generators/ring_and_bolt.py b/generators/ring_and_bolt.py index 79d31af..c7b8267 100644 --- a/generators/ring_and_bolt.py +++ b/generators/ring_and_bolt.py @@ -23,11 +23,17 @@ def modal(self, context, event): if self.key_toggle_operator_passthrough: toggle_operator_passthrough(self) - if self.key_toggle_pin_overlay: + elif self.key_toggle_pin_overlay: toggle_pin_overlay(self) - if self.operator_passthrough: + elif self.key_cancel: + self.revert(context) + + return {'CANCELLED'} + + elif self.operator_passthrough: self.update_overlay_wrapper(context, event) + return {'PASS_THROUGH'} elif self.key_increase_factor: @@ -64,11 +70,6 @@ def modal(self, context, event): return {'FINISHED'} - elif self.key_cancel: - self.revert(context) - - return {'CANCELLED'} - elif self.key_movement_passthrough: return {'PASS_THROUGH'} diff --git a/generators/screw_head.py b/generators/screw_head.py index 680c3cc..2887fc2 100644 --- a/generators/screw_head.py +++ b/generators/screw_head.py @@ -25,11 +25,17 @@ def modal(self, context, event): if self.key_toggle_operator_passthrough: toggle_operator_passthrough(self) - if self.key_toggle_pin_overlay: + elif self.key_toggle_pin_overlay: toggle_pin_overlay(self) - if self.operator_passthrough: + elif self.key_cancel: + self.revert(context) + + return {'CANCELLED'} + + elif self.operator_passthrough: self.update_overlay_wrapper(context, event) + return {'PASS_THROUGH'} elif self.key_increase_factor: @@ -67,11 +73,6 @@ def modal(self, context, event): return {'FINISHED'} - elif self.key_cancel: - self.revert(context) - - return {'CANCELLED'} - elif self.key_movement_passthrough: return {'PASS_THROUGH'} diff --git a/power_mods/screw.py b/power_mods/screw.py index 0967e0d..7fc6f28 100644 --- a/power_mods/screw.py +++ b/power_mods/screw.py @@ -22,11 +22,17 @@ def modal(self, context, event): if self.key_toggle_operator_passthrough: toggle_operator_passthrough(self) - if self.key_toggle_pin_overlay: + elif self.key_toggle_pin_overlay: toggle_pin_overlay(self) - if self.operator_passthrough: + elif self.key_cancel: + self.revert(context) + + return {'CANCELLED'} + + elif self.operator_passthrough: self.update_overlay_wrapper(context, event) + return {'PASS_THROUGH'} elif self.key_increase_factor: @@ -68,11 +74,6 @@ def modal(self, context, event): return {'FINISHED'} - elif self.key_cancel: - self.revert(context) - - return {'CANCELLED'} - elif self.key_movement_passthrough: return {'PASS_THROUGH'} diff --git a/power_mods/solidify.py b/power_mods/solidify.py index d0274b3..d6cdb4e 100644 --- a/power_mods/solidify.py +++ b/power_mods/solidify.py @@ -21,11 +21,17 @@ def modal(self, context, event): if self.key_toggle_operator_passthrough: toggle_operator_passthrough(self) - if self.key_toggle_pin_overlay: + elif self.key_toggle_pin_overlay: toggle_pin_overlay(self) - if self.operator_passthrough: + elif self.key_cancel: + self.revert(context) + + return {'CANCELLED'} + + elif self.operator_passthrough: self.update_overlay_wrapper(context, event) + return {'PASS_THROUGH'} elif self.key_increase_factor: @@ -61,11 +67,6 @@ def modal(self, context, event): return {'FINISHED'} - elif self.key_cancel: - self.revert(context) - - return {'CANCELLED'} - elif self.key_movement_passthrough: return {'PASS_THROUGH'} diff --git a/power_mods/weighted_normal_bevel.py b/power_mods/weighted_normal_bevel.py index a11095c..4fb09c6 100644 --- a/power_mods/weighted_normal_bevel.py +++ b/power_mods/weighted_normal_bevel.py @@ -20,11 +20,17 @@ def modal(self, context, event): if self.key_toggle_operator_passthrough: toggle_operator_passthrough(self) - if self.key_toggle_pin_overlay: + elif self.key_toggle_pin_overlay: toggle_pin_overlay(self) - if self.operator_passthrough: + elif self.key_cancel: + self.revert(context) + + return {'CANCELLED'} + + elif self.operator_passthrough: self.update_overlay_wrapper(context, event) + return {'PASS_THROUGH'} elif self.key_increase_factor: @@ -44,11 +50,6 @@ def modal(self, context, event): return {'FINISHED'} - elif self.key_cancel: - self.revert(context) - - return {'CANCELLED'} - elif self.key_movement_passthrough: return {'PASS_THROUGH'} diff --git a/sketching/blank_sketch.py b/sketching/blank_sketch.py index 27566f6..6302589 100644 --- a/sketching/blank_sketch.py +++ b/sketching/blank_sketch.py @@ -18,11 +18,17 @@ def modal(self, context, event): if self.key_toggle_operator_passthrough: toggle_operator_passthrough(self) - if self.key_toggle_pin_overlay: + elif self.key_toggle_pin_overlay: toggle_pin_overlay(self) - if self.operator_passthrough: + elif self.key_cancel: + self.revert(context) + + return {'CANCELLED'} + + elif self.operator_passthrough: self.update_overlay_wrapper(context, event) + return {'PASS_THROUGH'} elif self.key_confirm_alternative: @@ -30,24 +36,6 @@ def modal(self, context, event): return {'FINISHED'} - # Pass through useful common vertex manipulation shortcuts //... - - elif self.key_shift and event.type == 'D' and event.value == 'PRESS': - return {'PASS_THROUGH'} - - elif event.alt and event.type == 'Z' and event.value == 'PRESS': - return {'PASS_THROUGH'} - - elif event.type in {'LEFTMOUSE', 'E', 'G', 'WHEELUPMOUSE', 'WHEELDOWNMOUSE'} or event.ctrl: - return {'PASS_THROUGH'} - - # ...// - - elif self.key_cancel: - self.revert(context) - - return {'CANCELLED'} - elif self.key_movement_passthrough: return {'PASS_THROUGH'} diff --git a/sketching/geo_lift.py b/sketching/geo_lift.py index c4440f2..6dc85c6 100644 --- a/sketching/geo_lift.py +++ b/sketching/geo_lift.py @@ -18,11 +18,17 @@ def modal(self, context, event): if self.key_toggle_operator_passthrough: toggle_operator_passthrough(self) - if self.key_toggle_pin_overlay: + elif self.key_toggle_pin_overlay: toggle_pin_overlay(self) - if self.operator_passthrough: + elif self.key_cancel: + self.clean_up(context) + + return {'CANCELLED'} + + elif self.operator_passthrough: self.update_overlay_wrapper(context, event) + return {'PASS_THROUGH'} elif self.key_confirm: @@ -31,11 +37,6 @@ def modal(self, context, event): elif self.key_confirm_alternative: return self.finish(context) - elif self.key_cancel: - self.clean_up(context) - - return {'CANCELLED'} - elif self.key_movement_passthrough: return {'PASS_THROUGH'} diff --git a/sketching/vertex_bevel.py b/sketching/vertex_bevel.py index 1946d8e..45ea862 100644 --- a/sketching/vertex_bevel.py +++ b/sketching/vertex_bevel.py @@ -21,11 +21,17 @@ def modal(self, context, event): if self.key_toggle_operator_passthrough: toggle_operator_passthrough(self) - if self.key_toggle_pin_overlay: + elif self.key_toggle_pin_overlay: toggle_pin_overlay(self) - if self.operator_passthrough: + elif self.key_cancel: + self.revert(context) + + return {'CANCELLED'} + + elif self.operator_passthrough: self.update_overlay_wrapper(context, event) + return {'PASS_THROUGH'} elif self.key_increase_factor: @@ -60,11 +66,6 @@ def modal(self, context, event): self.finish(context) return {'FINISHED'} - - elif self.key_cancel: - self.revert(context) - - return {'CANCELLED'} elif self.key_movement_passthrough: return {'PASS_THROUGH'} diff --git a/sketching/view_align.py b/sketching/view_align.py index 34b8f87..382b47c 100644 --- a/sketching/view_align.py +++ b/sketching/view_align.py @@ -19,11 +19,17 @@ def modal(self, context, event): if self.key_toggle_operator_passthrough: toggle_operator_passthrough(self) - if self.key_toggle_pin_overlay: + elif self.key_toggle_pin_overlay: toggle_pin_overlay(self) - if self.operator_passthrough: + elif self.key_cancel: + self.clean_up(context) + + return {'CANCELLED'} + + elif self.operator_passthrough: self.update_overlay_wrapper(context, event) + return {'PASS_THROUGH'} elif self.key_step_up: @@ -54,11 +60,6 @@ def modal(self, context, event): elif self.key_confirm_alternative: return self.finish(context) - elif self.key_cancel: - self.clean_up(context) - - return {'CANCELLED'} - elif self.key_movement_passthrough: return {'PASS_THROUGH'}