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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_image.c')
-rw-r--r--source/blender/makesrna/intern/rna_image.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c
index ce92ddefc8f..84001926839 100644
--- a/source/blender/makesrna/intern/rna_image.c
+++ b/source/blender/makesrna/intern/rna_image.c
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include "DNA_image_types.h"
+#include "DNA_node_types.h"
#include "DNA_scene_types.h"
#include "BLI_utildefines.h"
@@ -66,6 +67,8 @@ static const EnumPropertyItem image_source_items[] = {
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
+#include "ED_node.h"
+
static bool rna_Image_is_stereo_3d_get(PointerRNA *ptr)
{
return BKE_image_is_stereo((Image *)ptr->data);
@@ -136,16 +139,23 @@ static void rna_Image_views_format_update(Main *bmain, Scene *scene, PointerRNA
BKE_image_release_ibuf(ima, ibuf, lock);
}
-static void rna_ImageUser_update(Main *UNUSED(bmain), Scene *scene, PointerRNA *ptr)
+static void rna_ImageUser_update(Main *bmain, Scene *scene, PointerRNA *ptr)
{
ImageUser *iuser = ptr->data;
+ ID *id = ptr->id.data;
BKE_image_user_frame_calc(iuser, scene->r.cfra);
- if (ptr->id.data) {
- /* Update material or texture for render preview. */
- DEG_id_tag_update(ptr->id.data, 0);
- DEG_id_tag_update(ptr->id.data, ID_RECALC_EDITORS);
+ if (id) {
+ if (GS(id->name) == ID_NT) {
+ /* Special update for nodetrees to find parent datablock. */
+ ED_node_tag_update_nodetree(bmain, (bNodeTree *)id, NULL);
+ }
+ else {
+ /* Update material or texture for render preview. */
+ DEG_id_tag_update(id, 0);
+ DEG_id_tag_update(id, ID_RECALC_EDITORS);
+ }
}
}