Fix for node 'make group' operator in combination with frame nodes. When a selected node is attached to an unselected frame, the parent pointer would end up pointing to a different ID data block.

This commit is contained in:
Lukas Toenne
2012-06-11 15:28:45 +00:00
parent 5f1eec564f
commit edecf49d84

View File

@@ -176,6 +176,10 @@ bNode *node_group_make_from_selected(bNodeTree *ntree)
BLI_addtail(&anim_basepaths, BLI_genericNodeN(path));
}
/* ensure valid parent pointers, detach if parent stays outside the group */
if (node->parent && !(node->parent->flag & NODE_SELECT))
nodeDetachNode(node);
/* change node-collection membership */
BLI_remlink(&ntree->nodes, node);
BLI_addtail(&ngroup->nodes, node);