Blog

Python Format for Outputting to JSON

Posted by:

  1. skeletonRoot = cmds.ls(selection = True)
  2. skeletonList = cmds.listRelatives(skeletonRoot, allDescendents = True, type = 'joint')
  3. skeletonList.append(skeletonRoot[0])
  4. skeletonList.reverse()
  5. space = " " * 4
  6. for eachJoint in skeletonList:
  7. print(space + '"' + str(eachJoint) + '":')
  8. print(space + "[")
  9. print(space * 2 + "{")
  10. print(space * 3 + '"' + "ControlsList" + '"' + ":" ' "' + "worldSpaceController" + '"')
  11. print(space * 2 + "}")
  12. print(space + "],")
0
  Related Posts

You must be logged in to post a comment.