PDA

View Full Version : Saving/Recalling Poses


ShiroiOokami
07-28-2005, 11:43 AM
What would be the best way to allow an animator to save a current pose that could be recalled later, even if they restarted maya. Exporting to a separate file wouldn't be very convieniet, but I am fairly new to mel and am not sure about how I could go about saving the values into the file itself.

Gnimmel
07-28-2005, 04:27 PM
I would say the best way would be to make your own text file and save to disk. If you don't want animators to have to load and save stuff, you could create a lib in your script which just lists all the saved poses (they don't have to know it's saved to multiple files).
If it's just a simple pose then you can simply export the object name and all it's channel box values. If you want to be able to load the same pose to a rig with different names, perhaps a referenced rig with a different prefix, then you can add support for this by either adding a search and replace string feature, or make it simple and remove the prefix at save time so you can add a new one at load.

As an example of a simple format, here is one object from a exported file I wrote a long time ago;

Node;rig:Global_HandCTR_LE
rig:Global_HandCTR_LE.Global_Local;10
rig:Global_HandCTR_LE.rotateX;37.06836011
rig:Global_HandCTR_LE.rotateY;-17.02981103
rig:Global_HandCTR_LE.rotateZ;87.02364902
rig:Global_HandCTR_LE.scaleX;1
rig:Global_HandCTR_LE.scaleY;1
rig:Global_HandCTR_LE.scaleZ;1
rig:Global_HandCTR_LE.translateX;-0.3882604054
rig:Global_HandCTR_LE.translateY;0.5531867719
rig:Global_HandCTR_LE.translateZ;-0.07350319234
rig:Global_HandCTR_LE.visibility;1
NodeEND;rig:Global_HandCTR_LE

Of course the full file has a lot more objects, but this should give you an idea. At load I have an option to change the prefix (all the rigs are referenced) by using tokenize and looking for the ":"

You say you are new to MEL, but if you can get the above to work with prints, then you can change it to fprint and print to a text file instead of the screen. Actually thats a good way to get it working, ignore the file at first and try to get a good format printed to the script editor. The MEL help files have all you need to get files working, just look up the fprint, fopen and fclose commands.

Hope this helps,

Richard

CGTalk Moderation
07-28-2005, 04:27 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.