[Bf-extensions-cvs] [bd54740e] master: Fix T74493 and D7045. Redesign.
Vladimir Spivakcwolf3d
noreply at git.blender.org
Thu Mar 12 03:11:12 CET 2020
Commit: bd54740ed08be078a870fcb3d83c7bd4ad304d43
Author: Vladimir Spivak(cwolf3d)
Date: Thu Mar 12 04:10:42 2020 +0200
Branches: master
https://developer.blender.org/rBAbd54740ed08be078a870fcb3d83c7bd4ad304d43
Fix T74493 and D7045. Redesign.
===================================================================
M curve_tools/__init__.py
M curve_tools/cad.py
M curve_tools/curves.py
M curve_tools/internal.py
M curve_tools/intersections.py
M curve_tools/operators.py
M curve_tools/toolpath.py
===================================================================
diff --git a/curve_tools/__init__.py b/curve_tools/__init__.py
index 2fcec1d9..4a9d283c 100644
--- a/curve_tools/__init__.py
+++ b/curve_tools/__init__.py
@@ -25,7 +25,7 @@ bl_info = {
"name": "Curve Tools",
"description": "Adds some functionality for bezier/nurbs curve/surface modeling",
"author": "Mackraken",
- "version": (0, 4, 3),
+ "version": (0, 4, 4),
"blender": (2, 80, 0),
"location": "View3D > Tool Shelf > Edit Tab",
"warning": "WIP",
@@ -128,13 +128,13 @@ class curvetoolsSettings(PropertyGroup):
description="Only join splines at the starting point of one and the ending point of the other"
)
splineJoinModeItems = (
- ('At midpoint', 'At midpoint', 'Join splines at midpoint of neighbouring points'),
- ('Insert segment', 'Insert segment', 'Insert segment between neighbouring points')
+ ('At_midpoint', 'At midpoint', 'Join splines at midpoint of neighbouring points'),
+ ('Insert_segment', 'Insert segment', 'Insert segment between neighbouring points')
)
SplineJoinMode: EnumProperty(
items=splineJoinModeItems,
name="SplineJoinMode",
- default='At midpoint',
+ default='At_midpoint',
description="Determines how the splines will be joined"
)
# curve intersection
@@ -147,7 +147,7 @@ class curvetoolsSettings(PropertyGroup):
intAlgorithmItems = (
('3D', '3D', 'Detect where curves intersect in 3D'),
- ('From View', 'From View', 'Detect where curves intersect in the RegionView3D')
+ ('From_View', 'From View', 'Detect where curves intersect in the RegionView3D')
)
IntersectCurvesAlgorithm: EnumProperty(
items=intAlgorithmItems,
@@ -229,227 +229,223 @@ class curvetoolsSettings(PropertyGroup):
)
-class VIEW3D_PT_CurvePanel(Panel):
- bl_label = "Curve Tools"
+# Curve Info
+class VIEW3D_PT_curve_tools_info(Panel):
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
+ bl_category = "Curve Edit"
+ bl_label = "Curve Info"
bl_options = {'DEFAULT_CLOSED'}
- bl_category = "Edit"
- @classmethod
- def poll(cls, context):
- return context.scene is not None
+ def draw(self, context):
+ scene = context.scene
+ layout = self.layout
+
+ col = layout.column(align=True)
+ col.operator("curvetools.operatorcurveinfo", text="Curve")
+ row = col.row(align=True)
+ row.operator("curvetools.operatorsplinesinfo", text="Spline")
+ row.operator("curvetools.operatorsegmentsinfo", text="Segment")
+ row = col.row(align=True)
+ row.operator("curvetools.operatorcurvelength", icon = "DRIVER_DISTANCE", text="Length")
+ row.prop(context.scene.curvetools, "CurveLength", text="")
+
+# Curve Edit
+class VIEW3D_PT_curve_tools_edit(Panel):
+ bl_space_type = "VIEW_3D"
+ bl_region_type = "UI"
+ bl_category = "Curve Edit"
+ bl_label = "Curve Edit"
+
def draw(self, context):
scene = context.scene
- SINGLEDROP = scene.UTSingleDrop
- MOREDROP = scene.UTMOREDROP
- LOFTDROP = scene.UTLoftDrop
- ADVANCEDDROP = scene.UTAdvancedDrop
- EXTENDEDDROP = scene.UTExtendedDrop
- UTILSDROP = scene.UTUtilsDrop
layout = self.layout
- # Single Curve options
- box1 = self.layout.box()
- col = box1.column(align=True)
+ col = layout.column(align=True)
+ col.operator("curvetools.bezier_points_fillet", text='Fillet/Chamfer')
row = col.row(align=True)
- row.prop(scene, "UTSingleDrop", icon="TRIA_DOWN")
- if SINGLEDROP:
- # A. 1 curve
- row = col.row(align=True)
-
- # A.1 curve info/length
- row.operator("curvetools.operatorcurveinfo", text="Curve info")
- row = col.row(align=True)
- row.operator("curvetools.operatorcurvelength", text="Calc Length")
- row.prop(context.scene.curvetools, "CurveLength", text="")
-
- # A.2 splines info
- row = col.row(align=True)
- row.operator("curvetools.operatorsplinesinfo", text="Curve splines info")
-
- # A.3 segments info
- row = col.row(align=True)
- row.operator("curvetools.operatorsegmentsinfo", text="Curve segments info")
-
- # A.4 origin to spline0start
- row = col.row(align=True)
- row.operator("curvetools.operatororigintospline0start", text="Set origin to spline start")
-
- # Double Curve options
- box2 = self.layout.box()
- col = box2.column(align=True)
+ row.operator("curvetools.outline", text="Outline")
+ row.operator("curvetools.add_toolpath_offset_curve", text="Recursive Offset")
+ col.operator("curvetools.sep_outline", text="Separate Offset/Selected")
+ col.operator("curvetools.bezier_cad_handle_projection", text='Extend Handles')
+ col.operator("curvetools.bezier_cad_boolean", text="Boolean Splines")
row = col.row(align=True)
- row.prop(scene, "UTMOREDROP", icon="TRIA_DOWN")
+ row.operator("curvetools.bezier_spline_divide", text='Subdivide')
+ row.operator("curvetools.bezier_cad_subdivide", text="Multi Subdivide")
+
+ col.operator("curvetools.split", text='Split at Vertex')
+ col.operator("curvetools.add_toolpath_discretize_curve", text="Discretize Curve")
+ col.operator("curvetools.bezier_cad_array", text="Array Splines")
+
+# Curve Intersect
+class VIEW3D_PT_curve_tools_intersect(Panel):
+ bl_space_type = "VIEW_3D"
+ bl_region_type = "UI"
+ bl_category = "Curve Edit"
+ bl_label = "Intersect"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ def draw(self, context):
+ scene = context.scene
+ layout = self.layout
+
+ col = layout.column(align=True)
+ col.operator("curvetools.bezier_curve_boolean", text="2D Curve Boolean")
+ col.operator("curvetools.operatorintersectcurves", text="Intersect Curves")
+ col.prop(context.scene.curvetools, "LimitDistance", text="Limit Distance")
+ col.prop(context.scene.curvetools, "IntersectCurvesAlgorithm", text="Algorithm")
+ col.prop(context.scene.curvetools, "IntersectCurvesMode", text="Mode")
+ col.prop(context.scene.curvetools, "IntersectCurvesAffect", text="Affect")
- if MOREDROP:
- # B. 2 curves
- row = col.row(align=True)
+# Curve Surfaces
+class VIEW3D_PT_curve_tools_surfaces(Panel):
+ bl_space_type = "VIEW_3D"
+ bl_region_type = "UI"
+ bl_category = "Curve Edit"
+ bl_label = "Surfaces"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ def draw(self, context):
+ wm = context.window_manager
+ scene = context.scene
+ layout = self.layout
- # B.1 curve intersections
- row = col.row(align=True)
- row.operator("curvetools.operatorintersectcurves", text="Intersect curves")
+ col = layout.column(align=True)
+ col.operator("curvetools.operatorbirail", text="Birail")
+ col.operator("curvetools.convert_bezier_to_surface", text="Convert Bezier to Surface")
+ col.operator("curvetools.convert_selected_face_to_bezier", text="Convert Faces to Bezier")
- row = col.row(align=True)
- row.prop(context.scene.curvetools, "LimitDistance", text="LimitDistance")
+# Curve Path Finder
+class VIEW3D_PT_curve_tools_loft(Panel):
+ bl_space_type = "VIEW_3D"
+ bl_region_type = "UI"
+ bl_category = "Curve Edit"
+ bl_parent_id = "VIEW3D_PT_curve_tools_surfaces"
+ bl_label = "Loft"
+ bl_options = {'DEFAULT_CLOSED'}
- row = col.row(align=True)
- row.prop(context.scene.curvetools, "IntersectCurvesAlgorithm", text="Algorithm")
+ def draw(self, context):
+ wm = context.window_manager
+ scene = context.scene
+ layout = self.layout
- row = col.row(align=True)
- row.prop(context.scene.curvetools, "IntersectCurvesMode", text="Mode")
+ col = layout.column(align=True)
+ col.operator("curvetools.create_auto_loft")
+ lofters = [o for o in scene.objects if "autoloft" in o.keys()]
+ for o in lofters:
+ col.label(text=o.name)
+ # layout.prop(o, '["autoloft"]', toggle=True)
+ col.prop(wm, "auto_loft", toggle=True)
+ col.operator("curvetools.update_auto_loft_curves")
+ col = layout.column(align=True)
- row = col.row(align=True)
- row.prop(context.scene.curvetools, "IntersectCurvesAffect", text="Affect")
- # Loft options
- box1 = self.layout.box()
- col = box1.column(align=True)
+# Curve Sanitize
+class VIEW3D_PT_curve_tools_sanitize(Panel):
+ bl_space_type = "VIEW_3D"
+ bl_region_type = "UI"
+ bl_category = "Curve Edit"
+ bl_label = "Sanitize"
+ bl_options = {'DEFAULT_CLOSED'}
+
+ def draw(self, context):
+ scene = context.scene
+ layout = self.layout
+
+ col = layout.column(align=True)
+ col.operator("curvetools.operatororigintospline0start", icon = "OBJECT_ORIGIN", text="Set Origin to Spline Start")
+ col.operator("curvetools.scale_reset", text='Reset Scale')
+
+ col.label(text="Cleanup:")
+ col.operator("curvetools.remove_doubles", icon = "TRASH", text='Remove Doubles')
+ col.operator("curvetools.operatorsplinesremovezerosegment", icon = "TRASH", text="0-Segment Splines")
+ row = col.row(align=True)
+ row.operator("curvetools.operatorsplinesremoveshort", text="Short Splines")
+ row.prop(context.scene.curvetools, "SplineRemoveLength", text="Threshold remove")
+
+ col.label(text="Join Splines:")
+ col.operator("curvetools.operatorsplinesjoinneighbouring", text="Join Neighbouring Splines")
row = col.row(align=True)
- row.prop(scene, "UTLoftDrop", icon="TRIA_DOWN")
-
- if LOFTDROP:
- # B.2 surface generation
- wm = context.window_manager
- scene = context.scene
- layout = self.layout
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list