Revision: 15981
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=15981
Author:   campbellbarton
Date:     2008-08-06 00:26:00 +0200 (Wed, 06 Aug 2008)

Log Message:
-----------
Made Mathutils its own module rather then GanmeLogic.Mathutils

Modified Paths:
--------------
    trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
    trunk/blender/source/gameengine/GamePlayer/ActiveX/BlenderPlayerCtl.cpp
    trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
    
trunk/blender/source/gameengine/GamePlayer/netscape/src/ketsji/KXH_ketsji_hooks.cpp
    trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp
    trunk/blender/source/gameengine/Ketsji/KX_PythonInit.h

Modified: 
trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
===================================================================
--- trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp     
2008-08-05 22:23:38 UTC (rev 15980)
+++ trunk/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp     
2008-08-05 22:26:00 UTC (rev 15981)
@@ -335,8 +335,8 @@
                        PyDict_SetItemString(dictionaryobject, "GameLogic", 
gameLogic); // Same as importing the module.
                        initGameKeys();
                        initPythonConstraintBinding();
+                       initMathutils();
 
-
                        if (sceneconverter)
                        {
                                // convert and add scene
@@ -602,6 +602,7 @@
                        PyDict_SetItemString(dictionaryobject, "GameLogic", 
gameLogic); // Same as importing the module
                        initGameKeys();
                        initPythonConstraintBinding();
+                       initMathutils();
 
                        if (sceneconverter)
                        {

Modified: 
trunk/blender/source/gameengine/GamePlayer/ActiveX/BlenderPlayerCtl.cpp
===================================================================
--- trunk/blender/source/gameengine/GamePlayer/ActiveX/BlenderPlayerCtl.cpp     
2008-08-05 22:23:38 UTC (rev 15980)
+++ trunk/blender/source/gameengine/GamePlayer/ActiveX/BlenderPlayerCtl.cpp     
2008-08-05 22:26:00 UTC (rev 15981)
@@ -669,9 +669,9 @@
 
                        initRasterizer(m_rasterizer, m_canvas);                 
                        PyDict_SetItemString(m_dictionaryobject, "GameLogic", 
initGameLogic(startscene)); // Same as importing the module
-                       initGameKeys();
-                       
+                       initGameKeys();                 
                        initPythonConstraintBinding();
+                       initMathutils();
                        
                        m_sceneconverter->ConvertScene(
                                startscenename,

Modified: trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
===================================================================
--- trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp        
2008-08-05 22:23:38 UTC (rev 15980)
+++ trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp        
2008-08-05 22:26:00 UTC (rev 15981)
@@ -647,11 +647,11 @@
                PyDict_SetItemString(dictionaryobject, "GameLogic", 
initGameLogic(startscene)); // Same as importing the module
                initGameKeys();
                initPythonConstraintBinding();
+               initMathutils();
 
 
 
 
-
                m_sceneconverter->ConvertScene(
                        startscenename,
                        startscene,

Modified: 
trunk/blender/source/gameengine/GamePlayer/netscape/src/ketsji/KXH_ketsji_hooks.cpp
===================================================================
--- 
trunk/blender/source/gameengine/GamePlayer/netscape/src/ketsji/KXH_ketsji_hooks.cpp
 2008-08-05 22:23:38 UTC (rev 15980)
+++ 
trunk/blender/source/gameengine/GamePlayer/netscape/src/ketsji/KXH_ketsji_hooks.cpp
 2008-08-05 22:26:00 UTC (rev 15981)
@@ -570,6 +570,7 @@
                PyDict_SetItemString(dictionaryobject, "GameLogic", 
initGameLogic(startscene)); // Same as importing the module
                initGameKeys();
                initPythonConstraintBinding();
+               initMathutils();
                
                KXH_log_entry("APH_initialize_gameengine:: will enter kx 
engine");
                

Modified: trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp    2008-08-05 
22:23:38 UTC (rev 15980)
+++ trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp    2008-08-05 
22:26:00 UTC (rev 15981)
@@ -738,9 +738,6 @@
        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 @@
        /* 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 @@
        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;

Modified: trunk/blender/source/gameengine/Ketsji/KX_PythonInit.h
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_PythonInit.h      2008-08-05 
22:23:38 UTC (rev 15980)
+++ trunk/blender/source/gameengine/Ketsji/KX_PythonInit.h      2008-08-05 
22:26:00 UTC (rev 15981)
@@ -44,6 +44,7 @@
 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();


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to