diff options
Diffstat (limited to 'source/blender/src/meshtools.c')
-rw-r--r-- | source/blender/src/meshtools.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/src/meshtools.c b/source/blender/src/meshtools.c index 1a97a3d594f..2d2ea2c8e0c 100644 --- a/source/blender/src/meshtools.c +++ b/source/blender/src/meshtools.c @@ -70,6 +70,7 @@ void sort_faces(void); #include "BKE_depsgraph.h" #include "BKE_customdata.h" #include "BKE_global.h" +#include "BKE_image.h" #include "BKE_library.h" #include "BKE_main.h" #include "BKE_mesh.h" @@ -850,10 +851,13 @@ void objects_bake_render(void) else { Image *ima; /* force OpenGL reload */ - for(ima= G.main->image.first; ima; ima= ima->id.next) - if(ima->ibuf) - if(ima->ibuf->userflags & IB_BITMAPDIRTY) + for(ima= G.main->image.first; ima; ima= ima->id.next) { + if(ima->ok==IMA_OK_LOADED) { + ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); + if(ibuf && (ibuf->userflags & IB_BITMAPDIRTY)) free_realtime_image(ima); + } + } } allqueue(REDRAWIMAGE, 0); |