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-05 09:57:08 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-05-05 09:57:08 +0400
commit9e8261a13b696708c3f7f7bac83d5aae8ef43fed (patch)
tree1272eb2d36de992634bede0cf17c50d527ff8d5f
parentbe2c21bcdb2a05fa238cb637940269941a5fc12c (diff)
Disable importing module python controller scripts at conversion time because it can run BGE functions and crash since the internal state isnt setup yet.
face-select mode wasnt working when used with projection paint.
-rw-r--r--source/blender/src/drawview.c2
-rw-r--r--source/gameengine/Converter/KX_ConvertControllers.cpp9
-rw-r--r--source/gameengine/GameLogic/SCA_PythonController.cpp5
3 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/src/drawview.c b/source/blender/src/drawview.c
index 203c9869022..d6184f42410 100644
--- a/source/blender/src/drawview.c
+++ b/source/blender/src/drawview.c
@@ -977,7 +977,7 @@ void backdrawview3d(int test)
int m;
#endif
- if( G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT );
+ if( G.f & G_VERTEXPAINT || G.f & G_WEIGHTPAINT || (FACESEL_PAINT_TEST));
else if ((G.f & G_TEXTUREPAINT) && G.scene->toolsettings && (G.scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_DISABLE));
else if(G.obedit && G.vd->drawtype>OB_WIRE && (G.vd->flag & V3D_ZBUF_SELECT));
else {
diff --git a/source/gameengine/Converter/KX_ConvertControllers.cpp b/source/gameengine/Converter/KX_ConvertControllers.cpp
index 79664ca4622..856f3f79588 100644
--- a/source/gameengine/Converter/KX_ConvertControllers.cpp
+++ b/source/gameengine/Converter/KX_ConvertControllers.cpp
@@ -216,8 +216,13 @@ void BL_ConvertControllers(
* gives more pradictable performance for larger scripts */
if(pyctrl->m_mode==SCA_PythonController::SCA_PYEXEC_SCRIPT)
pyctrl->Compile();
- else
- pyctrl->Import();
+ else {
+ /* We cant do this because importing runs the script which could end up accessing
+ * internal BGE functions, this is unstable while we're converting the scene.
+ * This is a pitty because its useful to see errors at startup but cant help it */
+
+ // pyctrl->Import();
+ }
}
//done with gamecontroller
diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp
index bf4c2475a64..0e78e03d5af 100644
--- a/source/gameengine/GameLogic/SCA_PythonController.cpp
+++ b/source/gameengine/GameLogic/SCA_PythonController.cpp
@@ -164,6 +164,11 @@ static const char* sPyGetCurrentController__doc__;
/* warning, self is not the SCA_PythonController, its a PyObjectPlus_Proxy */
PyObject* SCA_PythonController::sPyGetCurrentController(PyObject *self)
{
+ if(m_sCurrentController==NULL)
+ {
+ PyErr_SetString(PyExc_SystemError, "GameLogic.getCurrentController(), this function is being run outside the python controllers context, or blenders internal state is corrupt.");
+ return NULL;
+ }
return m_sCurrentController->GetProxy();
}