One-line python IPO driver

I need some help getting an IPO driver to work. The documentation is scarce, and I cannot find help for my problem. I hope this is the right place.

I have Windows XP, Blender 2.47, and Python 2.5.2 installed. Blender reports finding Python upon launch.

I started with a new, default blender scene. I added a Loc keyframe to frame one, then went to the IPO window, selected the LocX curve, and pressed “N”. I added a driver, selected the button for a one-line python driver, then tried various forms of getting my cube to move back and forth following a sine wave:

m.sin(2 * m.pi * b.Get(“curframe”) / 50)

This should result in values from -1 to 1, moving the cube along the X axis, in one cycle form frame 1 to frame 50. My math may be a bit off, I’m assuming that the sine function takes radians, although I tried it using degrees.

It does not seem to work properly.

When my expression is invalid (typo, etc) Blender reports it as such both in the GUI and the console. When it is correct, I get no feedback.

The limited documentation I have been able to find is not very clear. Most tutorials cover drivers using values from other objects, I have not been able to find much in the way of python expressions.

Please help me - I need my object to cycle back and forth using the results from a sine function in my animation.

Thank you,
Steve

I don’t think you should add the LocX keyframe. Add the cube, in the IPO window click on the LocX box from the list on the right-hand side. Now press n and add the pydriver.

That did it!

Thank you for the help!