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:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-03-08 12:56:22 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-03-08 12:59:05 +0300
commitc324c4d57502e9056acaa85231ae330914972ee9 (patch)
tree46a9fa0563b42a67b5337c3d64394743a15757bb /source/blender/makesrna/intern/rna_image.c
parentad98f00d1f651bacafd319e2311b35359a10ab56 (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/blender/makesrna/intern/rna_image.c')
-rw-r--r--source/blender/makesrna/intern/rna_image.c10
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);