Forum: Poser - OFFICIAL


Subject: Animating Using Python

Enivob opened this issue on Jun 10, 2004 ยท 11 posts


stewer posted Thu, 10 June 2004 at 1:01 PM

Try this:

scene = poser.Scene()<br></br>theFigure = scene.Figure("Figure 1")<br></br>theHip = theFigure.Actor("Hip")<br></br>theAnimationSet = scene.CreateAnimSet("Animate Elephant")<br></br>theAnimationSet.AddObjectRange(theHip,0,90)<br></br><br></br>scene.SetFrame(0)<br></br>theHip.ParameterByCode(poser.kParmCodeZTRAN).SetValue(0.0)<br></br>theHip.AddKeyFrame()<br></br>scene.SetFrame(14)<br></br>theHip.ParameterByCode(poser.kParmCodeZTRAN).SetValue(0.4)<br></br>theHip.AddKeyFrame()<br></br>scene.SetFrame(29)<br></br>theHip.ParameterByCode(poser.kParmCodeZTRAN).SetValue(0.8)<br></br>theHip.AddKeyFrame()<br></br>scene.SetFrame(44)<br></br>theHip.ParameterByCode(poser.kParmCodeZTRAN).SetValue(1.2)<br></br>theHip.AddKeyFrame()<br></br>scene.SetFrame(59)<br></br>theHip.ParameterByCode(poser.kParmCodeZTRAN).SetValue(1.6)<br></br>theHip.AddKeyFrame()<br></br><br></br># Redraw the scene<br></br>scene.DrawAll()