"""Which functions does this Blender evaluate as SIMPLE driver expressions (no Python)? Headless test, no file saved.""" import bpy ob = bpy.data.objects.new("t", None) bpy.context.scene.collection.objects.link(ob) ob["a"] = 0.3 ob["b"] = 0.7 tests = ["a+b", "atan2(a,b)", "acos(a)", "asin(a)", "atan(a)", "sqrt(b)", "min(a,b)", "max(a,b,1)", "abs(a)", "a if a>b else b", "(a>b)*a + (a<=b)*b", "pow(a,2)", "a**2", "clamp(a,0,1)", "fmod(a,b)", "pi*a", "hypot(a,b)", "floor(a)", "copysign(1,a)", "radians(a)", "degrees(a)", "lerp(a,b,0.5)", "smoothstep(0,1,a)", "tan(a)", "exp(a)", "log(b)", "sin(a)*cos(b)", "-a", "(ab)", "a==b", "a!=b", "not a", "a and b", "signum(a)", "trunc(a)", "ceil(a)", "round(a)", "int(a)", "fabs(a)", "min(max(a,-0.9999),0.9999)", "acos(min(max(a,-1),1))"] fc = ob.driver_add("location", 0) d = fc.driver d.type = 'SCRIPTED' for nm in ("a", "b"): v = d.variables.new(); v.name = nm; v.type = 'SINGLE_PROP' v.targets[0].id_type = 'OBJECT'; v.targets[0].id = ob; v.targets[0].data_path = '["%s"]' % nm for t in tests: d.expression = t bpy.context.view_layer.update() print("EXPR %-28s simple=%s valid=%s" % (t, d.is_simple_expression, d.is_valid))