[Bf-blender-cvs] [253f416] master: Fix regression of custom nodes not triggering material preview re-render

Sergey Sharybin noreply at git.blender.org
Thu Jul 23 11:54:38 CEST 2015


Commit: 253f416a3692c463c13160802252b26fe15d8f79
Author: Sergey Sharybin
Date:   Thu Jul 23 11:50:13 2015 +0200
Branches: master
https://developer.blender.org/rB253f416a3692c463c13160802252b26fe15d8f79

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.

===================================================================

M	source/blender/makesrna/intern/rna_access.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index ef79882..7b30492 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);
+		}
 	}
 }




More information about the Bf-blender-cvs mailing list