Made Mathutils its own module rather then GanmeLogic.Mathutils
This commit is contained in:
@@ -335,7 +335,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
|
|||||||
PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module.
|
PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module.
|
||||||
initGameKeys();
|
initGameKeys();
|
||||||
initPythonConstraintBinding();
|
initPythonConstraintBinding();
|
||||||
|
initMathutils();
|
||||||
|
|
||||||
if (sceneconverter)
|
if (sceneconverter)
|
||||||
{
|
{
|
||||||
@@ -602,6 +602,7 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area,
|
|||||||
PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module
|
PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module
|
||||||
initGameKeys();
|
initGameKeys();
|
||||||
initPythonConstraintBinding();
|
initPythonConstraintBinding();
|
||||||
|
initMathutils();
|
||||||
|
|
||||||
if (sceneconverter)
|
if (sceneconverter)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -647,7 +647,7 @@ bool GPG_Application::startEngine(void)
|
|||||||
PyDict_SetItemString(dictionaryobject, "GameLogic", initGameLogic(startscene)); // Same as importing the module
|
PyDict_SetItemString(dictionaryobject, "GameLogic", initGameLogic(startscene)); // Same as importing the module
|
||||||
initGameKeys();
|
initGameKeys();
|
||||||
initPythonConstraintBinding();
|
initPythonConstraintBinding();
|
||||||
|
initMathutils();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -738,9 +738,6 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook
|
|||||||
ErrorObject = PyString_FromString("GameLogic.error");
|
ErrorObject = PyString_FromString("GameLogic.error");
|
||||||
PyDict_SetItemString(d, "error", ErrorObject);
|
PyDict_SetItemString(d, "error", ErrorObject);
|
||||||
|
|
||||||
// Add Blender.Mathutils module, duplicate code :/
|
|
||||||
PyDict_SetItemString(d, "Mathutils", Mathutils_Init("GameLogic.Mathutils"));
|
|
||||||
|
|
||||||
// XXXX Add constants here
|
// XXXX Add constants here
|
||||||
/* To use logic bricks, we need some sort of constants. Here, we associate */
|
/* To use logic bricks, we need some sort of constants. Here, we associate */
|
||||||
/* constants and sumbolic names. Add them to dictionary d. */
|
/* constants and sumbolic names. Add them to dictionary d. */
|
||||||
@@ -883,7 +880,7 @@ PyObject *KXpy_import(PyObject *self, PyObject *args)
|
|||||||
/* quick hack for GamePython modules
|
/* quick hack for GamePython modules
|
||||||
TODO: register builtin modules properly by ExtendInittab */
|
TODO: register builtin modules properly by ExtendInittab */
|
||||||
if (!strcmp(name, "GameLogic") || !strcmp(name, "GameKeys") || !strcmp(name, "PhysicsConstraints") ||
|
if (!strcmp(name, "GameLogic") || !strcmp(name, "GameKeys") || !strcmp(name, "PhysicsConstraints") ||
|
||||||
!strcmp(name, "Rasterizer")) {
|
!strcmp(name, "Rasterizer") || !strcmp(name, "Mathutils")) {
|
||||||
return PyImport_ImportModuleEx(name, globals, locals, fromlist);
|
return PyImport_ImportModuleEx(name, globals, locals, fromlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1176,6 +1173,11 @@ PyObject* initGameKeys()
|
|||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PyObject* initMathutils()
|
||||||
|
{
|
||||||
|
return Mathutils_Init("Mathutils"); // Use as a top level module in BGE
|
||||||
|
}
|
||||||
|
|
||||||
void PHY_SetActiveScene(class KX_Scene* scene)
|
void PHY_SetActiveScene(class KX_Scene* scene)
|
||||||
{
|
{
|
||||||
gp_KetsjiScene = scene;
|
gp_KetsjiScene = scene;
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ PyObject* initGameLogic(class KX_Scene* ketsjiscene);
|
|||||||
PyObject* initGameKeys();
|
PyObject* initGameKeys();
|
||||||
PyObject* initRasterizer(class RAS_IRasterizer* rasty,class RAS_ICanvas* canvas);
|
PyObject* initRasterizer(class RAS_IRasterizer* rasty,class RAS_ICanvas* canvas);
|
||||||
PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level);
|
PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level);
|
||||||
|
PyObject* initMathutils();
|
||||||
void exitGamePlayerPythonScripting();
|
void exitGamePlayerPythonScripting();
|
||||||
PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level);
|
PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level);
|
||||||
void exitGamePythonScripting();
|
void exitGamePythonScripting();
|
||||||
|
|||||||
Reference in New Issue
Block a user