Forum: Poser - OFFICIAL


Subject: Animating Using Python

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


Enivob posted Thu, 10 June 2004 at 12:40 PM

Hi All, I am an experienced scripter in MaxScript and MEL and now i am dabbling in Python. I know what I want to do. I have the DAZ african elephant and I want to build a walk designer for this quadraped. My first attempt is simply to translate the hip in the Z direction. So I want to record Z tran keys incrementing over time. I have some code here, that does not work. # My attempt to try to use python to animate a quadraped. scene = poser.Scene() theFigure = scene.Figure("Figure 1") theHip = theFigure.Actor("Hip") theAnimationSet = scene.CreateAnimSet("Animate Elephant") theAnimationSet.AddObjectRange(theHip,0,90) # Animate the hip forward. I thought you may have to add keys before you set them? AddKeyFrame(0) AddKeyFrame(14) AddKeyFrame(29) AddKeyFrame(44) AddKeyFrame(59) scene.SetFrame(0) theHip.SetParameter(poser.kParmCodeZTRAN, 0.0) scene.SetFrame(14) theHip.SetParameter(poser.kParmCodeZTRAN, 0.4) scene.SetFrame(29) theHip.SetParameter(poser.kParmCodeZTRAN, 0.8) scene.SetFrame(44) theHip.SetParameter(poser.kParmCodeZTRAN, 1.2) scene.SetFrame(59) theHip.SetParameter(poser.kParmCodeZTRAN, 1.6) # Redraw the scene scene.DrawAll() I'm wondering what I am doing wrong, am I close? The documentation is sketchy at best. Any reply is apreciated. Thanks! Enivob