[Bf-extensions-cvs] [b5608a31] master: Curve extra objects: Enabled work beveltaper_curve. Adding function beveltaper in contex menu. Enabled Path Animation in other some curve.

Spivak Vladimir cwolf3d noreply at git.blender.org
Sat May 4 21:02:00 CEST 2019


Commit: b5608a3116d3b2d7f89a08e90387aea8c7230fdd
Author: Spivak Vladimir (cwolf3d)
Date:   Sat May 4 21:59:39 2019 +0300
Branches: master
https://developer.blender.org/rBAb5608a3116d3b2d7f89a08e90387aea8c7230fdd

Curve extra objects: Enabled work beveltaper_curve.
Adding function beveltaper in contex menu.
Enabled Path Animation in other some curve.

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

M	add_curve_extra_objects/__init__.py
M	add_curve_extra_objects/add_curve_aceous_galore.py
M	add_curve_extra_objects/add_curve_simple.py
M	add_curve_extra_objects/add_curve_spirals.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 321e1663..fbb0838b 100644
--- a/add_curve_extra_objects/__init__.py
+++ b/add_curve_extra_objects/__init__.py
@@ -255,8 +255,6 @@ def menu_func(self, context):
         return None
     layout.separator()
     layout.menu(INFO_MT_curve_knots_add.bl_idname, text="Knots", 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()
@@ -288,6 +286,7 @@ def register():
     add_curve_curly.register()
     add_curve_spirofit_bouncespline.register()
     add_surface_plane_cone.register()
+    beveltaper_curve.register()
     
     # Add "Extras" menu to the "Add Curve" menu
     bpy.types.VIEW3D_MT_curve_add.append(menu_func)
@@ -310,6 +309,7 @@ def unregister():
     add_curve_aceous_galore.unregister()
     add_curve_spirals.unregister()
     add_curve_simple.unregister()
+    beveltaper_curve.unregister()
     
     from bpy.utils import unregister_class
     for cls in reversed(classes):
diff --git a/add_curve_extra_objects/add_curve_aceous_galore.py b/add_curve_extra_objects/add_curve_aceous_galore.py
index 2f8fc3de..62ac823c 100644
--- a/add_curve_extra_objects/add_curve_aceous_galore.py
+++ b/add_curve_extra_objects/add_curve_aceous_galore.py
@@ -776,6 +776,7 @@ def createCurve(context, vertArray, self, align_matrix):
 
         # set curveOptions
         newCurve.dimensions = self.shape
+        newCurve.use_path = True
         
         # create object with newCurve
         SimpleCurve = object_utils.object_data_add(context, newCurve, operator=self)  # place in active scene
diff --git a/add_curve_extra_objects/add_curve_simple.py b/add_curve_extra_objects/add_curve_simple.py
index fae815d4..ed56c7eb 100644
--- a/add_curve_extra_objects/add_curve_simple.py
+++ b/add_curve_extra_objects/add_curve_simple.py
@@ -440,6 +440,7 @@ def main(context, self, align_matrix):
 
         # set curveOptions
         newCurve.dimensions = self.shape
+        newCurve.use_path = True
         
         # create object with newCurve
         SimpleCurve = object_utils.object_data_add(context, newCurve, operator=self)  # place in active scene
diff --git a/add_curve_extra_objects/add_curve_spirals.py b/add_curve_extra_objects/add_curve_spirals.py
index 96eb8aba..c3945e3f 100644
--- a/add_curve_extra_objects/add_curve_spirals.py
+++ b/add_curve_extra_objects/add_curve_spirals.py
@@ -241,6 +241,7 @@ def draw_curve(props, context, align_matrix):
 
         # set curveOptions
         newCurve.dimensions = props.shape
+        newCurve.use_path = True
         
         # create object with newCurve
         Curve = object_data_add(context, newCurve)  # place in active scene
diff --git a/add_curve_extra_objects/beveltaper_curve.py b/add_curve_extra_objects/beveltaper_curve.py
index 6da71428..d85b985c 100644
--- a/add_curve_extra_objects/beveltaper_curve.py
+++ b/add_curve_extra_objects/beveltaper_curve.py
@@ -285,7 +285,7 @@ class add_tapercurve(Operator):
 
         col = layout.column(align=True)
         col.label(text="Settings:")
-        split = layout.split(percentage=0.95, align=True)
+        split = layout.split(factor=0.95, align=True)
         split.active = not self.link2
         col = split.column(align=True)
         col.prop(self, "scale_ends1")
@@ -297,7 +297,7 @@ class add_tapercurve(Operator):
         col_sub.prop(self, "scale_ends2")
         row.prop(self, "link1", toggle=True, text="", icon="LINKED")
 
-        split = layout.split(percentage=0.95, align=True)
+        split = layout.split(factor=0.95, align=True)
         col = split.column(align=True)
         col.prop(self, "scale_mid")
 
@@ -367,7 +367,7 @@ class add_bevelcurve(Operator, AddObjectHelper):
         col.label(text = "Settings:")
         col.prop(self, "types")
 
-        split = layout.split(percentage=0.95, align=True)
+        split = layout.split(factor=0.95, align=True)
         col = split.column(align=True)
         col.prop(self, "scale_x")
         row = split.row(align=True)
@@ -392,31 +392,35 @@ class add_bevelcurve(Operator, AddObjectHelper):
         return {'FINISHED'}
 
 
-class Bevel_Taper_Curve_Menu(Menu):
+def menu_funcs(self, context):
     bl_label = "Bevel/Taper"
-    bl_idname = "VIEW3D_MT_bevel_taper_curve_menu"
 
-    def draw(self, context):
-        layout = self.layout
+    layout = self.layout
 
+    if bpy.context.view_layer.objects.active.type == "CURVE":
         layout.operator("curve.bevelcurve")
         layout.operator("curve.tapercurve")
+        layout.separator()
 
-
-def menu_funcs(self, context):
-    if bpy.context.view_layer.objects.active.type == "CURVE":
-        self.layout.menu("VIEW3D_MT_bevel_taper_curve_menu")
-
+# Register
+classes = [
+    add_bevelcurve,
+    add_tapercurve
+]
 
 def register():
-    #bpy.utils.register_module(__name__)
-    bpy.types.VIEW3D_MT_object.append(menu_funcs)
+    from bpy.utils import register_class
+    for cls in classes:
+        register_class(cls)
 
+    bpy.types.VIEW3D_MT_object_context_menu.prepend(menu_funcs)
 
 def unregister():
-    #bpy.utils.unregister_module(__name__)
-    bpy.types.VIEW3D_MT_object.remove(menu_funcs)
+    from bpy.utils import unregister_class
+    for cls in reversed(classes):
+        unregister_class(cls)
 
+    bpy.types.VIEW3D_MT_object_context_menu.remove(menu_funcs)
 
 if __name__ == "__main__":
     register()



More information about the Bf-extensions-cvs mailing list