zbw_attributes.py 文件源码

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

项目:zTools 作者: zethwillie 项目源码 文件源码
def get_channel_attributes(obj, chnl):
    """
    gets and returns attributes of given channel on given object
    """
    attrType = cmds.attributeQuery(chnl, node=obj, at=True)
    hasMin = cmds.attributeQuery(chnl, node=obj, mne=True)
    hasMin = cmds.attributeQuery(chnl, node=obj, mne=True)
    hasMax = cmds.attributeQuery(chnl, node=obj, mxe=True)
    attrMin = None
    if hasMin:
        attrMin = cmds.attributeQuery(chnl, node=obj, min=True)
    attrMax = None
    if hasMax:
        attrMax = cmds.attributeQuery(chnl, node=obj, max=True)
    value = cmds.getAttr("{0}.{1}".format(obj, chnl))
    inConnection = cmds.listConnections("{0}.{1}".format(obj, chnl), plugs=True, destination=False, source=True)
    outConnection = cmds.listConnections("{0}.{1}".format(obj, chnl), plugs=True, destination=True, source=False)
    locked = cmds.getAttr("{0}.{1}".format(obj, chnl), lock=True)

    return (attrType, hasMin, attrMin, hasMax, attrMax, value, inConnection, outConnection, locked)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号