diff --git a/SConstruct b/SConstruct index 02e509b3c83..58063d63d31 100644 --- a/SConstruct +++ b/SConstruct @@ -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']) diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 7c1b9928f5f..efd00f24a0c 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -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(); } diff --git a/source/gameengine/Ketsji/Makefile b/source/gameengine/Ketsji/Makefile index f12e1c08ed4..d5dee041e3e 100644 --- a/source/gameengine/Ketsji/Makefile +++ b/source/gameengine/Ketsji/Makefile @@ -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 diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index 4789138d1c2..8f8b868a877 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -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',