If I add a handler, I use:


If I want to remove it, I usually use the cheap way out since I still haven't learned to do it properly (I was young and I needed the money):


Usable hack on a remote island but if by chance any addon or script uses the same handler, then disaster ensues.

Now, with drivers it's so much easier for this addled brain of mine:


bpy.app.driver_namespace['curtis'] = captainFuture



Nothing to remember but a string and a location.

Is there a binding reason why both approaches are different? Or asked differently and selfishly: Why not use dictionaries all the time?


1 Answer 1


Handlers are callback handlers that work on application level. Drivers work on data level. What does this mean?

app.handlers also work without having any data to work with. For drivers you will always need to add the driver to existing data in blender. For example an attribute on your object.

The app.driver_namespace contains some value modification functions you can use within your drivers. By itself it doesn't do a thing. It needs to be triggered by the animation system.

def mul2(value): return value*2
bpy.app.driver_namespace['my_function'] = mul2

Now you can use this function inside a driver python expression


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .