Skip to content

Commit

Permalink
fix get viewlayer col
Browse files Browse the repository at this point in the history
  • Loading branch information
Pullusb committed Apr 10, 2024
1 parent 4d24b44 commit d328662
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion snippets/bpy/viewlayer_collection_from_collection.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## Pass a collection and return viewlayer collection

def get_view_layer_col(col, vl_col=None):
'''return viewlayer collection from collection'''
if vl_col is None:
Expand All @@ -6,4 +8,6 @@ def get_view_layer_col(col, vl_col=None):
if sub.collection == col:
return sub
if len(sub.children):
return get_view_layer_col(col, sub)
c = get_view_layer_col(col, sub)
if c is not None:
return c

0 comments on commit d328662

Please sign in to comment.