Fix T47701: Image not fully updated after setting .pixels

The set callback was missing couple of things:

- Mipmaps should be updated after pixels changes
- GPU texture is invalid after setting pixels
This commit is contained in:
Sergey Sharybin
2016-03-08 14:56:22 +05:00
parent ad98f00d1f
commit c324c4d575

View File

@@ -62,6 +62,10 @@ static EnumPropertyItem image_source_items[] = {
#ifdef RNA_RUNTIME
#include "BKE_global.h"
#include "GPU_draw.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
@@ -399,7 +403,11 @@ static void rna_Image_pixels_set(PointerRNA *ptr, const float *values)
((unsigned char *)ibuf->rect)[i] = FTOCHAR(values[i]);
}
ibuf->userflags |= IB_BITMAPDIRTY | IB_DISPLAY_BUFFER_INVALID;
ibuf->userflags |= IB_BITMAPDIRTY | IB_DISPLAY_BUFFER_INVALID | IB_MIPMAP_INVALID;
if (!G.background) {
GPU_free_image(ima);
}
WM_main_add_notifier(NC_IMAGE | ND_DISPLAY, &ima->id);
}
BKE_image_release_ibuf(ima, ibuf, lock);