From a0cece42c646df39c858223b0361b7dfe0d44dd8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 5 Aug 2010 03:25:45 +0000 Subject: bugfix [#23148] "ImportError: __import__ not found" on changing Render FPS The BGE was getting the namespace dict directly from __main__ which conflicts with my recent fix to get the pickle module working which to overwrote the __main__ module on script execution. Simple fix is to have the BGE and Blender use the same method of getting namespaces. Renamed CreateGlobalDictionary() to bpy_namespace_dict_new() and moved into bpy_internal_import.c pickle still wont work in the BGE since we make a copy of __main__ namespace but for speed would rather not have to replace the __main__ module many times per second. --- source/blender/python/generic/bpy_internal_import.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/python/generic/bpy_internal_import.h') diff --git a/source/blender/python/generic/bpy_internal_import.h b/source/blender/python/generic/bpy_internal_import.h index 37136d46c9e..83e05fd6ded 100644 --- a/source/blender/python/generic/bpy_internal_import.h +++ b/source/blender/python/generic/bpy_internal_import.h @@ -60,5 +60,7 @@ extern PyMethodDef bpy_reload_meth[]; struct Main *bpy_import_main_get(void); void bpy_import_main_set(struct Main *maggie); +/* name namespace function for bpy & bge */ +PyObject *bpy_namespace_dict_new(const char *filename); #endif /* EXPP_bpy_import_h */ -- cgit v1.2.3