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_celtic_links.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_celtic_links.py')
-rw-r--r-- | add_curve_extra_objects/add_curve_celtic_links.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/add_curve_extra_objects/add_curve_celtic_links.py b/add_curve_extra_objects/add_curve_celtic_links.py index c5b581fa..87b778fe 100644 --- a/add_curve_extra_objects/add_curve_celtic_links.py +++ b/add_curve_extra_objects/add_curve_celtic_links.py @@ -122,6 +122,10 @@ class CelticKnotOperator(Operator): layout.prop(self, "geo_bDepth") 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 + # Cache some values s = sin(self.crossing_angle) * self.crossing_strength c = cos(self.crossing_angle) * self.crossing_strength @@ -267,7 +271,11 @@ class CelticKnotOperator(Operator): curve_obj.data.bevel_depth = self.geo_bDepth except: pass - #context.scene.objects.active = orig_obj + + bpy.context.view_layer.objects.active = orig_obj + + # restore pre operator state + bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode return {'FINISHED'} |