def to_curve_fn(curve):
shape = None
if cmds.nodeType(curve, 'nurbsCurve'):
shape = curve
else:
child = cmds.listRelatives(curve, shapes=True, noIntermediate=True)
if child:
shape = child[0]
else:
cmds.warning('Not a proper nurbsCurve: {}'.format(curve))
raise Exception('Not a proper nurbsCurve: {}'.format(curve))
sel = om.MSelectionList()
sel.add(shape)
dep = sel.getDagPath(0)
fn = om.MFnNurbsCurve(dep)
return fn
评论列表
文章目录