When calling child.reparent(newParentNode, false) the child's parent is updated but the newParentNode does not add child to its list of children. Example script below:
sub main()
testParent = createObject("roSGNode", "Node")
testParent.id = "test-parent"
testChild = createObject("roSGNode", "Node")
testChild.id = "test-child"
print "children before reparent:"
print testParent.getChildren(-1, 0)
print "parent before reparent":
print testChild.getParent()
testChild.reparent(testParent, false)
print "children after reparent:"
print testParent.getChildren(-1, 0)
print "parent after reparent":
print testChild.getParent()
end sub
Which creates the following output. Note how the children array is empty before and after the call to reparent:
children before reparent:
<Component: roArray> =
[
]
parent before reparent
invalid
children after reparent:
<Component: roArray> =
[
]
parent after reparent
<Component: roSGNode:Node> =
{
change: <Component: roAssociativeArray>
focusable: false
focusedchild: invalid
id: test-parent
}
When calling
child.reparent(newParentNode, false)
the child's parent is updated but the newParentNode does not add child to its list of children. Example script below:Which creates the following output. Note how the children array is empty before and after the call to reparent: