add_curve_spirals.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:blender-addons 作者: scorpion81 项目源码 文件源码
def draw_curve(props, context):
    if props.spiral_type == 1:
        verts = make_spiral(props, context)
    if props.spiral_type == 2:
        verts = make_spiral(props, context)
    if props.spiral_type == 3:
        verts = make_spiral_spheric(props, context)
    if props.spiral_type == 4:
        verts = make_spiral_torus(props, context)

    curve_data = bpy.data.curves.new(name='Spiral', type='CURVE')
    curve_data.dimensions = '3D'

    if props.curve_type == 0:
        spline = curve_data.splines.new(type='POLY')
    elif props.curve_type == 1:
        spline = curve_data.splines.new(type='NURBS')

    spline.points.add( len(verts)*0.25-1 )                          #Add only one quarter of points as elements in verts, because verts looks like: "x,y,z,?,x,y,z,?,x,..."
    spline.points.foreach_set('co', verts)
    new_obj = object_data_add(context, curve_data)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号