diff options
author | Spivak Vladimir (cwolf3d) <cwolf3d@gmail.com> | 2019-07-15 23:40:14 +0300 |
---|---|---|
committer | Spivak Vladimir (cwolf3d) <cwolf3d@gmail.com> | 2019-07-15 23:40:33 +0300 |
commit | d605104b9cfbbe2a8683aec775e8d3bf14de3a5c (patch) | |
tree | 2fd4ef4ba64f3025bec0884b5cdce9b4808acd41 /add_curve_extra_objects/add_curve_spirals.py | |
parent | 1a1ba20a888e1e1e7aaf31ffabc56660a5d004d5 (diff) |
Add Curve: Extra Objects: addon fix when enabled bpy.context.preferences.edit.use_enter_edit_mode = True
Diffstat (limited to 'add_curve_extra_objects/add_curve_spirals.py')
-rw-r--r-- | add_curve_extra_objects/add_curve_spirals.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/add_curve_extra_objects/add_curve_spirals.py b/add_curve_extra_objects/add_curve_spirals.py index 3cbb8410..c669642f 100644 --- a/add_curve_extra_objects/add_curve_spirals.py +++ b/add_curve_extra_objects/add_curve_spirals.py @@ -534,9 +534,19 @@ class CURVE_OT_spirals(Operator): return context.scene is not None def execute(self, context): + # turn off 'Enter Edit Mode' + use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode + bpy.context.preferences.edit.use_enter_edit_mode = False + time_start = time.time() self.align_matrix = align_matrix(context, self.startlocation) draw_curve(self, context, self.align_matrix) + + if use_enter_edit_mode: + bpy.ops.object.mode_set(mode = 'EDIT') + + # restore pre operator state + bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode #self.report({'INFO'}, #"Drawing Spiral Finished: %.4f sec" % (time.time() - time_start)) |