Added blender python module to game engine.
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>
Fri, 2 Apr 2004 13:21:04 +0000 (13:21 +0000)
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>
Fri, 2 Apr 2004 13:21:04 +0000 (13:21 +0000)
Updated Scons & Makefile

SConstruct
source/gameengine/Ketsji/KX_PythonInit.cpp
source/gameengine/Ketsji/Makefile
source/gameengine/Ketsji/SConscript

index 02e509b3c83f6db8fcda3f29da6f3ae1179285fa..58063d63d31cd1a440aa5920740d17642c5b9edf 100644 (file)
@@ -858,7 +858,6 @@ libraries = (['blender_creator',
               'blender_imbuf',
               'blender_avi',
               'blender_blenlib',
-              'blender_python',
               'blender_makesdna',
               'blender_kernel',
               'blender_BSP',
@@ -910,7 +909,7 @@ if user_options_dict['BUILD_GAMEENGINE'] == 1:
                                'PHY_Physics'])
         link_env.Append (LIBS=user_options_dict['ODE_LIBRARY'])
         link_env.Append (LIBPATH=user_options_dict['ODE_LIBPATH'])
-
+link_env.Append (LIBS=['blender_python'])
 link_env.Append (LIBS=user_options_dict['PYTHON_LIBRARY'])
 link_env.Append (LIBPATH=user_options_dict['PYTHON_LIBPATH'])
 link_env.Append (LINKFLAGS=user_options_dict['PYTHON_LINKFLAGS'])
index 7c1b9928f5fc12fd51f770e2e6a49470eef74aa3..efd00f24a0c142c58d6e1dc006faeab5bc777d55 100644 (file)
@@ -54,6 +54,7 @@
 #include "KX_Scene.h"
 #include "SND_DeviceManager.h"
 
+#include "BPY_extern.h"
 
 static void setSandbox(TPythonSecurityLevel level);
 
@@ -628,7 +629,7 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev
        Py_SetProgramName(pname.Ptr());
        Py_NoSiteFlag=1;
        Py_FrozenFlag=1;
-       Py_Initialize();
+       BPY_start_python();
        setSandbox(level);
 
        PyObject* moduleobj = PyImport_AddModule("__main__");
@@ -639,7 +640,7 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev
 
 void exitGamePythonScripting()
 {
-       Py_Finalize();
+       BPY_end_python();
 }
 
 
index f12e1c08ed400dae01c59586c9c465cef46ec285..d5dee041e3e215c3ae28487db10ed4786336a7cb 100644 (file)
@@ -39,7 +39,7 @@ include nan_compile.mk
 CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
 
 CPPFLAGS += $(OGL_CPPFLAGS)
-CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
+CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION) -I../../blender/python
 CPPFLAGS += -I$(NAN_STRING)/include    
 CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include    
 CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_SUMO) -I$(NAN_MOTO)/include
index 4789138d1c236ee17ca6df21fbe182a6b45303ae..8f8b868a8771dafed33206a403f913bf0425fbbb 100644 (file)
@@ -85,6 +85,7 @@ ketsji_env.Append (CPPPATH = ['.',
                               '#source/blender',
                               '#source/blender/include',
                               '#source/blender/makesdna',
+                              '#source/blender/python',
                               '#source/gameengine/Rasterizer',
                               '#source/gameengine/GameLogic',
                               '#source/gameengine/Expressions',