[Bf-extensions-cvs] [00805aa] master: update: CurveTools2: fix rewrite loft by batfinger meta-androcto

meta-androcto noreply at git.blender.org
Fri Sep 16 13:44:57 CEST 2016


Commit: 00805aa1f0d8db757f3a3a95151f99667c2697b3
Author: meta-androcto
Date:   Fri Sep 16 21:44:27 2016 +1000
Branches: master
https://developer.blender.org/rBAC00805aa1f0d8db757f3a3a95151f99667c2697b3

update: CurveTools2: fix rewrite loft by batfinger meta-androcto

===================================================================

M	curve_tools/Curves.py
D	curve_tools/Panel.py
M	curve_tools/__init__.py
A	curve_tools/add_curve_simple.py
A	curve_tools/auto_loft.py
A	curve_tools/curve_outline.py

===================================================================

diff --git a/curve_tools/Curves.py b/curve_tools/Curves.py
index 4c46fea..6f74a2b 100644
--- a/curve_tools/Curves.py
+++ b/curve_tools/Curves.py
@@ -20,7 +20,7 @@ class BezierPoint:
         
     def Reversed(self):
         return BezierPoint(self.handle_right, self.co, self.handle_left)
-        
+
     def Reverse(self):
         tmp = self.handle_left
         self.handle_left = self.handle_right
diff --git a/curve_tools/Panel.py b/curve_tools/Panel.py
deleted file mode 100644
index e8d44d5..0000000
--- a/curve_tools/Panel.py
+++ /dev/null
@@ -1,140 +0,0 @@
-import bpy
-
-from . import Operators
-
-
-class Panel(bpy.types.Panel):
-    bl_label = "Curve Tools 2"
-    bl_space_type = "VIEW_3D"
-    bl_region_type = "TOOLS"
-    bl_options = {'DEFAULT_CLOSED'}
-    bl_category = "Addons"
-
-    
-    @classmethod
-    def poll(cls, context):
-        if len(context.selected_objects) > 0:
-            return (context.active_object.type == "CURVE")
-        
-        
-    def draw(self, context):
-        # Z. selection
-        self.layout.label(text = "selection:")
-        boxSelection = self.layout.box()
-        
-        # A.1 curve info/length
-        row = boxSelection.row(align = True)
-        row.operator("curvetools2.operatorselectioninfo", text = "Selection Info")
-        row.prop(context.scene.curvetools, "NrSelectedObjects", text = "")
-        
-        
-        # A. 1 curve
-        self.layout.label(text = "1 curve:")
-        box1Curve = self.layout.box()
-        
-        # A.1 curve info/length
-        row = box1Curve.row(align = True)
-        row.operator("curvetools2.operatorcurveinfo", text = "Curve info")
-
-        row = box1Curve.row(align = True)
-        row.operator("curvetools2.operatorcurvelength", text = "Calc Length")
-        row.prop(context.scene.curvetools, "CurveLength", text = "")
-        
-        # A.2 splines info
-        row = box1Curve.row(align = True)
-        row.operator("curvetools2.operatorsplinesinfo", text = "Curve splines info")
-        
-        # A.3 segments info
-        row = box1Curve.row(align = True)
-        row.operator("curvetools2.operatorsegmentsinfo", text = "Curve segments info")
-        
-        # A.4 origin to spline0start
-        row = box1Curve.row(align = True)
-        row.operator("curvetools2.operatororigintospline0start", text = "Set origin to spline start")
-
-        
-
-        # B. 2 curves
-        self.layout.label(text = "2 curves:")
-        box2Curves = self.layout.box()
-        
-        # B.1 curve intersections
-        boxIntersect = box2Curves.box()
-        
-        row = boxIntersect.row(align = True)
-        row.operator("curvetools2.operatorintersectcurves", text = "Intersect curves")
-
-        row = boxIntersect.row(align = True)
-        row.prop(context.scene.curvetools, "LimitDistance", text = "LimitDistance")
-        #row.active = (context.scene.curvetools.IntersectCurvesAlgorithm == '3D')
-
-        row = boxIntersect.row(align = True)
-        row.prop(context.scene.curvetools, "IntersectCurvesAlgorithm", text = "Algorithm")
-
-        row = boxIntersect.row(align = True)
-        row.prop(context.scene.curvetools, "IntersectCurvesMode", text = "Mode")
-
-        row = boxIntersect.row(align = True)
-        row.prop(context.scene.curvetools, "IntersectCurvesAffect", text = "Affect")
-        
-        
-        # B.2 surface generation
-        boxSurface = box2Curves.box()
-        
-        row = boxSurface.row(align = True)
-        row.operator("curvetools2.operatorloftcurves", text = "Loft curves")
-        
-        row = boxSurface.row(align = True)
-        row.operator("curvetools2.operatorsweepcurves", text = "Sweep curves")
-
-        
-
-        # C. 3 curves
-        self.layout.label(text = "3 curves:")
-        box3Curves = self.layout.box()
-        
-        row = box3Curves.row(align = True)
-        row.operator("curvetools2.operatorbirail", text = "Birail")
-
-        
-        
-        # D. 1 or more curves
-        self.layout.label(text = "1 or more curves:")
-        box1OrMoreCurves = self.layout.box()
-        
-        # D.1 set spline resolution
-        boxSplineRes = box1OrMoreCurves.box()
-        
-        row = boxSplineRes.row(align = True)
-        row.operator("curvetools2.operatorsplinessetresolution", text = "Set resolution")
-        row.prop(context.scene.curvetools, "SplineResolution", text = "")
-        
-        
-        # D.2 remove splines
-        boxSplineRemove = box1OrMoreCurves.box()
-        
-        row = boxSplineRemove.row(align = True)
-        row.operator("curvetools2.operatorsplinesremovezerosegment", text = "Remove 0-segments splines")
-        
-        row = boxSplineRemove.row(align = True)
-        row.operator("curvetools2.operatorsplinesremoveshort", text = "Remove short splines")
-
-        row = boxSplineRemove.row(align = True)
-        row.prop(context.scene.curvetools, "SplineRemoveLength", text = "Threshold remove")
-        
-        
-        # D.3 join splines
-        boxSplineJoin = box1OrMoreCurves.box()
-        
-        row = boxSplineJoin.row(align = True)
-        row.operator("curvetools2.operatorsplinesjoinneighbouring", text = "Join neighbouring splines")
-
-        row = boxSplineJoin.row(align = True)
-        row.prop(context.scene.curvetools, "SplineJoinDistance", text = "Threshold join")
-
-        row = boxSplineJoin.row(align = True)
-        row.prop(context.scene.curvetools, "SplineJoinStartEnd", text = "Only at start & end")
-
-        row = boxSplineJoin.row(align = True)
-        row.prop(context.scene.curvetools, "SplineJoinMode", text = "Join mode")
-        
diff --git a/curve_tools/__init__.py b/curve_tools/__init__.py
index eb4e784..4b7de9d 100644
--- a/curve_tools/__init__.py
+++ b/curve_tools/__init__.py
@@ -17,12 +17,42 @@ from bpy.props import *
 
 from . import Properties
 from . import Operators
-from . import Panel
+from . import auto_loft
+from . import curve_outline
+from . import add_curve_simple
 
+from bpy.types import (
+        AddonPreferences,
+        )
+from bpy.types import Scene, WindowManager
+import sys
 
-    
 def UpdateDummy(object, context):
-    pass
+        scene = context.scene
+        SINGLEDROP = scene.UTSingleDrop
+        DOUBLEDROP = scene.UTDoubleDrop
+        LOFTDROP = scene.UTLoftDrop
+        TRIPLEDROP = scene.UTTripleDrop
+        UTILSDROP = scene.UTUtilsDrop
+
+class SeparateOutline(bpy.types.Operator):
+    """Curve Outliner"""
+    bl_idname = "object.sep_outline"
+    bl_label = "Separate Outline"
+    bl_options = {'REGISTER', 'UNDO'}
+    bl_description = "Makes 'Outline' separate mesh"
+
+    @classmethod
+    def poll(cls, context):
+        return (context.object is not None and
+                context.object.type == 'CURVE')
+
+    def execute(self, context):
+        bpy.ops.object.editmode_toggle()
+        bpy.ops.curve.separate()
+        bpy.ops.object.editmode_toggle()
+
+        return {'FINISHED'}
         
 class CurveTools2Settings(bpy.types.PropertyGroup):
     # selection
@@ -56,11 +86,245 @@ class CurveTools2Settings(bpy.types.PropertyGroup):
 
     intAffectItems = (('Both', 'Both', 'Insert points into both curves'), ('Active', 'Active', 'Insert points into active curve only'), ('Other', 'Other', 'Insert points into other curve only'))
     IntersectCurvesAffect = EnumProperty(items = intAffectItems, name = "IntersectCurvesAffect", description = "Determines which of the selected curves will be affected by the operation", default = 'Both')
+ 
+class CurvePanel(bpy.types.Panel):
+    bl_label = "Curve Tools 2"
+    bl_space_type = "VIEW_3D"
+    bl_region_type = "TOOLS"
+    bl_options = {'DEFAULT_CLOSED'}
+    bl_category = "Tools"
+
     
+    @classmethod
+    def poll(cls, context):
+        if len(context.selected_objects) > 0:
+            return (context.active_object.type == "CURVE")
+        
+    def draw(self, context):
+        scene = context.scene
+        SINGLEDROP = scene.UTSingleDrop
+        DOUBLEDROP = scene.UTDoubleDrop
+        LOFTDROP = scene.UTLoftDrop
+        TRIPLEDROP = scene.UTTripleDrop
+        UTILSDROP = scene.UTUtilsDrop
+        view = context.space_data
+        layout = self.layout
+
+        # Object Creation
+        box1 = self.layout.box()
+        col = box1.column(align=True)
+        row = col.row(align=True)
+        row.menu("INFO_MT_simple_menu", icon="OBJECT_DATAMODE")
+
+        # Z. selection
+        boxSelection = self.layout.box()
+        row = boxSelection.row(align = True)
+        row.operator("curvetools2.operatorselectioninfo", text = "Selection Info")
+        row.prop(context.scene.curvetools, "NrSelectedObjects", text = "")
+
+        # Single Curve options
+        box1 = self.layout.box()
+        col = box1.column(align=True)
+        row = col.row(align=True)
+        row.prop(scene, "UTSingleDrop", icon="TRIA_DOWN")
+        if SINGLEDROP:
+        # A. 1 curve
+            row = col.row(align=True)
+            row.label(text="Single Curve:")
+            row = col.row(align=True)
+        
+        # A.1 curve info/length
+            row.operator("curvetools2.operatorcurveinfo", text = "Curve info")
+            row = col.row(align=True)
+            row.operator("curvetools2.operatorcurvelength", text = "Calc Length")
+            row.prop(context.scene.curvetools, "CurveLength", text = "")
+        
+        # A.2 splines info
+            row = col.row(align=True)
+            row.operator("curvetools2.operatorsplinesinfo", text = "Curve splines info")
+        
+        # A.3 segments info
+            row = col.row(align=True)
+            row.operator("curvetools2.operatorsegmentsinfo", text = "Curve segments info")
+        
+        # A.4 origin to spline0start
+            row = col.row(align=True)
+            row.operator("curvetools2.operatororigintospline0start", text = "Set origin to spline start")
+
+
+        # Double Curve options
+        box2 = self.layout.box()
+        col = box2.column(align=True)
+        row = col.row(align=True)
+        row.prop(scene, "UTDoubleDrop", icon="TRIA_DOWN")
+        if DOUBLEDROP:
+        # B. 2 curves
+            row = col.row(

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list