zbw_attributes.py 文件源码

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

项目:zTools 作者: zethwillie 项目源码 文件源码
def connectShapeVis(*args):
    """Connects the attr from the assoc. text field to the shape Visibility of selected objects"""

    sel = cmds.ls(sl=True, type="transform")
    driver = cmds.textFieldButtonGrp(widgets["toShapeVis"], q=True, tx=True)

    if sel:
        if driver:
            for obj in sel:
                shapes = cmds.listRelatives(obj, s=True)
                for shape in shapes:
                    try:
                        cmds.connectAttr(driver, "%s.v" % shape, f=True)
                        cmds.warning("Connected %s to %s" % (driver, shape))
                    except:
                        cmds.warning("Couldn't connect %s to %s. Sorry! Check the Script Editor." % (driver, shape))
    else:
        cmds.warning("You need to select an object to connect the shape.vis!")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号