[Bf-extensions-cvs] [156c5ea6] blender2.8: Update addon to Blender 2.8

Spivak Vladimir cwolf3d noreply at git.blender.org
Wed Dec 19 01:37:56 CET 2018


Commit: 156c5ea6a45d0549d8422e3ea295972dec7766c3
Author: Spivak Vladimir (cwolf3d)
Date:   Wed Dec 19 02:35:52 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBA156c5ea6a45d0549d8422e3ea295972dec7766c3

Update addon to Blender 2.8

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

M	add_curve_extra_objects/__init__.py
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_celtic_links.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_spirofit_bouncespline.py
M	add_curve_extra_objects/add_curve_torus_knots.py
M	add_curve_extra_objects/add_surface_plane_cone.py
M	add_curve_extra_objects/beveltaper_curve.py

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

diff --git a/add_curve_extra_objects/__init__.py b/add_curve_extra_objects/__init__.py
index 5c093af4..2622401b 100644
--- a/add_curve_extra_objects/__init__.py
+++ b/add_curve_extra_objects/__init__.py
@@ -23,8 +23,8 @@
 bl_info = {
     "name": "Extra Objects",
     "author": "Multiple Authors",
-    "version": (0, 1, 2),
-    "blender": (2, 76, 0),
+    "version": (0, 1, 3),
+    "blender": (2, 80, 0),
     "location": "View3D > Add > Curve > Extra Objects",
     "description": "Add extra curve object types",
     "warning": "",
@@ -140,10 +140,10 @@ class CurveExtraObjectsAddonPreferences(AddonPreferences):
             "curve_type": ['POLY', 'NURBS'],
             "spiral_direction": ['COUNTER_CLOCKWISE', 'CLOCKWISE']
             }
-    update_spiral_presets_msg = StringProperty(
+    update_spiral_presets_msg : StringProperty(
             default="Nothing to do"
             )
-    update_spiral_presets = BoolProperty(
+    update_spiral_presets : BoolProperty(
             name="Update Old Presets",
             description="Update presets to reflect data changes",
             default=False,
@@ -155,12 +155,12 @@ class CurveExtraObjectsAddonPreferences(AddonPreferences):
                     fixdic=spiral_fixdic
                     )
             )
-    show_menu_list = BoolProperty(
+    show_menu_list : BoolProperty(
             name="Menu List",
             description="Show/Hide the Add Menu items",
             default=False
             )
-    show_panel_list = BoolProperty(
+    show_panel_list : BoolProperty(
             name="Panels List",
             description="Show/Hide the Panel items",
             default=False
@@ -225,9 +225,9 @@ class CurveExtraObjectsAddonPreferences(AddonPreferences):
                      icon="LAYER_USED")
 
 
-class VIEW3D_MT_curve_knots_add(Menu):
+class INFO_MT_curve_knots_add(Menu):
     # Define the "Extras" menu
-    bl_idname = "VIEW3D_MT_curve_knots_add"
+    bl_idname = "INFO_MT_curve_knots_add"
     bl_label = "Plants"
 
     def draw(self, context):
@@ -236,7 +236,10 @@ class VIEW3D_MT_curve_knots_add(Menu):
 
         layout.operator("curve.torus_knot_plus", text="Torus Knot Plus")
         layout.operator("curve.celtic_links", text="Celtic Links")
-        layout.operator("mesh.add_braid", text="Braid Knot")
+        layout.operator("curve.add_braid", text="Braid Knot")
+        layout.operator("object.add_spirofit_spline", icon="FORCE_MAGNETIC")
+        layout.operator("object.add_bounce_spline", icon="FORCE_HARMONIC")
+        layout.operator("object.add_catenary_curve", icon="FORCE_CURVE")
 
 
 # Define "Extras" menus
@@ -247,40 +250,47 @@ def menu_func(self, context):
 
     layout = self.layout
 
-    layout.operator_menu_enum("mesh.curveaceous_galore", "ProfileType",
-                              icon='CURVE_DATA')
-    layout.operator_menu_enum("curve.spirals", "spiral_type",
-                              icon='CURVE_DATA')
+    layout.operator_menu_enum("curve.curveaceous_galore", "ProfileType", icon='CURVE_DATA')
+    layout.operator_menu_enum("curve.spirals", "spiral_type", icon='CURVE_DATA')
     layout.separator()
 
-    layout.menu(VIEW3D_MT_curve_knots_add.bl_idname, text="Knots", icon='CURVE_DATA')
+    layout.menu(INFO_MT_curve_knots_add.bl_idname, 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')
+    layout.operator("curve.curlycurve", text="Curly Curve", icon='CURVE_DATA')
+    #layout.menu(VIEW3D_MT_bevel_taper_curve_menu, text="Bevel/Taper", icon='CURVE_DATA')
 
 
 def menu_surface(self, context):
     self.layout.separator()
     if context.mode == 'EDIT_SURFACE':
-        self.layout.operator("curve.smooth_x_times",
-                             text="Special Smooth", icon="MOD_CURVE")
+        self.layout.operator("curve.smooth_x_times", text="Special Smooth", icon="MOD_CURVE")
     elif context.mode == 'OBJECT':
-        self.layout.operator("object.add_surface_wedge", text="Wedge",
-                             icon="SURFACE_DATA")
-        self.layout.operator("object.add_surface_cone", text="Cone",
-                             icon="SURFACE_DATA")
-        self.layout.operator("object.add_surface_star", text="Star",
-                             icon="SURFACE_DATA")
-        self.layout.operator("object.add_surface_plane", text="Plane",
-                             icon="SURFACE_DATA")
+        self.layout.operator("object.add_surface_wedge", text="Wedge", icon="SURFACE_DATA")
+        self.layout.operator("object.add_surface_cone", text="Cone", icon="SURFACE_DATA")
+        self.layout.operator("object.add_surface_star", text="Star", icon="SURFACE_DATA")
+        self.layout.operator("object.add_surface_plane", text="Plane", icon="SURFACE_DATA")
 
+# Register
+classes = [
+    CurveExtraObjectsAddonPreferences,
+    INFO_MT_curve_knots_add
+]
 
 def register():
+    from bpy.utils import register_class
+    for cls in classes:
+        register_class(cls)
+    
     add_curve_simple.register()
-    bpy.utils.register_module(__name__)
-
+    add_curve_spirals.register()
+    add_curve_aceous_galore.register()
+    add_curve_torus_knots.register()
+    add_curve_braid.register()
+    add_curve_celtic_links.register()
+    add_curve_curly.register()
+    add_curve_spirofit_bouncespline.register()
+    add_surface_plane_cone.register()
+    
     # Add "Extras" menu to the "Add Curve" menu
     bpy.types.VIEW3D_MT_curve_add.append(menu_func)
     # Add "Extras" menu to the "Add Surface" menu
@@ -288,14 +298,24 @@ def register():
 
 
 def unregister():
-    add_curve_simple.unregister()
     # Remove "Extras" menu from the "Add Curve" menu.
     bpy.types.VIEW3D_MT_curve_add.remove(menu_func)
     # Remove "Extras" menu from the "Add Surface" menu.
     bpy.types.VIEW3D_MT_surface_add.remove(menu_surface)
-
-    bpy.utils.unregister_module(__name__)
-
+    
+    add_surface_plane_cone.unregister()
+    add_curve_spirofit_bouncespline.unregister()
+    add_curve_curly.unregister()
+    add_curve_celtic_links.unregister()
+    add_curve_braid.unregister()
+    add_curve_torus_knots.unregister()
+    add_curve_aceous_galore.unregister()
+    add_curve_spirals.unregister()
+    add_curve_simple.unregister()
+    
+    from bpy.utils import unregister_class
+    for cls in reversed(classes):
+        unregister_class(cls)
 
 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 d823cbb5..246e0551 100644
--- a/add_curve_extra_objects/add_curve_aceous_galore.py
+++ b/add_curve_extra_objects/add_curve_aceous_galore.py
@@ -20,8 +20,8 @@
 bl_info = {
     "name": "Curveaceous Galore!",
     "author": "Jimmy Hazevoet, testscreenings",
-    "version": (0, 2, 1),
-    "blender": (2, 59),
+    "version": (0, 2, 2),
+    "blender": (2, 80),
     "location": "View3D > Add > Curve",
     "description": "Adds many different types of Curves",
     "warning": "",
@@ -38,7 +38,7 @@ from bpy.props import (
         FloatProperty,
         IntProperty,
         )
-from mathutils import Matrix
+from mathutils import Matrix, Vector
 from bpy.types import Operator
 from math import (
         sin, cos, pi
@@ -78,7 +78,7 @@ def randnum(low=0.0, high=1.0, seed=0):
 
 # ------------------------------------------------------------
 # Make some noise:
-def vTurbNoise(x, y, z, iScale=0.25, Size=1.0, Depth=6, Hard=0, Basis=0, Seed=0):
+def vTurbNoise(x, y, z, iScale=0.25, Size=1.0, Depth=6, Hard=False, Basis=0, Seed=0):
     """
     vTurbNoise((x,y,z), iScale=0.25, Size=1.0, Depth=6, Hard=0, Basis=0, Seed=0 )
 
@@ -93,7 +93,7 @@ def vTurbNoise(x, y, z, iScale=0.25, Size=1.0, Depth=6, Hard=0, Basis=0, Seed=0)
             (type=float)
         Depth - number of noise values added.
             (type=int)
-        Hard - noise hardness: 0 - soft noise; 1 - hard noise
+        Hard - noise hardness: True - soft noise; False - hard noise
             (type=int)
         basis - type of noise used for turbulence
             (type=int)
@@ -106,8 +106,9 @@ def vTurbNoise(x, y, z, iScale=0.25, Size=1.0, Depth=6, Hard=0, Basis=0, Seed=0)
     rand = randnum(-100, 100, Seed)
     if Basis is 9:
         Basis = 14
-    vTurb = Noise.turbulence_vector((x / Size + rand, y / Size + rand, z / Size + rand),
-                                    Depth, Hard, Basis)
+    vec = Vector((x / Size + rand, y / Size + rand, z / Size + rand))
+    vTurb = Noise.turbulence_vector(vec, Depth, Hard)
+    #mathutils.noise.turbulence_vector(position, octaves, hard, noise_basis='PERLIN_ORIGINAL', amplitude_scale=0.5, frequency_scale=2.0)
     tx = vTurb[0] * iScale
     ty = vTurb[1] * iScale
     tz = vTurb[2] * iScale
@@ -533,7 +534,7 @@ def SplatCurve(sides=24, scale=1.0, seed=0, basis=0, radius=1.0):
     i = 0
     while i < sides:
         t = i * step
-        turb = vTurbNoise(t, t, t, 1.0, scale, 6, 0, basis, seed)
+        turb = vTurbNoise(t, t, t, 1.0, scale, 6, False, basis, seed)
         turb = turb[2] * 0.5 + 0.5
         x = sin(t * pi) * radius * turb
         y = cos(t * pi) * radius * turb
@@ -684,7 +685,7 @@ def NoiseCurve(type=0, number=100, length=2.0, size=0.5,
         # noise circle
         while i < number:
             t = i * step
-            v = vTurbNoise(t, t, t, 1.0, size, octaves, 0, basis, seed)
+            v = vTurbNoise(t, t, t, 1.0, size, octaves, False, basis, seed)
             x = sin(t * pi) + (v[0] * scale[0])
             y = cos(t * pi) + (v[1] * scale[1])
             z = v[2] * scale[2]
@@ -694,7 +695,7 @@ def NoiseCurve(type=0, number=100, length=2.0, size=0.5,
         # noise knot / ball
         while i < number:
             t = i * step
-            v = vTurbNoise(t, t, t, 1.0, 1.0, octaves, 0, basis, seed)
+            v = vTurbNoise(t, t, t, 1.0, 1.0, octaves, False, basis, seed)
             x = v[0] * scale[0] * size
             y = v[1] * scale[1] * size
             z = v[2] * scale[2] * size
@@ -704,7 +705,7 @@ def NoiseCurve

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list