move get collection recursive in functions so it can be reused

This commit is contained in:
pullusb
2025-07-23 14:55:50 +02:00
parent 01ccbbac30
commit 96875b43c5
2 changed files with 19 additions and 22 deletions
+12
View File
@@ -307,6 +307,18 @@ def connect_to_file_output(node_list, file_out=None, base_path='', excludes=None
# region Utilities
def get_collection_children_recursive(col, cols=None) -> list:
'''return a list of all the child collections
and their subcollections in the passed collection'''
cols = cols if cols is not None else []
for sub in col.children:
if sub not in cols:
cols.append(sub)
if len(sub.children):
cols = get_collection_children_recursive(sub, cols)
return cols
def set_properties_editor_tab(tab, skip_if_exists=True):
'''Take a tab name and apply it to properties editor
tab: identifier of the tab, possible name in: