[Bf-blender-cvs] [15cd222] master: BGE: python API initialization cleanup

Ines Almeida noreply at git.blender.org
Tue Feb 3 16:49:14 CET 2015


Commit: 15cd2222702dabcb29cfba6f072b84ed1c52ec11
Author: Ines Almeida
Date:   Tue Jan 13 16:53:21 2015 +0100
Branches: master
https://developer.blender.org/rB15cd2222702dabcb29cfba6f072b84ed1c52ec11

BGE: python API initialization cleanup

The goal of these changes is to Close T40132 and to get rid of the 'PyRun_SimpleString'

Hilighted changes are:
- consistent naming and initialization of BGE submodules
- initialization of the 'bge' module as a proper module
- using PyDoc_STRVAR instead of static char*
- generic cleanup (unused arguments, logica ordering, naming and whitespace)

Reviewers: campbellbarton

Maniphest Tasks: T40132

Differential Revision: https://developer.blender.org/D983

===================================================================

M	source/gameengine/Ketsji/KX_PythonInit.cpp

===================================================================

diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 011111e..652dad5 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -2192,6 +2192,10 @@ PyObject *initGamePlayerPythonScripting(Main *maggie, int argc, char** argv)
 
 	bpy_import_init(PyEval_GetBuiltins());
 
+	bpy_import_main_set(maggie);
+
+	initPySysObjects(maggie);
+
 	PyDict_SetItemString(PyImport_GetModuleDict(), "bge", initBGE());
 
 	/* mathutils types are used by the BGE even if we don't import them */
@@ -2208,10 +2212,6 @@ PyObject *initGamePlayerPythonScripting(Main *maggie, int argc, char** argv)
 	}
 #endif
 
-	bpy_import_main_set(maggie);
-
-	initPySysObjects(maggie);
-
 	initPyTypes();
 
 	first_time = false;




More information about the Bf-blender-cvs mailing list