Fix drivers showing "Python restricted for security" when they weren't

Regression from [0], drivers were tagged as being disabled with a flag
that was never cleared. Causing the label to be displayed for files
where the expressions were enabled and in use.

Resolve by clearing this flag on file load and when re-compiling
expressions - since an expressions block flag may be cleared if it
becomes a simple expression.

[0]: 1a8053939b
This commit is contained in:
Campbell Barton
2024-07-22 10:33:35 +10:00
parent 1404a95dde
commit e2bc41598d
2 changed files with 4 additions and 1 deletions

View File

@@ -527,6 +527,7 @@ float BPY_driver_exec(PathResolvedRNA *anim_rna,
printf("skipping driver '%s', automatic scripts are disabled\n", expr);
}
driver_orig->flag |= DRIVER_FLAG_PYTHON_BLOCKED;
return 0.0f;
}
#else
@@ -581,6 +582,8 @@ float BPY_driver_exec(PathResolvedRNA *anim_rna,
/* Maybe this can be removed but for now best keep until were sure. */
driver_orig->flag |= DRIVER_FLAG_RENAMEVAR;
driver_orig->flag &= ~DRIVER_FLAG_PYTHON_BLOCKED;
#ifdef USE_BYTECODE_WHITELIST
is_recompile = true;
#endif