'''Script to save single frame poses from an animation. Load the required figure and apply the animated pose. Suggest using the Posing Camera to ensure that figure stays in frame. Position the camera and save a sample pose to ensure that resulting library thumbnail is satisfactory. Adjust as required. Then run the script. Except for selling this script you may use it however you like but at your own risk. PhilC pcooke@philc.net http://www.philc.net ''' import poser import os scene = poser.Scene() def main(): # user input for library directory to save to. startDir = os.path.join(poser.ContentRootLocation(),'Runtime','libraries','poses') # suggested alternatives: #startDir = os.curdir # current directory #startDir = os.path.expanduser('~\\Documents\\MyPoses') # directory under users documents folder. #startDir = 'C:\\foo\\bar' # note required double \\ directory seperator. browse = poser.DialogDirChooser(1, "Select folder:", startDir) browse.Show() dirPath = browse.Path() print print dirPath includeMorphTargets = 0 multiFrame = 0 i = 0 while i < scene.NumFrames(): # GUI shows frames starting at 1 whereas internal index starts at zero print "Saving frame %i" % (i + 1) scene.SetFrame(i) scene.DrawAll() if i < 10: index = "0%i" % (i + 1) else: index = "%i" % (i + 1) filePath = os.path.join(dirPath,"Pose_%s.pz2" % index) scene.SaveLibraryPose(filePath,includeMorphTargets,multiFrame,i,i) i = i + 1 print print "Task Completed" print "Poses saved to:" print dirPath main()