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
评论列表
文章目录