Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSpivak Vladimir (cwolf3d) <cwolf3d@gmail.com>2019-07-15 23:40:14 +0300
committerSpivak Vladimir (cwolf3d) <cwolf3d@gmail.com>2019-07-15 23:40:33 +0300
commitd605104b9cfbbe2a8683aec775e8d3bf14de3a5c (patch)
tree2fd4ef4ba64f3025bec0884b5cdce9b4808acd41 /add_curve_extra_objects/add_curve_curly.py
parent1a1ba20a888e1e1e7aaf31ffabc56660a5d004d5 (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_curly.py')
-rw-r--r--add_curve_extra_objects/add_curve_curly.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/add_curve_extra_objects/add_curve_curly.py b/add_curve_extra_objects/add_curve_curly.py
index e904a070..b5243766 100644
--- a/add_curve_extra_objects/add_curve_curly.py
+++ b/add_curve_extra_objects/add_curve_curly.py
@@ -509,6 +509,10 @@ class add_curlycurve(Operator, AddObjectHelper):
row.prop(self, "shape", expand=True)
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
+
if self.types == 1:
add_type1(self, context)
if self.types == 2:
@@ -529,6 +533,12 @@ class add_curlycurve(Operator, AddObjectHelper):
add_type9(self, context)
if self.types == 10:
add_type10(self, context)
+
+ 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
return {'FINISHED'}