[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31100] trunk/blender/source/gameengine/ Ketsji/KX_PythonInit.cpp: fix for fake python bge.* module, this is really nasty temp py code! (not a good example)

Campbell Barton ideasman42 at gmail.com
Fri Aug 6 14:46:23 CEST 2010


Revision: 31100
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31100
Author:   campbellbarton
Date:     2010-08-06 14:46:22 +0200 (Fri, 06 Aug 2010)

Log Message:
-----------
fix for fake python bge.* module, this is really nasty temp py code! (not a good example)

Modified Paths:
--------------
    trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp

Modified: trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp	2010-08-06 08:48:40 UTC (rev 31099)
+++ trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp	2010-08-06 12:46:22 UTC (rev 31100)
@@ -1990,7 +1990,7 @@
 	initVideoTexture();
 
 	/* could be done a lot more nicely, but for now a quick way to get bge.* working */
-	PyRun_SimpleString("__import__('sys').modules['bge']=[mod for mod in (type(__builtins__)('bge'), ) if mod.__dict__.update({'logic':__import__('GameLogic'), 'render':__import__('Rasterizer'), 'events':__import__('GameKeys'), 'constraints':__import__('PhysicsConstraints'), 'types':__import__('GameTypes')}) is None][0]");
+	PyRun_SimpleString("sys = __import__('sys');mod = sys.modules['bge'] = type(sys)('bge');mod.__dict__.update({'logic':__import__('GameLogic'), 'render':__import__('Rasterizer'), 'events':__import__('GameKeys'), 'constraints':__import__('PhysicsConstraints'), 'types':__import__('GameTypes')})");
 }
 
 static struct PyModuleDef Rasterizer_module_def = {





More information about the Bf-blender-cvs mailing list