‘Flattens’ the arguments list: recursively replaces any iterable argument in *args by a tuple of its elements that will be inserted at its place in the returned arguments.
By default will return elements depth first, from root to leaves. Set postorder or breadth to control order.
Keywords : |
|
---|
For a nested list represent trees:
a____b____c
| |____d
e____f
|____g
preorder(default) :
>>> expandArgs( 'a', ['b', ['c', 'd']], 'e', ['f', 'g'], limit=1 )
('a', 'b', ['c', 'd'], 'e', 'f', 'g')
>>> expandArgs( 'a', ['b', ['c', 'd']], 'e', ['f', 'g'] )
('a', 'b', 'c', 'd', 'e', 'f', 'g')
postorder :
>>> expandArgs( 'a', ['b', ['c', 'd']], 'e', ['f', 'g'], postorder=True, limit=1)
('b', ['c', 'd'], 'a', 'f', 'g', 'e')
>>> expandArgs( 'a', ['b', ['c', 'd']], 'e', ['f', 'g'], postorder=True)
('c', 'd', 'b', 'a', 'f', 'g', 'e')
breadth :
>>> expandArgs( 'a', ['b', ['c', 'd']], 'e', ['f', 'g'], limit=1, breadth=True)
('a', 'e', 'b', ['c', 'd'], 'f', 'g')
>>> expandArgs( 'a', ['b', ['c', 'd']], 'e', ['f', 'g'], breadth=True)
('a', 'e', 'b', 'f', 'g', 'c', 'd')
Note that with default depth (unlimited) and order (preorder), if passed a pymel Tree result will be the equivalent of doing a preorder traversal : [k for k in iter(theTree)]