def prepExtrude(*args):
name = cmds.textFieldGrp(widgets["nameTFG"], q=True, tx=True)
if not name:
cmds.warning("You must give the extrusion a name!")
return
if cmds.objExists("{}_extRig_GRP".format(name)):
cmds.warning("A rig of this name already exists")
return
sel = cmds.ls(sl=True, exactType = "transform")
if len(sel) < 1 or len(sel)>3:
cmds.warning("You must select the profile crv, then path crv, then optionally a cap rig top node")
return
if len(sel)==2:
for x in range(2):
shp = cmds.listRelatives(sel[x], shapes=True)
if shp:
if cmds.objectType(shp[0]) != "nurbsCurve":
cmds.warning("{} is not a curve!".format(sel[x]))
return
elif len(sel) == 1:
shp = cmds.listRelatives(sel[0], shapes=True)
if shp:
if cmds.objectType(shp[0]) != "nurbsCurve":
cmds.warning("{} is not a curve!".format(sel[0]))
return
extrude(name)
评论列表
文章目录