diff options
Diffstat (limited to 'source/blender/src/previewrender.c')
-rw-r--r-- | source/blender/src/previewrender.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c index 0be63197dd1..1730bb890bc 100644 --- a/source/blender/src/previewrender.c +++ b/source/blender/src/previewrender.c @@ -97,6 +97,8 @@ #include "RE_pipeline.h" #include "BLO_readfile.h" +#include "GPU_material.h" + #include "blendef.h" /* CLAMP */ #include "interface.h" /* ui_graphics_to_window(), SOLVE! (ton) */ #include "mydevice.h" @@ -221,6 +223,36 @@ void BIF_preview_changed(short id_code) } } } + + if(ELEM4(id_code, ID_MA, ID_TE, ID_LA, ID_WO)) { + Object *ob; + Material *ma; + + if(id_code == ID_WO) { + for(ma=G.main->mat.first; ma; ma=ma->id.next) { + if(ma->gpumaterial.first) { + GPU_material_free(ma); + allqueue(REDRAWVIEW3D, 0); + } + } + } + else if(id_code == ID_LA) { + for(ob=G.main->object.first; ob; ob=ob->id.next) { + if(ob->gpulamp.first) { + GPU_lamp_free(ob); + allqueue(REDRAWVIEW3D, 0); + } + } + } else if(OBACT) { + Object *ob = OBACT; + + ma= give_current_material(ob, ob->actcol); + if(ma && ma->gpumaterial.first) { + GPU_material_free(ma); + allqueue(REDRAWVIEW3D, 0); + } + } + } } /* *************************** Preview for buttons *********************** */ |