Generate a list of joints from a skeleton in Maya, cut and paste into a python list

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("'" + str(eachJoint) + "'")