Fix T51449: empty node editor continuously redrawing and using CPU.

This commit is contained in:
Brecht Van Lommel 2017-05-11 20:28:39 +02:00
parent 77d633399c
commit 868678c85f
Notes: blender-bot 2023-02-14 08:58:01 +01:00
Referenced by issue #51449, High CPU usage when removing material from object
1 changed files with 2 additions and 1 deletions

View File

@ -580,7 +580,8 @@ void snode_set_context(const bContext *C)
}
}
if (snode->nodetree != ntree || snode->id != id || snode->from != from || snode->treepath.last == NULL) {
if (snode->nodetree != ntree || snode->id != id || snode->from != from ||
(snode->treepath.last == NULL && ntree)) {
ED_node_tree_start(snode, ntree, id, from);
}
}