Fix T26141: render setting affects only first scene.

This commit is contained in:
Porteries Tristan 2015-07-26 18:01:56 +02:00
parent c27a1cfd63
commit fb7281fb6a
Notes: blender-bot 2023-02-14 15:19:31 +01:00
Referenced by issue #26141, render.setGLSLMaterialSetting has no effect when displaying multiple scenes 2.56
1 changed files with 4 additions and 5 deletions

View File

@ -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();
}
}
}
}