diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-02 20:33:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-02 20:33:38 +0400 |
commit | ba5c635502b4eb7a96d9aae970117778c27243e6 (patch) | |
tree | 7638a6d662a9d6ac0e263d02aaf90f76294a1605 | |
parent | 7aa44d088fcfb866ab58a6ed3d359a8acd6fe972 (diff) |
fix for crash when node groups loose their ID pointer references (when linked libs don't load)
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 17 | ||||
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 7 |
2 files changed, 16 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 8f6b54e386e..f97dd2f859d 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -1030,13 +1030,18 @@ static int material_in_nodetree(bNodeTree *ntree, Material *mat) bNode *node; for (node = ntree->nodes.first; node; node = node->next) { - if (node->id && GS(node->id->name) == ID_MA) { - if (node->id == (ID *)mat) - return 1; + if (node->id) { + if (GS(node->id->name) == ID_MA) { + if (node->id == (ID *)mat) { + return 1; + } + } + else if (node->type == NODE_GROUP) { + if (material_in_nodetree((bNodeTree *)node->id, mat)) { + return 1; + } + } } - else if (node->type == NODE_GROUP) - if (material_in_nodetree((bNodeTree *)node->id, mat)) - return 1; } return 0; diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index ac4788465e5..dc75cf58654 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -1815,8 +1815,11 @@ static int node_tree_has_composite_output(bNodeTree *ntree) return TRUE; } else if (node->type == NODE_GROUP) { - if (node_tree_has_composite_output((bNodeTree *)node->id)) - return TRUE; + if (node->id) { + if (node_tree_has_composite_output((bNodeTree *)node->id)) { + return TRUE; + } + } } } |