1
# This script defines functions to be used directly in drivers expressions to
2
# extend the builtin set of python functions.
4
# This can be executed on manually or set to 'Register' to
5
# initialize thefunctions on file load.
10
""" Simple function call:
20
def slow_value(value, fac, uuid):
21
""" Delay the value by a factor, use a unique string to allow
22
use in multiple drivers without conflict:
24
slow_value(val, 0.5, "my_value")
26
value_prev = uuid_store.get(uuid, value)
27
uuid_store[uuid] = value_new = (value_prev * fac) + (value * (1.0 - fac))
33
# Add variable defined in this script into the drivers namespace.
34
bpy.app.driver_namespace["invert"] = invert
35
bpy.app.driver_namespace["slow_value"] = slow_value