diff options
author | Spivak Vladimir (cwolf3d) <cwolf3d@gmail.com> | 2019-10-11 03:38:17 +0300 |
---|---|---|
committer | Spivak Vladimir (cwolf3d) <cwolf3d@gmail.com> | 2019-10-11 03:38:17 +0300 |
commit | ef40e0daf220d24e6e91f3d6b7f4272ffb4d7546 (patch) | |
tree | 1e1ba22386be013d380d494ef9be2fe4c2fb942a /add_curve_extra_objects/add_curve_curly.py | |
parent | 04f482c5aa48a1b04a429dafba3e09f7287b9110 (diff) |
Addon: Add Curve: Extra Objects: Added switch to display in edit mode by create object
Diffstat (limited to 'add_curve_extra_objects/add_curve_curly.py')
-rw-r--r-- | add_curve_extra_objects/add_curve_curly.py | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/add_curve_extra_objects/add_curve_curly.py b/add_curve_extra_objects/add_curve_curly.py index b5243766..1ac76341 100644 --- a/add_curve_extra_objects/add_curve_curly.py +++ b/add_curve_extra_objects/add_curve_curly.py @@ -17,6 +17,7 @@ bl_info = { import bpy from bpy.types import Operator from bpy.props import ( + BoolProperty, FloatProperty, EnumProperty, IntProperty, @@ -486,17 +487,17 @@ class add_curlycurve(Operator, AddObjectHelper): ('3D', "3D", "3D") ] ) + + edit_mode : BoolProperty( + name="Show in edit mode", + default=True, + description="Show in edit mode" + ) def draw(self, context): layout = self.layout col = layout.column(align=True) - # AddObjectHelper props - col.prop(self, "align") - col.prop(self, "location") - col.prop(self, "rotation") - - col = layout.column() col.label(text = "Curve:") col.prop(self, "types") @@ -507,6 +508,15 @@ class add_curlycurve(Operator, AddObjectHelper): row = layout.row() row.prop(self, "shape", expand=True) + + col = layout.column(align=True) + col.row().prop(self, "edit_mode", expand=True) + + col = layout.column(align=True) + # AddObjectHelper props + col.prop(self, "align") + col.prop(self, "location") + col.prop(self, "rotation") def execute(self, context): # turn off 'Enter Edit Mode' @@ -540,6 +550,11 @@ class add_curlycurve(Operator, AddObjectHelper): # restore pre operator state bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode + if self.edit_mode: + bpy.ops.object.mode_set(mode = 'EDIT') + else: + bpy.ops.object.mode_set(mode = 'OBJECT') + return {'FINISHED'} |