Commonly Ignored Feature #12: #drivers

drivers

Here’s an interesting one. Drivers can be created quickly by typing the python expression directly in the slider of some value, preceded by a hash.

You’ve probably seen many folk typing #frame into the Seed property for cycles renders, but it’s capable of a whole lot more than that. The simple example above uses the same ‘frame’ property, but multiplied by 0.2 to make a slow rotation* of an Empty that the camera is parented to. Instant turntable!

Since it uses python, almost anything is possible. Using #bpy.data.objects[‘objectname’] would give you access to any properties an object or its data has.

One slight disadvantage is that these expressions are only evaluated during animation, not in realtime like your usual transformation drivers.

* If you’re observant, you might be confused as to why the the rotation value is so high. If 0.2 * 5 frames is just 1 degree, how come on frame 5 it’s already nearly 60 degrees and growing fast? This is simply because Blender stores and sets rotations in radians, and only displays the values in the more intuitive degree unit.

2 thoughts on “Commonly Ignored Feature #12: #drivers

  1. This can be useful, but I try to avoid drivers as far as I can (even if they’re useful!)..
    I even try to avoid using #frame for seeds now (I loved it at first), instead I just add keyframes!
    Why? Because it’s less hassle. When you use #frame you need to reload your .blend to treat it as a “trusted source”.
    Yes, you can check trusted source when you open the file, but this isn’t available in the “recent files” list. And Yes: you can reload the file as trusted, but: 1. it’s easy to miss/forget, 2. if you worked with the file for a while you might don’t want to reload it (you’ll lose undo and your renders saved in render slots*).
    Also, when you’re rendering your animation, it’s easy to miss the fact that you need to reload to enable the driver (especially if Blender crashed, you need to start the render and you’re in a hurry. It’s very easy to miss that small warning at the top..).

    But the main question is: Why isn’t a “built-in function” (as #frame is..) treated as “trusted”??

    (* Might not seem like a big thing but when you’ve done multiple test renders and trying to perfect your scene, it can be quite irritating to loose those renders)

  2. I’ve never heard of this (animating the seed value.) I assume that’s to eliminate the grainy look? I’ll have to experiment with it over the weekend.