functionality fix

Originally the only way to run scripts automatically was with scriptlinks, which could be disabled for loading untrusted blend files.
Since then PyDrivers and PyConstraints would run even when G.f&G_DOSCRIPTLINKS was disabled.
Gensher, Theeth and Ianwill agree its acceptable to reuse the flag for other areas python runs automatically.

PyNodes still have no way to be disabled, (todo before 2.46a)
This commit is contained in:
2008-06-01 16:13:04 +00:00
parent 8937989a91
commit 652ee1e31b
3 changed files with 6 additions and 4 deletions

View File

@@ -1222,7 +1222,7 @@ static int bpy_pydriver_create_dict(void)
{
PyObject *d, *mod;
if (bpy_pydriver_Dict) return -1;
if (bpy_pydriver_Dict || (G.f&G_DOSCRIPTLINKS)==0) return -1;
d = PyDict_New();
if (!d) return -1;
@@ -1998,7 +1998,7 @@ float BPY_pydriver_eval(IpoDriver *driver)
int setitem_retval;
PyGILState_STATE gilstate;
if (!driver) return result;
if (!driver || (G.f&G_DOSCRIPTLINKS)==0) return result;
expr = driver->name; /* the py expression to be evaluated */
if (!expr || expr[0]=='\0') return result;