Fix for node 'make group' operator in combination with frame nodes. When a selected...
authorLukas Toenne <lukas.toenne@googlemail.com>
Mon, 11 Jun 2012 15:28:45 +0000 (15:28 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Mon, 11 Jun 2012 15:28:45 +0000 (15:28 +0000)
source/blender/nodes/intern/node_common.c

index 3d1b656fc4e11183e7e46eeb5e4681188f364e1e..78d21e5d4e4e146e5e14f4cade7b1f1b9ecb1b19 100644 (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);