stitches.py 文件源码

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

项目:mayakit 作者: danbradham 项目源码 文件源码
def average_curves(*curves):

    cvs, spans, degree, form = get_curve_info(curves[0])
    points = [cmds.getAttr(curve + '.cv[*]') for curve in curves]
    if not all(len(points[0]) == len(curve_points) for curve_points in points):
        raise Exception('Input curves need to have the same number of cvs')

    averaged = [[0, 0, 0] for i in xrange(len(points[0]))]
    for curve_points in points:
        for point in curve_points:
            averaged[0] += point[0]
            averaged[1] += point[1]
            averaged[2] += point[2]
    averaged = [pnt / len(points) for pnt in averaged]
    return averaged
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号