Fix #36939, Objects with nodes appear in gray in viewport, using Solid shade, and the Blender Engine (or Game Engine).

The "active ID node" concept has become slightly more complex with pynodes. To find the active material or other ID links in a node tree recursively requires a hash key based on the "parent" tree of the
current node group. To avoid returning NULL in case this key is not yet initialized (i.e. ID node has not been activated yet), just accept 0 key as well for the base node tree.
This commit is contained in:
Lukas Toenne
2013-10-04 08:27:54 +00:00
parent ac606a7047
commit e1a34f22d7

View File

@@ -2321,7 +2321,7 @@ bNode *nodeGetActive(bNodeTree *ntree)
static bNode *node_get_active_id_recursive(bNodeInstanceKey active_key, bNodeInstanceKey parent_key, bNodeTree *ntree, short idtype)
{
if (parent_key.value == active_key.value) {
if (parent_key.value == active_key.value || active_key.value == 0) {
bNode *node;
for (node = ntree->nodes.first; node; node = node->next)
if (node->id && GS(node->id->name) == idtype)