def get_knots(curve):
"""Gets the list of knots of a curve so it can be recreated.
:param curve: Curve to query.
:return: A list of knot values that can be passed into the curve creation command.
"""
curve = shortcuts.get_shape(curve)
info = cmds.createNode('curveInfo')
cmds.connectAttr('{0}.worldSpace'.format(curve), '{0}.inputCurve'.format(info))
knots = cmds.getAttr('{0}.knots[*]'.format(info))
cmds.delete(info)
return knots
评论列表
文章目录