Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-08-06 02:26:00 +0400
committerCampbell Barton <ideasman42@gmail.com>2008-08-06 02:26:00 +0400
commit028d44c0751ca8bec0a404e0738b5b563222bf84 (patch)
tree98b5e3fb4cfe53daf00cd44bc44e6773eadf91c8 /source
parent553da831e6c7b772af5ee2fbe28758a31ac2c1dc (diff)
Made Mathutils its own module rather then GanmeLogic.Mathutils
Diffstat (limited to 'source')
-rw-r--r--source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp3
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp10
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.h1
4 files changed, 10 insertions, 6 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
index b3a3a47152a..7de3056e382 100644
--- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
+++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
@@ -335,7 +335,7 @@ extern "C" void StartKetsjiShell(struct ScrArea *area,
PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module.
initGameKeys();
initPythonConstraintBinding();
-
+ initMathutils();
if (sceneconverter)
{
@@ -602,6 +602,7 @@ extern "C" void StartKetsjiShellSimulation(struct ScrArea *area,
PyDict_SetItemString(dictionaryobject, "GameLogic", gameLogic); // Same as importing the module
initGameKeys();
initPythonConstraintBinding();
+ initMathutils();
if (sceneconverter)
{
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index b5ebffb9378..ab91f0cd43d 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -647,7 +647,7 @@ bool GPG_Application::startEngine(void)
PyDict_SetItemString(dictionaryobject, "GameLogic", initGameLogic(startscene)); // Same as importing the module
initGameKeys();
initPythonConstraintBinding();
-
+ initMathutils();
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 57ee52f9880..db4793de23d 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -738,9 +738,6 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook
ErrorObject = PyString_FromString("GameLogic.error");
PyDict_SetItemString(d, "error", ErrorObject);
- // Add Blender.Mathutils module, duplicate code :/
- PyDict_SetItemString(d, "Mathutils", Mathutils_Init("GameLogic.Mathutils"));
-
// XXXX Add constants here
/* To use logic bricks, we need some sort of constants. Here, we associate */
/* 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
TODO: register builtin modules properly by ExtendInittab */
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);
}
@@ -1176,6 +1173,11 @@ PyObject* initGameKeys()
return d;
}
+PyObject* initMathutils()
+{
+ return Mathutils_Init("Mathutils"); // Use as a top level module in BGE
+}
+
void PHY_SetActiveScene(class KX_Scene* scene)
{
gp_KetsjiScene = scene;
diff --git a/source/gameengine/Ketsji/KX_PythonInit.h b/source/gameengine/Ketsji/KX_PythonInit.h
index 41cf7fd67b3..f094a1ca575 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.h
+++ b/source/gameengine/Ketsji/KX_PythonInit.h
@@ -44,6 +44,7 @@ PyObject* initGameLogic(class KX_Scene* ketsjiscene);
PyObject* initGameKeys();
PyObject* initRasterizer(class RAS_IRasterizer* rasty,class RAS_ICanvas* canvas);
PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level);
+PyObject* initMathutils();
void exitGamePlayerPythonScripting();
PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level);
void exitGamePythonScripting();