diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-08 12:56:22 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2016-03-08 12:59:05 +0300 |
commit | c324c4d57502e9056acaa85231ae330914972ee9 (patch) | |
tree | 46a9fa0563b42a67b5337c3d64394743a15757bb /source | |
parent | ad98f00d1f651bacafd319e2311b35359a10ab56 (diff) |
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
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesrna/intern/rna_image.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 63fa59828ac..f65aa90ea71 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -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); |