[Bf-blender-cvs] [f375f6e] object_nodes: Notifier from node changes to redraw the viewport when geometry nodes are updated.

Lukas Tönne noreply at git.blender.org
Tue Nov 24 09:44:52 CET 2015


Commit: f375f6e6dcbe14cf30fe855bbad2f1c18bcff15d
Author: Lukas Tönne
Date:   Sun Nov 22 10:05:25 2015 +0100
Branches: object_nodes
https://developer.blender.org/rBf375f6e6dcbe14cf30fe855bbad2f1c18bcff15d

Notifier from node changes to redraw the viewport when geometry nodes are updated.

This is a hack! The nodes are defined in python and the notifier is currently
triggered far to broadly, but currently there is no nicer way of doing it.

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

M	source/blender/editors/space_node/node_edit.c

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

diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 108f12f..bb8ed87 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -353,6 +353,14 @@ void snode_notify(bContext *C, SpaceNode *snode)
 		WM_event_add_notifier(C, NC_SCENE | ND_NODES, id);
 	else if (ED_node_is_texture(snode))
 		WM_event_add_notifier(C, NC_TEXTURE | ND_NODES, id);
+	/* XXX tree_idname check below is a hack, the nodes are primarily
+	 * defined in python, but notifiers are not accessible there.
+	 * This should ideally happen through the depsgraph too,
+	 * but for now this is the only real option.
+	 */
+	else if (STREQ(snode->tree_idname, "ObjectNodeTree")) {
+		WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, id);
+	}
 }
 
 void ED_node_set_tree_type(SpaceNode *snode, bNodeTreeType *typeinfo)




More information about the Bf-blender-cvs mailing list