python how can i save and apply a pose?


#1

I need a simple script to save out a pose and apply it back to the same character in another file.

I am not looking for the PAIE tool. I am looking to do this as part of a much larger script but need to know how to do this small part.

I have saved and applied dagposes which work great in scene, but is there a way to save them to a file and apply them in another shot?

If so, the dagPose way would be the way to go.

If there is another options please let me know.


#2

Maybe it helps to look at the free Red9 Studio Tools? There is an excellent pose library, and it can be scripted in Python (i believe)
http://red9-consultancy.blogspot.de/


#3

Thanks for the plug Rob. Yes the StudioPack is free, and the poseLib is one of the only ones out there that’s capable of loading pose data relatively rather than just in the space the pose was created.

Plenty of demo and help files up on our vimeo channel too :wink:

cheers
Mark


#4

you can use picke or cpickle modules to save out simple text files…
https://docs.python.org/2/library/pickle.html

I wrote a super simple tool that does just this using pickle and nested dictionaries. So querying all selected objects, using them as keys, for the top level, then inside that an other dict with all keyable attribute names as keys, and values as values.
Heres something to read on dicts in case you need to:
https://docs.python.org/2/tutorial/datastructures.html


#5

cool thanks

although might be a bit advanced for me. do you have a sample I can look at?

I was hoping to just save a dagPose to a file and load it?

Thanks!