control.py 文件源码

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

项目:cmt 作者: chadmv 项目源码 文件源码
def create_curve(control):
    """Create a curve.

    :param control: A data dictionary generated from the dump function.
    :return: The created curve.
    """
    periodic = control['form'] == 2
    degree = control['degree']
    points = control['cvs']
    points = points + points[:degree] if periodic else points
    curve = cmds.curve(degree=degree, p=points, n=control['name'], per=periodic, k=control['knots'])
    cmds.xform(curve, ws=True, matrix=control['xform'])
    cmds.xform(curve, piv=control['pivot'])
    cmds.delete(curve, constructionHistory=True)
    cmds.setAttr('{0}.overrideEnabled'.format(curve), control['overrideEnabled'])
    cmds.setAttr('{0}.overrideRGBColors'.format(curve), control['overrideRGBColors'])
    cmds.setAttr('{0}.overrideColorRGB'.format(curve), *control['overrideColorRGB'])
    cmds.setAttr('{0}.overrideColor'.format(curve), control['overrideColor'])
    return curve
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号