diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2012-06-21 09:41:06 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2012-06-21 09:41:06 +0400 |
commit | d8e2c475a0dbfb9de31c363f76899435d80cff8f (patch) | |
tree | bf96da27100e88225895bb58e489934494b10191 /source/gameengine/Ketsji | |
parent | 501922782fec2cd626e3bea13d67f9e225ab025e (diff) |
Fix for [#31396] "bge.logic.LibLoad fails to import text blocks" reported by Leonard Ritter.
Blender's import function check's the Text datablocks in main for additional modules for importing. However, libloaded scenes were 1) not loading Text datablocks and 2) not letting bpy know about them. Text datablocks are now loaded if a Scene is loaded and bpy can now looking through extra Mains to find additional modules.
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 10 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.h | 3 |
2 files changed, 13 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 28c4630c43e..2a648303c52 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1821,6 +1821,16 @@ static void restorePySysObjects(void) // PyObject_Print(sys_path, stderr, 0); } +void addImportMain(struct Main *maggie) +{ + bpy_import_main_extra_add(maggie); +} + +void removeImportMain(struct Main *maggie) +{ + bpy_import_main_extra_remove(maggie); +} + // Copied from bpy_interface.c static struct _inittab bge_internal_modules[]= { {(char *)"mathutils", PyInit_mathutils}, diff --git a/source/gameengine/Ketsji/KX_PythonInit.h b/source/gameengine/Ketsji/KX_PythonInit.h index d8346018b55..866681b9da7 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.h +++ b/source/gameengine/Ketsji/KX_PythonInit.h @@ -61,6 +61,9 @@ int saveGamePythonConfig( char **marshal_buffer); int loadGamePythonConfig(char *marshal_buffer, int marshal_length); #endif +void addImportMain(struct Main *maggie); +void removeImportMain(struct Main *maggie); + class KX_KetsjiEngine; class KX_Scene; |