def curve_between(a, b, num_points=24, degree=3, name='curve#'):
'''Create a nurbsCurve between two MVectors
:param a: start of curve
:param b: end of curve
:param num_points: number of points on curve
:param degree: degree of curve
'''
v = b - a
cvs = []
for t in linspace(0, 1, num_points):
cvs.append(a + v * t)
knots = compute_knots(num_points, degree)
curve = cmds.curve(point=cvs, degree=degree, knot=knots)
curve = cmds.rename(curve, name)
curve_shape = cmds.listRelatives(curve, shapes=True)[0]
return curve, curve_shape
评论列表
文章目录