zbw_attributes.py 文件源码

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

项目:zTools 作者: zethwillie 项目源码 文件源码
def locked_attr(*args):
    """
    creates a locked attr (I use as a separator). Uses the long name as the nice name (literal name in channel box)
    """
    attrName = cmds.textFieldButtonGrp(widgets["lockAttrTFBG"], q=True, tx=True)

    if attrName:
        sel = cmds.ls(sl=True)

        if sel:
            for obj in sel:
                try:
                    cmds.addAttr(obj, ln=attrName, nn=attrName, at="enum", en="-----", k=True)
                    cmds.setAttr("%s.%s" % (obj, attrName), l=True)
                except:
                    cmds.warning("Failed to add %s to %s, skipping!" % (attrName, obj))
        else:
            cmds.warning("Please select some objects to add attr to!")
    else:
        cmds.warning("Please enter a name for the attr!")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号