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>2015-07-23 12:50:13 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-07-23 12:50:13 +0300
commit253f416a3692c463c13160802252b26fe15d8f79 (patch)
tree98080b925aefd282cd0887365e43c5fecebb0612 /source/blender/makesrna/intern
parent08fbc303e17e2a783808ade71e709b621b53743f (diff)
Fix regression of custom nodes not triggering material preview re-render
Issue was introduced in b0df196.It's not the nicest ever solution but it's quite close to be as nice as we can do it with current custom nodes and notifier system design.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/rna_access.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index ef798820321..7b3049228e4 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -1692,6 +1692,15 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR
* not especially nice */
DAG_id_tag_update(ptr->id.data, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
WM_main_add_notifier(NC_WINDOW, NULL);
+ /* Not nice as well, but the only way to make sure material preview
+ * is updated with custom nodes.
+ */
+ if ((prop->flag & PROP_IDPROPERTY) != 0 &&
+ (ptr->id.data != NULL) &&
+ (GS(((ID *)ptr->id.data)->name) == ID_NT))
+ {
+ WM_main_add_notifier(NC_MATERIAL | ND_SHADING, NULL);
+ }
}
}