Created
February 1, 2020 06:24
-
-
Save splinecraft/14e233f689ee23960d86d12a778e2c5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
import collections | |
def getAllLayers(): | |
rootLayer = cmds.animLayer(q=True, r=True) | |
if rootLayer: | |
def search(layer, depth=0): | |
children = cmds.animLayer(layer, q=True, c=True) | |
if children: | |
for child in children: | |
layers[child] = {"depth": depth} | |
search(child, depth + 1) | |
layers = collections.OrderedDict() | |
search(rootLayer) | |
if layers: | |
for layer in layers: | |
mute = cmds.animLayer(layer, q=True, m=True) | |
solo = cmds.animLayer(layer, q=True, s=True) | |
layers[layer]["mute"] = mute | |
layers[layer]["solo"] = solo | |
return layers | |
return {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment