Using Python to save Transform Presets

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I know how to save a transform preset on a node by using the Presets button in the Attribute Editor, but what I would like do is be able to create them for a node or group of nodes by using Python. I've used the Python nodePreset command to save presets but I don't know where this data or preset name is stored. When I click on Presets after using nodePreset, I do not see the saved preset in the list of available presets (as shown in the first image). This is unfortunate as I'd like to be able to manually set the node to the various presets I create automatically.
What I'm looking for is the ability to replicate with Python what I can do manually on any given node (shown in the 2nd image). The code I was using below does indeed save the poses - even after closing and reopening Maya - but I have no way of setting these poses manually because the presets don't show up in the Attribute Editor. Any help would be appreciated.
import maya.cmds as cmds
loc = 'test_LOC'
pos1 = 'Default_Pose'
pos2 = 'Relaxed_Pose'
pos3 = 'Angry_Pose'
# Set the figure into the default pose
cmds.nodePreset(sv = (loc, pos1))
# Change pose to relaxed pose
cmds.nodePreset(sv = (loc, pos2))
# Change pose to angry pose
cmds.nodePreset(sv = (loc, pos3))