Python Format for Outputting to JSON

Tutorial / 23 May 2021
skeletonRoot = cmds.ls(selection = True) skeletonList = cmds.listRelatives(skeletonRoot, allDescendents = True, type = 'joint') skeletonList.append(skeletonRoot[0]) skeletonList.reverse() 
space = " " * 4 
for eachJoint in skeletonList: 
     print(space + '"' + str(eachJoint) + '":')
     print(space + "[")
     print(space * 2 + "{")
     print(space * 3 + '"' + "ControlsList" + '"' + ":" ' "' + "worldSpaceController" + '"')
     print(space * 2 + "}")
     print(space + "],")

Note, Artstation's janky code format doesn't allow for tabbing, so copy and paste may not work, you may need to re-establish the tabs.