Forum: Poser Python Scripting


Subject: How should I read all parameters with keyframes? NextKeyFrame()?

timarender opened this issue on Dec 10, 2013 · 5 posts


timarender posted Tue, 10 December 2013 at 7:05 AM

I would like to access the values of any parameters of Actors which contain keyframes. Andy's Chest, for example includes Twist, Side-Side, Bend, Scale etc.

My slightly ugly code below does NOT work. And I don't understand why not.

Please. Can anyone put me out my misery - how am I supposed to do it?

 

scene = poser.Scene()
scene.SetFrame(0)
figs = scene.Figures()
for fig in figs:
    acts= fig.Actors()
    for actor in acts:
        scene.SelectActor(actor)
        frame = 0
        scene.SetFrame(frame)
        for parm in actor.Parameters():
            frame = 0
            while( frame < scene.NumFrames()-1):
                frame = parm.NextKeyFrame()
            if(not frame):
                 frame = scene.NumFrames()
            else:
                scene.SetFrame(frame)
                print frame, actor.Name(), parm.Name(), parm.Value()