Tree¶
- class bpyutils.tree.Node(obj, children=[], parent=None)¶
Construct a Tree.
- Parameters
obj – Object within the node.
children – Children of the node.
Usage:
>>> from bpyutils.tree import Node >>> family = Node('grandparent', [Node('parent-1', [Node('child-1'), Node('child-2')]), Node('parent-2', [Node('child-3'), Node('child-4')])]) >>> print(family.render()) grandparent parent-1 child-1 child-2 parent-2 child-3 child-4
- find(query)¶
Performs a Depth-First Search to find a Node based on a query provieded.