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)
评论列表
文章目录