[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [53686] trunk/blender/source/blender/ makesrna/intern/rna_nodetree.c: Small fix for r53685: Allow setting NULL/ None as parent, i.e.

Lukas Toenne lukas.toenne at googlemail.com
Wed Jan 9 17:15:07 CET 2013


Revision: 53686
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53686
Author:   lukastoenne
Date:     2013-01-09 16:15:06 +0000 (Wed, 09 Jan 2013)
Log Message:
-----------
Small fix for r53685: Allow setting NULL/None as parent, i.e. detach a node from a frame.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=53685

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_nodetree.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c	2013-01-09 16:07:42 UTC (rev 53685)
+++ trunk/blender/source/blender/makesrna/intern/rna_nodetree.c	2013-01-09 16:15:06 UTC (rev 53686)
@@ -293,18 +293,22 @@
 	bNode *node = ptr->data;
 	bNode *parent = value.data;
 	
-	/* XXX only Frame node allowed for now,
-	 * in the future should have a poll function or so to test possible attachment.
-	 */
-	if (parent->type != NODE_FRAME)
-		return;
+	if (parent) {
+		/* XXX only Frame node allowed for now,
+		 * in the future should have a poll function or so to test possible attachment.
+		 */
+		if (parent->type != NODE_FRAME)
+			return;
+		
+		/* make sure parent is not attached to the node */
+		if (nodeAttachNodeCheck(parent, node))
+			return;
+	}
 	
-	/* make sure parent is not attached to the node */
-	if (nodeAttachNodeCheck(parent, node))
-		return;
-	
 	nodeDetachNode(node);
-	nodeAttachNode(node, parent);
+	if (parent) {
+		nodeAttachNode(node, parent);
+	}
 }
 
 static int rna_Node_parent_poll(PointerRNA *ptr, PointerRNA value)




More information about the Bf-blender-cvs mailing list