Hi i am trying to get the hierarchy of the scene file in maya as a dictionary. For example enter image description here
I want this data as a dictionary
tree = {"group5": {"group4": {"group3": {"group2": {"group1": {"pSphere1": "pSphere1Shape"}},
"pSphere2": {"pSphere2Shape"}
}
}
},
"group8": {"group7": {"group6": {"pCube": {"pCube1Shape"}
}
}
}
}
Any suggession as how to get this data?