[Bf-extensions-cvs] [fcf5f28] master: Update add curve extra objects Re: T50943

meta-androcto noreply at git.blender.org
Fri Mar 17 04:46:35 CET 2017


Commit: fcf5f2842a836006aa5fb4a0fe037a3ff49fff97
Author: meta-androcto
Date:   Fri Mar 17 14:46:03 2017 +1100
Branches: master
https://developer.blender.org/rBAfcf5f2842a836006aa5fb4a0fe037a3ff49fff97

Update add curve extra objects Re: T50943

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

M	add_curve_extra_objects/__init__.py
M	add_curve_extra_objects/add_curve_aceous_galore.py
A	add_curve_extra_objects/add_curve_braid.py
A	add_curve_extra_objects/add_curve_celtic_links.py
A	add_curve_extra_objects/add_curve_curly.py
A	add_curve_extra_objects/add_curve_simple.py
A	add_curve_extra_objects/beveltaper_curve.py
A	add_curve_extra_objects/bpybraid.py
A	add_curve_extra_objects/braid.py

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

diff --git a/add_curve_extra_objects/__init__.py b/add_curve_extra_objects/__init__.py
index 65a3a41..ffa0493 100644
--- a/add_curve_extra_objects/__init__.py
+++ b/add_curve_extra_objects/__init__.py
@@ -17,6 +17,7 @@
 # ##### END GPL LICENSE BLOCK #####
 # Contributed to by
 # testscreenings, Alejandro Omar Chocano Vasquez, Jimmy Hazevoet, meta-androcto #
+# Cmomoney, Jared Forsyth, Adam Newgas, Spivak Vladimir
 
 bl_info = {
     "name": "Extra Objects",
@@ -37,12 +38,22 @@ if "bpy" in locals():
     importlib.reload(add_curve_spirals)
     importlib.reload(add_curve_torus_knots)
     importlib.reload(add_surface_plane_cone)
+    importlib.reload(add_curve_curly)
+    importlib.reload(beveltaper_curve)
+    importlib.reload(add_curve_celtic_links)
+    importlib.reload(add_curve_braid)
+    importlib.reload(add_curve_simple)
 
 else:
     from . import add_curve_aceous_galore
     from . import add_curve_spirals
     from . import add_curve_torus_knots
     from . import add_surface_plane_cone
+    from . import add_curve_curly
+    from . import beveltaper_curve
+    from . import add_curve_celtic_links
+    from . import add_curve_braid
+    from . import add_curve_simple
 
 import bpy
 from bpy.types import Menu, AddonPreferences
@@ -131,24 +142,22 @@ class CurveExtraObjectsAddonPreferences(AddonPreferences):
         else:
             layout.prop(self, "update_spiral_presets")
 
-
-# TODO check if this is even used.
-class INFO_MT_curve_extras_add(Menu):
+class INFO_MT_curve_knots_add1(bpy.types.Menu):
     # Define the "Extras" menu
-    bl_idname = "curve_extra_objects_add"
-    bl_label = "Extra Objects"
+    bl_idname = "curve_knots_add"
+    bl_label = "Plants"
 
     def draw(self, context):
         layout = self.layout
         layout.operator_context = 'INVOKE_REGION_WIN'
-        layout.operator_menu_enum("mesh.curveaceous_galore",
-                             "ProfileType",
-                            )
-        layout.operator_menu_enum("curve.spirals",
-                             "spiral_type",
-                             icon='FORCE_VORTEX')
         layout.operator("curve.torus_knot_plus",
-            text="Torus Knot Plus")
+                        text="Torus Knot Plus")
+        layout.operator("curve.celtic_links",
+                        text="Celtic Links")
+        layout.operator("mesh.add_braid",
+                        text="Braid Knot")
+ 
+
 
 # Define "Extras" menus
 def menu_func(self, context):
@@ -156,14 +165,19 @@ def menu_func(self, context):
         # fix in D2142 will allow to work in EDIT_CURVE
         return None
     layout = self.layout
-    layout.separator()
+
     layout.operator_menu_enum("mesh.curveaceous_galore",
                          "ProfileType",
-                        )
+                         icon='CURVE_DATA')
     layout.operator_menu_enum("curve.spirals",
                          "spiral_type",
-                          icon='FORCE_VORTEX')
-    layout.operator("curve.torus_knot_plus", text="Torus Knot Plus")
+                         icon='CURVE_DATA')
+    layout.separator()
+    layout.menu("curve_knots_add", text="Knots", icon='CURVE_DATA')
+    layout.separator()
+    layout.operator("curve.curlycurve", text="Curly Curve", icon='CURVE_DATA')
+    layout.menu("OBJECT_MT_bevel_taper_curve_menu", text="Bevel/Taper", icon='CURVE_DATA')
+
 
 def menu_surface(self, context):
     layout = self.layout
@@ -177,6 +191,7 @@ def menu_surface(self, context):
         self.layout.operator("object.add_surface_plane", text="Plane", icon="MOD_CURVE")
 
 def register():
+    add_curve_simple.register()
     bpy.utils.register_module(__name__)
 
     # Add "Extras" menu to the "Add Curve" menu
@@ -185,12 +200,14 @@ def register():
     bpy.types.INFO_MT_surface_add.append(menu_surface)
 
 def unregister():
-    bpy.utils.unregister_module(__name__)
 
+    add_curve_simple.unregister()
     # Remove "Extras" menu from the "Add Curve" menu.
     bpy.types.INFO_MT_curve_add.remove(menu_func)
     # Remove "Extras" menu from the "Add Surface" menu.
     bpy.types.INFO_MT_surface_add.remove(menu_surface)
 
+    bpy.utils.unregister_module(__name__)
+
 if __name__ == "__main__":
     register()
diff --git a/add_curve_extra_objects/add_curve_aceous_galore.py b/add_curve_extra_objects/add_curve_aceous_galore.py
index 259660f..6a7ac65 100644
--- a/add_curve_extra_objects/add_curve_aceous_galore.py
+++ b/add_curve_extra_objects/add_curve_aceous_galore.py
@@ -20,7 +20,7 @@ bl_info = {
     "name": "Curveaceous Galore!",
     "author": "Jimmy Hazevoet, testscreenings",
     "version": (0, 2),
-    "blender": (2, 59, 0),
+    "blender": (2, 59),
     "location": "View3D > Add > Curve",
     "description": "Adds many different types of Curves",
     "warning": "", # used for warning icon and text in addons panel
@@ -193,61 +193,81 @@ def ProfileCurve(type=0, a=0.25, b=0.25):
     return newpoints
 
 # ------------------------------------------------------------
-# 2DCurve: Miscellaneous.: Diamond, Arrow1, Arrow2, Square, ....
-def MiscCurve(type=1, a=1.0, b=0.5, c=1.0):
+# 2DCurve: Arrows
+def ArrowCurve(type=1, a=1.0, b=0.5):
     """
-    MiscCurve( type=1, a=1.0, b=0.5, c=1.0 )
+    ArrowCurve( type=1, a=1.0, b=0.5, c=1.0 )
 
-    Create miscellaneous curves
+    Create arrow curves
 
         Parameters:
-            type - select type, Diamond, Arrow1, Arrow2, Square
+            type - select type, Arrow1, Arrow2
                 (type=int)
             a - a scaling parameter
                 (type=float)
             b - b scaling parameter
                 (type=float)
-            c - c scaling parameter
-                (type=float)
-                doesn't seem to do anything
         Returns:
             a list with lists of x,y,z coordinates for curve points, [[x,y,z],[x,y,z],...n]
             (type=list)
     """
 
     newpoints = []
-    a *= 0.5
-    b *= 0.5
-    if type == 1:
-        # diamond:
-        newpoints = [[0.0, b, 0.0], [a, 0.0, 0.0], [0.0, -b, 0.0], [-a, 0.0, 0.0]]
-    elif type == 2:
+    if type == 0:
         # Arrow1:
-        newpoints = [[-a, b, 0.0], [a, 0.0, 0.0], [-a, -b, 0.0], [0.0, 0.0, 0.0]]
-    elif type == 3:
-        # Arrow2:
+        a *= 0.5
+        b *= 0.5
         newpoints = [[-1.0, b, 0.0], [-1.0+a, b, 0.0],
         [-1.0+a, 1.0, 0.0], [1.0, 0.0, 0.0],
             [-1.0+a, -1.0, 0.0], [-1.0+a, -b, 0.0],
             [-1.0, -b, 0.0]]
-    elif type == 4:
-        # Rounded square:
+    elif type == 1:
+        # Arrow2:
+        newpoints = [[-a, b, 0.0], [a, 0.0, 0.0], [-a, -b, 0.0], [0.0, 0.0, 0.0]]
+    else:
+        # diamond:
+        newpoints = [[0.0, b, 0.0], [a, 0.0, 0.0], [0.0, -b, 0.0], [-a, 0.0, 0.0]]
+    return newpoints
+
+# ------------------------------------------------------------
+# 2DCurve: Square / Rectangle
+def RectCurve(type=1, a=1.0, b=0.5, c=1.0):
+    """
+    RectCurve( type=1, a=1.0, b=0.5, c=1.0 )
+
+    Create square / rectangle curves
+
+        Parameters:
+            type - select type, Square, Rounded square 1, Rounded square 2
+                (type=int)
+            a - a scaling parameter
+                (type=float)
+            b - b scaling parameter
+                (type=float)
+            c - c scaling parameter
+                (type=float)
+        Returns:
+            a list with lists of x,y,z coordinates for curve points, [[x,y,z],[x,y,z],...n]
+            (type=list)
+    """
+
+    newpoints = []
+    if type == 1:
+        # Rounded Rectangle:
         newpoints = [[-a, b-b*0.2, 0.0], [-a+a*0.05, b-b*0.05, 0.0], [-a+a*0.2, b, 0.0],
         [a-a*0.2, b, 0.0], [a-a*0.05, b-b*0.05, 0.0], [a, b-b*0.2, 0.0],
             [a, -b+b*0.2, 0.0], [a-a*0.05, -b+b*0.05, 0.0], [a-a*0.2, -b, 0.0],
             [-a+a*0.2, -b, 0.0], [-a+a*0.05, -b+b*0.05, 0.0], [-a, -b+b*0.2, 0.0]]
-    elif type == 5:
+    elif type == 2:
         # Rounded Rectangle II:
         newpoints = []
-        x = a / 2
-        y = b / 2
-        r = c / 2
-
+        x = a
+        y = b
+        r = c
         if r > x:
             r = x - 0.0001
         if r > y:
             r = y - 0.0001
-
         if r > 0:
             newpoints.append([-x+r, y, 0])
             newpoints.append([x-r, y, 0])
@@ -262,9 +282,8 @@ def MiscCurve(type=1, a=1.0, b=0.5, c=1.0):
             newpoints.append([x, y, 0])
             newpoints.append([x, -y, 0])
             newpoints.append([-x, -y, 0])
-
     else:
-        # Square:
+        # Rectangle:
         newpoints = [[-a, b, 0.0], [a, b, 0.0], [a, -b, 0.0], [-a, -b, 0.0]]
     return newpoints
 
@@ -567,47 +586,116 @@ def HelixCurve(number=100, height=2.0, startangle=0.0, endangle=360.0, width=1.0
         i += 1
     return newpoints
 
-# ------------------------------------------------------------ ?
-# 3DCurve: Cycloid: Cycloid, Epicycloid, Hypocycloid
-def CycloidCurve(number=24, length=2.0, type=0, a=1.0, b=1.0, startangle=0.0, endangle=360.0):
+#------------------------------------------------------------
+# Cycloid curve
+
+def CycloidCurve(number=100, type=0, R=4.0, r=1.0, d=1.0):
     """
-    CycloidCurve( number=24, length=2.0, type=0, a=1.0, b=1.0, startangle=0.0, endangle=360.0 )
+    CycloidCurve( number=100, type=0, a=4.0, b=1.0 )
 
-    Create a Cycloid, Epicycloid or Hypocycloid curve
+    Create a Cycloid, Hypotrochoid / Hypocycloid or Epitrochoid / Epycycloid type of curve
 
         Parameters:
             number - the number of points
                 (type=int)
-            length - length of curve
-                (type=float)
-            type - types: Cycloid, Epicycloid, Hypocycloid
+            type - types: Cycloid, Hypocycloid, Epicycloid
                 (type=int)
+            R = Radius a scaling parameter
+                (type=float)
+            r = Radius b scaling parameter
+                (type=float)
+            d = Distance scaling parameter
+                (type=float)
         Returns:
             a list with lists of x,y,z coordinates for curve points, [[x,y,z],[x,y,z],...n]
             (type=list)
     """
 
+    a = R
+    b = r
     newpoints = []
-    angle = (2.0/360.0)*(endangle-startangle)
-    step = angle/(nu

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list