Ipo objects and handles

I’m having my procedural AI combat system write location IPOs for the actors in order to record their movements.

the object “actor” is any active soldier, with an IPO with LocX and LocY curves already defined and begun. The interpolation method of the IPO is previously set to Bezier.

#add a point to the IPO
actorIpo=actor.getIpo()
actorIpoX=actorIpo.getCurve('LocX')
actorIpoY=actorIpo.getCurve('LocY')
thisFrame=Blender.Get('curframe')
actorIpoX.addBezier((thisFrame,newX))
actorIpoY.addBezier((thisFrame,newY))

This works find for writing the actual points on the IPO curve. My problem is with the handles. When I generat location keys with this code, the handles on the Bezier points are terrible. I can’t find a clear definition, either in the API docs or on the boards, as to how I can create these points with better handle control. Alternatively, if there is a Python equivalent of SHIFT-H, which auto-aligns point handles when you’re editing a bezier in an IPO window, that would be great. Can anyone give me a suggestion, or point me some documentation that I missed?

I had the same problem when creating an updated version of the icarus script for someone. It used to be possible with the old python api (it’s even in the old 1.80 docs), you could set the handle types directly. But in the new api this doesn’t seem implemented yet, the only solution I could find was to set the interpolation to ‘Linear’. Not very smooth, but at least there are no horrible jumps in the curve between points.

Thanks for the info. Just this morning I dug into the Python API stuff in the CVS, and addBezier indeed only takes frame and location info, then does a simple ±1 to each to generate the handle points. I’ve posted a request on the .org boards to update this as it makes IPO manipulation via Python almost useless.