From fb7281fb6a43629f2624cee9dae2c7ec530a8aad Mon Sep 17 00:00:00 2001 From: Porteries Tristan Date: Sun, 26 Jul 2015 18:01:56 +0200 Subject: Fix T26141: render setting affects only first scene. --- source/gameengine/Ketsji/KX_PythonInit.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source/gameengine/Ketsji/KX_PythonInit.cpp') diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index b7ca6248079..95b92a223c5 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1138,10 +1138,6 @@ static PyObject *gPySetGLSLMaterialSetting(PyObject *, else gs->glslflag |= flag; - /* temporarily store the glsl settings in the scene for the GLSL materials */ - GameData *gm= &(gp_KetsjiScene->GetBlenderScene()->gm); - gm->flag = gs->glslflag; - /* display lists and GLSL materials need to be remade */ if (sceneflag != gs->glslflag) { GPU_materials_free(); @@ -1149,11 +1145,14 @@ static PyObject *gPySetGLSLMaterialSetting(PyObject *, KX_SceneList *scenes = gp_KetsjiEngine->CurrentScenes(); KX_SceneList::iterator it; - for (it=scenes->begin(); it!=scenes->end(); it++) + for (it=scenes->begin(); it!=scenes->end(); it++) { + // temporarily store the glsl settings in the scene for the GLSL materials + (*it)->GetBlenderScene()->gm.flag = gs->glslflag; if ((*it)->GetBucketManager()) { (*it)->GetBucketManager()->ReleaseDisplayLists(); (*it)->GetBucketManager()->ReleaseMaterials(); } + } } } -- cgit v1.2.3