forked from bartvdbraak/blender
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.
This commit is contained in:
parent
fbb56ee997
commit
c8e19a6b25
@ -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. */
|
||||
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
|
||||
} else {
|
||||
PyErr_Clear();
|
||||
|
||||
}
|
||||
}
|
||||
/* short aliases for some Get() functions: */
|
||||
|
||||
/* ob(obname) == Blender.Object.Get(obname) */
|
||||
|
Loading…
Reference in New Issue
Block a user