Curve extra objects: Enabled work beveltaper_curve.

Adding function beveltaper in contex menu.
Enabled Path Animation in other some curve.
This commit is contained in:
Vladimir Spivak 2019-05-04 21:59:39 +03:00
parent b23f156030
commit b5608a3116
5 changed files with 25 additions and 18 deletions

View File

@ -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):

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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()