Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/intern/bpy_interface.c')
-rw-r--r--source/blender/python/intern/bpy_interface.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index 75827ce8bbf..c39168779fd 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -398,6 +398,10 @@ void BPY_python_end(void)
void BPY_python_reset(bContext *C)
{
+ /* unrelated security stuff */
+ G.f &= ~(G_SCRIPT_AUTOEXEC_FAIL | G_SCRIPT_AUTOEXEC_FAIL_QUIET);
+ G.autoexec_fail[0] = '\0';
+
BPY_driver_reset();
BPY_app_handlers_reset(false);
BPY_modules_load_user(C);
@@ -725,7 +729,12 @@ void BPY_modules_load_user(bContext *C)
for (text = bmain->text.first; text; text = text->id.next) {
if (text->flags & TXT_ISSCRIPT && BLI_testextensie(text->id.name + 2, ".py")) {
if (!(G.f & G_SCRIPT_AUTOEXEC)) {
- printf("scripts disabled for \"%s\", skipping '%s'\n", bmain->name, text->id.name + 2);
+ if (!(G.f & G_SCRIPT_AUTOEXEC_FAIL_QUIET)) {
+ G.f |= G_SCRIPT_AUTOEXEC_FAIL;
+ BLI_snprintf(G.autoexec_fail, sizeof(G.autoexec_fail), "Register Text '%s'", text->id.name + 2);
+
+ printf("scripts disabled for \"%s\", skipping '%s'\n", bmain->name, text->id.name + 2);
+ }
}
else {
PyObject *module = bpy_text_import(text);