[Bf-extensions-cvs] [ef40e0da] master: Addon: Add Curve: Extra Objects: Added switch to display in edit mode by create object
Spivak Vladimir cwolf3d
noreply at git.blender.org
Fri Oct 11 02:39:01 CEST 2019
Commit: ef40e0daf220d24e6e91f3d6b7f4272ffb4d7546
Author: Spivak Vladimir (cwolf3d)
Date: Fri Oct 11 03:38:17 2019 +0300
Branches: master
https://developer.blender.org/rBAef40e0daf220d24e6e91f3d6b7f4272ffb4d7546
Addon: Add Curve: Extra Objects: Added switch to display in edit mode by create object
===================================================================
M add_curve_extra_objects/add_curve_aceous_galore.py
M add_curve_extra_objects/add_curve_braid.py
M add_curve_extra_objects/add_curve_curly.py
M add_curve_extra_objects/add_curve_simple.py
M add_curve_extra_objects/add_curve_spirals.py
M add_curve_extra_objects/add_curve_torus_knots.py
M add_curve_extra_objects/beveltaper_curve.py
===================================================================
diff --git a/add_curve_extra_objects/add_curve_aceous_galore.py b/add_curve_extra_objects/add_curve_aceous_galore.py
index 95d38902..c27d26dd 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 16e072d4..ae250682 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 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'}
diff --git a/add_curve_extra_objects/add_curve_simple.py b/add_curve_extra_objects/add_curve_simple.py
index 129f66bf..e0dc2807 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 c669642f..e916fbe5 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 29c61011..95207493 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 948afa5f..d3cc4a93 100644
--- a/add_curve_extra_objects/beveltaper_curve.py
+++ b/add_curve_extra_objects/beveltaper_curve.py
@@ -275,6 +275,11 @@ class add_tapercurve(Op
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list