From 02cc80691d71ea305780655d3b0d4cd4530db9c7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 27 Nov 2010 02:39:51 +0000 Subject: python access to driver namespace, rather then have a textblock defined for drivers allow scripts to add functions directly. - bpy.app.driver_namespace, read-only dictionary, edit in-place. - reset on file load and new file. - on errors the namespace used to be reset, this should not be needed. simple example. def driverFunc(val): return val * val bpy.app.driver_namespace['driverFunc'] = driverFunc ... now all drivers can access this function. --- source/blender/python/BPY_extern.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/python/BPY_extern.h') diff --git a/source/blender/python/BPY_extern.h b/source/blender/python/BPY_extern.h index 91ca89ac894..466d8d3413d 100644 --- a/source/blender/python/BPY_extern.h +++ b/source/blender/python/BPY_extern.h @@ -118,7 +118,7 @@ extern "C" { // int BPY_do_spacehandlers(struct ScrArea *sa, unsigned short event, // short eventValue, unsigned short space_event); // -// void BPY_pydriver_update(void); + void BPY_reset_driver(void); float BPY_eval_driver(struct ChannelDriver *driver); // int BPY_eval_button(struct bContext *C, const char *expr, double *value); -- cgit v1.2.3