BGE Py API
* Removed modules Expression and CValue, neither were ever available. * Added GameLogic.EvalExpression(exp) from the Expression module, evaluates an expression like the expression controller (not sure if this is really that useful since python is far more advanced). * resetting the original blend file path didint work (own fault == -> =) * Py3.x PyModule_Create didnt allow importing since it didn't add to sys.modules, Looks like they want us to use init-tab array, but this doesn't suit us since it needs to be setup before python is initialized. * Documented GameLogic.globalDict
This commit is contained in:
@@ -1104,6 +1104,7 @@ PyObject *BGL_Init(const char *from)
|
||||
PyObject *mod, *dict, *item;
|
||||
#if (PY_VERSION_HEX >= 0x03000000)
|
||||
mod = PyModule_Create(&BGL_module_def);
|
||||
PyDict_SetItemString(PySys_GetObject("modules"), BGL_module_def.m_name, mod);
|
||||
#else
|
||||
mod= Py_InitModule(from, BGL_methods);
|
||||
#endif
|
||||
|
||||
@@ -99,6 +99,7 @@ PyObject *Geometry_Init(const char *from)
|
||||
|
||||
#if (PY_VERSION_HEX >= 0x03000000)
|
||||
submodule = PyModule_Create(&M_Geometry_module_def);
|
||||
PyDict_SetItemString(PySys_GetObject("modules"), M_Geometry_module_def.m_name, submodule);
|
||||
#else
|
||||
submodule = Py_InitModule3(from, M_Geometry_methods, M_Geometry_doc);
|
||||
#endif
|
||||
|
||||
@@ -139,6 +139,7 @@ PyObject *Mathutils_Init(const char *from)
|
||||
|
||||
#if (PY_VERSION_HEX >= 0x03000000)
|
||||
submodule = PyModule_Create(&M_Mathutils_module_def);
|
||||
PyDict_SetItemString(PySys_GetObject("modules"), M_Mathutils_module_def.m_name, submodule);
|
||||
#else
|
||||
submodule = Py_InitModule3(from, M_Mathutils_methods, M_Mathutils_doc);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user