From fa7e690a91258cfcfd266d48a4b084ba734d7b5f Mon Sep 17 00:00:00 2001 From: Lukas Toenne Date: Mon, 8 Jul 2013 11:38:09 +0000 Subject: Partial fix for #36024, don't always reset the node editor tree pointer if the type is undefined. This can happen if the tree type is defined by addon or script, in which case the tree type would be unknown the first time the context is checked, but registered right afterward. Also unknown tree types are handled fine, they just display dummy nodes in red warning color. --- source/blender/editors/space_node/node_edit.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index e10cba43d71..f8166456a2c 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -577,9 +577,10 @@ void snode_set_context(const bContext *C) if (!treetype || (treetype->poll && !treetype->poll(C, treetype))) { - /* invalid tree type, disable */ - snode->tree_idname[0] = '\0'; - ED_node_tree_start(snode, NULL, NULL, NULL); + /* invalid tree type, skip + * NB: not resetting the node path here, invalid bNodeTreeType + * may still be registered at a later point. + */ return; } -- cgit v1.2.3