diff --git a/add_curve_extra_objects/add_curve_aceous_galore.py b/add_curve_extra_objects/add_curve_aceous_galore.py index 95d38902c322d91806af7c146574d951901c0000..c27d26ddbd6d371539fe84653039546d58cfb598 100644 --- a/add_curve_extra_objects/add_curve_aceous_galore.py +++ b/add_curve_extra_objects/add_curve_aceous_galore.py @@ -1300,6 +1300,13 @@ class Curveaceous_galore(Operator, object_utils.AddObjectHelper): min=0, description="Random Seed" ) + + edit_mode : BoolProperty( + name="Show in edit mode", + default=True, + description="Show in edit mode" + ) + # Line properties startlocation : FloatVectorProperty( name="", @@ -1448,6 +1455,9 @@ class Curveaceous_galore(Operator, object_utils.AddObjectHelper): col = layout.column() col.row().prop(self, "use_cyclic_u", expand=True) + col = layout.column() + col.row().prop(self, "edit_mode", expand=True) + box = layout.box() box.label(text="Location:") box.prop(self, "startlocation") @@ -1473,6 +1483,11 @@ class Curveaceous_galore(Operator, object_utils.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'} diff --git a/add_curve_extra_objects/add_curve_braid.py b/add_curve_extra_objects/add_curve_braid.py index 16e072d4b4e04edc05959da25dd90d74c604a985..ae250682138f96de6118430221c9ebf4ef7d1638 100644 --- a/add_curve_extra_objects/add_curve_braid.py +++ b/add_curve_extra_objects/add_curve_braid.py @@ -204,6 +204,11 @@ class Braid(Operator): description="Switch between round and sharp corners", default=False ) + edit_mode : BoolProperty( + name="Show in edit mode", + default=True, + description="Show in edit mode" + ) def draw(self, context): layout = self.layout @@ -227,6 +232,9 @@ class Braid(Operator): col.label(text="Geometry Options:") col.prop(self, "strandsize") col.prop(self, "resolution") + + col = layout.column() + col.row().prop(self, "edit_mode", expand=True) def execute(self, context): # turn off 'Enter Edit Mode' @@ -257,6 +265,11 @@ class Braid(Operator): # 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'} diff --git a/add_curve_extra_objects/add_curve_curly.py b/add_curve_extra_objects/add_curve_curly.py index b5243766b4842b87006e4ee0131bd50a8c271e39..1ac7634179f8dcd139dcd431e6a4c41232a4b3b6 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'} diff --git a/add_curve_extra_objects/add_curve_simple.py b/add_curve_extra_objects/add_curve_simple.py index 129f66bf716635bd1d8f816fabc42a9c3fc26c38..e0dc28077d3d78a1b917802d16cb96ee55650d41 100644 --- a/add_curve_extra_objects/add_curve_simple.py +++ b/add_curve_extra_objects/add_curve_simple.py @@ -675,6 +675,8 @@ def main(context, self, align_matrix, use_enter_edit_mode): p1.handle_right = v1 p2.handle_left = v2 i += 1 + all_points[0].handle_left_type = 'VECTOR' + all_points[-1].handle_right_type = 'VECTOR' if self.Simple_Type == 'Sector': i = 0 @@ -713,6 +715,10 @@ def main(context, self, align_matrix, use_enter_edit_mode): p1.handle_right = v1 p2.handle_left = v2 i += 1 + all_points[0].handle_left_type = 'VECTOR' + all_points[0].handle_right_type = 'VECTOR' + all_points[1].handle_left_type = 'VECTOR' + all_points[-1].handle_right_type = 'VECTOR' if self.Simple_Type == 'Segment': i = 0 @@ -1066,6 +1072,11 @@ class Simple(Operator, object_utils.AddObjectHelper): ('VECTOR', "Vector", "Vector type Bezier handles"), ('AUTO', "Auto", "Automatic type Bezier handles")] ) + edit_mode : BoolProperty( + name="Show in edit mode", + default=True, + description="Show in edit mode" + ) def draw(self, context): layout = self.layout @@ -1255,6 +1266,9 @@ class Simple(Operator, object_utils.AddObjectHelper): col = layout.column() col.row().prop(self, "use_cyclic_u", expand=True) + col = layout.column() + col.row().prop(self, "edit_mode", expand=True) + box = layout.box() box.label(text="Location:") box.prop(self, "Simple_startlocation") @@ -1291,6 +1305,11 @@ class Simple(Operator, object_utils.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'} diff --git a/add_curve_extra_objects/add_curve_spirals.py b/add_curve_extra_objects/add_curve_spirals.py index c669642f6d09c3897741816c827cdaba424be52f..e916fbe575ca4b86c4e4137366ab3dad21e9152b 100644 --- a/add_curve_extra_objects/add_curve_spirals.py +++ b/add_curve_extra_objects/add_curve_spirals.py @@ -430,6 +430,11 @@ class CURVE_OT_spirals(Operator): ('VECTOR', "Vector", "Vector type Bezier handles"), ('AUTO', "Auto", "Automatic type Bezier handles")] ) + edit_mode : BoolProperty( + name="Show in edit mode", + default=True, + description="Show in edit mode" + ) startlocation : FloatVectorProperty( name="", description="Start location", @@ -521,6 +526,9 @@ class CURVE_OT_spirals(Operator): col = layout.column() col.row().prop(self, "use_cyclic_u", expand=True) + + col = layout.column() + col.row().prop(self, "edit_mode", expand=True) box = layout.box() box.label(text="Location:") @@ -547,6 +555,11 @@ class CURVE_OT_spirals(Operator): # 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') #self.report({'INFO'}, #"Drawing Spiral Finished: %.4f sec" % (time.time() - time_start)) diff --git a/add_curve_extra_objects/add_curve_torus_knots.py b/add_curve_extra_objects/add_curve_torus_knots.py index 29c61011a3c21f189c28d6ca586eedadba81fea4..952074930eb989eb4ca41976555a80f274df19c3 100644 --- a/add_curve_extra_objects/add_curve_torus_knots.py +++ b/add_curve_extra_objects/add_curve_torus_knots.py @@ -562,6 +562,11 @@ class torus_knot_plus(Operator, AddObjectHelper): default=False, description="Auto adjust curve resolution based on TK length", ) + edit_mode : BoolProperty( + name="Show in edit mode", + default=True, + description="Show in edit mode" + ) def draw(self, context): layout = self.layout @@ -664,6 +669,9 @@ class torus_knot_plus(Operator, AddObjectHelper): box.prop(self, "colorSet") box.prop(self, "random_colors") box.prop(self, "saturation") + + col = layout.column() + col.row().prop(self, "edit_mode", expand=True) # TRANSFORM options col = layout.column() @@ -720,6 +728,11 @@ class torus_knot_plus(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'} def invoke(self, context, event): diff --git a/add_curve_extra_objects/beveltaper_curve.py b/add_curve_extra_objects/beveltaper_curve.py index 948afa5fb9c3ab560e69a4ab05d75b75119da4ed..d3cc4a9352ff85033d80079ba7f73bd9c7091fa0 100644 --- a/add_curve_extra_objects/beveltaper_curve.py +++ b/add_curve_extra_objects/beveltaper_curve.py @@ -275,6 +275,11 @@ class add_tapercurve(Operator): default=1, description="Difference between ends and center while linked" ) + edit_mode : BoolProperty( + name="Show in edit mode", + default=True, + description="Show in edit mode" + ) @classmethod def poll(cls, context): @@ -308,6 +313,9 @@ class add_tapercurve(Operator): col_sub.active = self.link2 row.prop(self, "link2", toggle=True, text="", icon="LINKED") col_sub.prop(self, "diff") + + col = layout.column() + col.row().prop(self, "edit_mode", expand=True) def execute(self, context): if self.link1: @@ -317,6 +325,11 @@ class add_tapercurve(Operator): self.scale_ends2 = self.scale_ends1 = self.scale_mid - self.diff add_taper(self, context) + + if self.edit_mode: + bpy.ops.object.mode_set(mode = 'EDIT') + else: + bpy.ops.object.mode_set(mode = 'OBJECT') return {'FINISHED'} @@ -349,6 +362,11 @@ class add_bevelcurve(Operator, AddObjectHelper): description="Link the Scale on X/Y axis", default=True ) + edit_mode : BoolProperty( + name="Show in edit mode", + default=True, + description="Show in edit mode" + ) @classmethod def poll(cls, context): @@ -376,6 +394,9 @@ class add_bevelcurve(Operator, AddObjectHelper): col.prop(self, "scale_y") row.prop(self, "link", toggle=True, text="", icon="LINKED") + col = layout.column() + col.row().prop(self, "edit_mode", expand=True) + def execute(self, context): if self.link: self.scale_y = self.scale_x @@ -389,6 +410,11 @@ class add_bevelcurve(Operator, AddObjectHelper): add_type4(self, context) if self.types == 5: add_type5(self, context) + + if self.edit_mode: + bpy.ops.object.mode_set(mode = 'EDIT') + else: + bpy.ops.object.mode_set(mode = 'OBJECT') return {'FINISHED'}