diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-06-05 02:32:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-06-05 02:32:15 +0400 |
commit | c8e19a6b25f4b32ef64ba23479d80febc7c95db9 (patch) | |
tree | d75b041184b3baa474863feb9d19b93bd8dd297b /source/blender/python | |
parent | fbb56ee99731bb788e89ce7c54706654a998e7ea (diff) |
numbutton python expression evaluation used driver dictionary, when EnableScriptlinks was disabled number
button input didnt
work. narrow down this test to the part of the pydriver module init that uses a blender textblock as a module. This should
should reload the pydriver dict whenever the "EnableScriptlinks" state changes. but for now working numbuttons is priority.
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/BPY_interface.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/python/BPY_interface.c b/source/blender/python/BPY_interface.c index c63fa28c46e..7c23c86d9ba 100644 --- a/source/blender/python/BPY_interface.c +++ b/source/blender/python/BPY_interface.c @@ -1222,7 +1222,7 @@ static int bpy_pydriver_create_dict(void) { PyObject *d, *mod; - if (bpy_pydriver_Dict || (G.f&G_DOSCRIPTLINKS)==0) return -1; + if (bpy_pydriver_Dict) return -1; d = PyDict_New(); if (!d) return -1; @@ -1259,15 +1259,16 @@ static int bpy_pydriver_create_dict(void) /* If there's a Blender text called pydrivers.py, import it. * Users can add their own functions to this module. */ - mod = importText("pydrivers"); /* can also use PyImport_Import() */ - if (mod) { - PyDict_SetItemString(d, "pydrivers", mod); - PyDict_SetItemString(d, "p", mod); - Py_DECREF(mod); + if (G.f&G_DOSCRIPTLINKS) { + mod = importText("pydrivers"); /* can also use PyImport_Import() */ + if (mod) { + PyDict_SetItemString(d, "pydrivers", mod); + PyDict_SetItemString(d, "p", mod); + Py_DECREF(mod); + } else { + PyErr_Clear(); + } } - else - PyErr_Clear(); - /* short aliases for some Get() functions: */ /* ob(obname) == Blender.Object.Get(obname) */ |