def ResetSceneAnim():
# Loop through them all
SceneJoints = cmds.ls(type="joint")
# Loop
for name in SceneJoints:
# Disconnect if required
ResetBoneKeyframes(DagPathFromJoint(name, False).transform())
# Check for undo
if (cmds.objExists(name + ".seanimUndoT")):
# Reset to it
ResetTranslation = cmds.getAttr(name + ".seanimUndoT")[0]
ResetScale = cmds.getAttr(name + ".seanimUndoS")[0]
ResetRotation = cmds.getAttr(name + ".seanimUndoR")[0]
# Apply
cmds.setAttr(name + ".t", ResetTranslation[0], ResetTranslation[1], ResetTranslation[2])
cmds.setAttr(name + ".scale", ResetScale[0], ResetScale[1], ResetScale[2])
cmds.setAttr(name + ".r", 0, 0, 0)
cmds.setAttr(name + ".jo", ResetRotation[0], ResetRotation[1], ResetRotation[2])
# Remove notetracks
if cmds.objExists("SENotes"):
# Delete
cmds.delete("SENotes")
# Processes a joint, creating it's rest position, and returning a dag path
评论列表
文章目录