zbw_curveExtrude_old.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:zTools 作者: zethwillie 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号