Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/intern/bpy_interface.c
| Context not available. | |||||
| #include <Python.h> | #include <Python.h> | ||||
| #include "MEM_guardedalloc.h" | |||||
| #include "CLG_log.h" | #include "CLG_log.h" | ||||
| #include "MEM_guardedalloc.h" | |||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BLI_path_util.h" | #include "BLI_path_util.h" | ||||
| #include "BLI_fileops.h" | #include "BLI_fileops.h" | ||||
| Context not available. | |||||
| CLG_LOGREF_DECLARE_GLOBAL(BPY_LOG_CONTEXT, "bpy.context"); | CLG_LOGREF_DECLARE_GLOBAL(BPY_LOG_CONTEXT, "bpy.context"); | ||||
| CLG_LOGREF_DECLARE_GLOBAL(BPY_LOG_RNA, "bpy.rna"); | CLG_LOGREF_DECLARE_GLOBAL(BPY_LOG_RNA, "bpy.rna"); | ||||
| static CLG_LogRef LOG = { "bpy.interface" }; | |||||
| /* for internal use, when starting and ending python scripts */ | /* for internal use, when starting and ending python scripts */ | ||||
| /* in case a python script triggers another python call, stop bpy_context_clear from invalidating */ | /* in case a python script triggers another python call, stop bpy_context_clear from invalidating */ | ||||
| Context not available. | |||||
| PyGILState_Release(*gilstate); | PyGILState_Release(*gilstate); | ||||
| if (py_call_level < 0) { | if (py_call_level < 0) { | ||||
| fprintf(stderr, "ERROR: Python context internal state bug. this should not happen!\n"); | CLOG_ERROR(&LOG, "Python context internal state bug. this should not happen!"); | ||||
| } | } | ||||
| else if (py_call_level == 0) { | else if (py_call_level == 0) { | ||||
| /* XXX - Calling classes currently wont store the context :\, | /* XXX - Calling classes currently wont store the context :\, | ||||
| Context not available. | |||||
| G.f |= G_SCRIPT_AUTOEXEC_FAIL; | G.f |= G_SCRIPT_AUTOEXEC_FAIL; | ||||
| BLI_snprintf(G.autoexec_fail, sizeof(G.autoexec_fail), "Text '%s'", text->id.name + 2); | BLI_snprintf(G.autoexec_fail, sizeof(G.autoexec_fail), "Text '%s'", text->id.name + 2); | ||||
| printf("scripts disabled for \"%s\", skipping '%s'\n", BKE_main_blendfile_path(bmain), text->id.name + 2); | CLOG_INFO(&LOG, 1, "scripts disabled for \"%s\", skipping '%s'", BKE_main_blendfile_path(bmain), text->id.name + 2); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| Context not available. | |||||
| CLOG_INFO(BPY_LOG_CONTEXT, 1, "'%s' not a valid type", member); | CLOG_INFO(BPY_LOG_CONTEXT, 1, "'%s' not a valid type", member); | ||||
| } | } | ||||
| else { | else { | ||||
| CLOG_INFO(BPY_LOG_CONTEXT, 1, "'%s' not found\n", member); | CLOG_INFO(BPY_LOG_CONTEXT, 1, "'%s' not found", member); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| Context not available. | |||||