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:
Diffstat (limited to 'source/blender/editors/render/render_shading.c')
-rw-r--r--source/blender/editors/render/render_shading.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index 6e8c3b721d0..9fd0074b9f1 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -209,6 +209,21 @@ static void image_changed(Main *bmain, Image *ima)
texture_changed(bmain, tex);
}
+static void scene_changed(Main *bmain, Scene *sce)
+{
+ Object *ob;
+ Material *ma;
+
+ /* glsl */
+ for(ob=bmain->object.first; ob; ob=ob->id.next)
+ if(ob->gpulamp.first)
+ GPU_lamp_free(ob);
+
+ for(ma=bmain->mat.first; ma; ma=ma->id.next)
+ if(ma->gpumaterial.first)
+ GPU_material_free(ma);
+}
+
void ED_render_id_flush_update(Main *bmain, ID *id)
{
if(!id)
@@ -230,6 +245,9 @@ void ED_render_id_flush_update(Main *bmain, ID *id)
case ID_IM:
image_changed(bmain, (Image*)id);
break;
+ case ID_SCE:
+ scene_changed(bmain, (Scene*)id);
+ break;
default:
break;
}