From d605104b9cfbbe2a8683aec775e8d3bf14de3a5c Mon Sep 17 00:00:00 2001 From: "Spivak Vladimir (cwolf3d)" Date: Mon, 15 Jul 2019 23:40:14 +0300 Subject: Add Curve: Extra Objects: addon fix when enabled bpy.context.preferences.edit.use_enter_edit_mode = True --- add_curve_extra_objects/add_curve_curly.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'add_curve_extra_objects/add_curve_curly.py') 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'} -- cgit v1.2.3