# Python drivers and command-line render

I'm using a driver with scripted expression to create chaotically swinging pendulum.

One empty is used as a pivot point, the second as a pendulum controller, and some mesh linked to second empty as a child.

The second empty has a constraint to keep it a constant distance from the first empty, then I did some movement in the horizontal plane by F-curves to simulate swinging. Then I wrote PyDrivers to make the second empty automatically rotate to keep the local Z axis directed to first empty.

Using TrackTo is good in some cases, but not this one. When the pendulum swings near the vertical axis it automatically rotates about 180 degrees around the local Z axis. So it is hard to clean up this animation by manual compensation. It is somehow connected with gimbal problems.

I wrote two drivers for X and Y rotation (like atan(X/dist)), I changed the axis order to ZYX to allow the pendulum to rotate around local Z axis correctly.

After that I worked on a remote host with Blender 2.69 through the command-line to render the animation.

Every piece of animation has the same problem: the first frame driver is not working. I tested a lot of sequences and every time only first frame was not calculated by driver.

Well I have workaround to render first frames manually but this is a solution, because I have to render a heavy pile of animation. But I'm not sure enough that it is a bug.

Demonstration scene is here: http://www.pasteall.org/blend/25644

• Seems to work for me.. I assume you did run blender with the -y flag?
– gandalf3
Dec 10 '13 at 20:42
• I did it with --enable-autoexec, because switching checkbox "auto run python scripts" didn't took effect in my case at all. And the problem that python driver is workung for all frames in sequence except first one. Dec 11 '13 at 7:58
• strangely enough, i have a related (or the same) problem. i have some drivers setup to create the rotation of some spheres rolling on a floor. when rendering frames manually, it seems fine, but when rendering animation or per commandline (i would really like to use the render farm i have access to!) it does not sometimes. the behavior looks completely random to me. Jul 4 '17 at 21:12

• What is a floating bug ? Mar 12 '15 at 11:41