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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-05-04 12:55:54 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-05-04 12:55:54 +0400
commit2f7cd19ff520ff5a1a0f80a55cc5e68c802b7df5 (patch)
treed679af8428bb91e59c4cd92fd154a598618f0258 /source/gameengine/Ketsji/KX_PythonInit.cpp
parent9248da811e7e0c1e8945d85a6520e74678d9e6c0 (diff)
print BGE Py api warnings only once to avoid flooding the terminal and slowing the game down too much, resets on loading scenes/blendfiles and restarting the game engine.
Diffstat (limited to 'source/gameengine/Ketsji/KX_PythonInit.cpp')
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index 18fd990dc51..8eb8956cfe2 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -1123,8 +1123,8 @@ PyObject* initGameLogic(KX_KetsjiEngine *engine, KX_Scene* scene) // quick hack
gp_KetsjiScene = scene;
gUseVisibilityTemp=false;
-
-
+
+ PyObjectPlus::ClearDeprecationWarning(); /* Not that nice to call here but makes sure warnings are reset between loading scenes */
/* Use existing module where possible
* be careful not to init any runtime vars after this */
@@ -1697,6 +1697,8 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur
first_time = false;
+ PyObjectPlus::ClearDeprecationWarning();
+
PyObject* moduleobj = PyImport_AddModule("__main__");
return PyModule_GetDict(moduleobj);
}
@@ -1710,6 +1712,7 @@ void exitGamePlayerPythonScripting()
Py_Finalize();
bpy_import_main_set(NULL);
+ PyObjectPlus::ClearDeprecationWarning();
}
@@ -1736,6 +1739,8 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev
/* clear user defined modules that may contain data from the last run */
clearGameModules();
+ PyObjectPlus::NullDeprecationWarning();
+
PyObject* moduleobj = PyImport_AddModule("__main__");
return PyModule_GetDict(moduleobj);
}
@@ -1781,6 +1786,7 @@ void exitGamePythonScripting()
clearGameModules();
restorePySysPath(); /* get back the original sys.path and clear the backup */
bpy_import_main_set(NULL);
+ PyObjectPlus::ClearDeprecationWarning();
}