mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Use next to directly stop on finding first match
This commit is contained in:
parent
0c08dd17e4
commit
855a1e4eb0
1 changed files with 4 additions and 6 deletions
|
|
@ -119,12 +119,10 @@ def get_or_create_shelf_set(shelf_set_label):
|
|||
"""
|
||||
all_shelves_sets = hou.shelves.shelfSets().values()
|
||||
|
||||
shelf_sets = [
|
||||
shelf for shelf in all_shelves_sets if shelf.label() == shelf_set_label
|
||||
]
|
||||
|
||||
if shelf_sets:
|
||||
return shelf_sets[0]
|
||||
shelf_set = next((shelf for shelf in all_shelves_sets if
|
||||
shelf.label() == shelf_set_label), None)
|
||||
if shelf_set:
|
||||
return shelf_set[0]
|
||||
|
||||
shelf_set_name = shelf_set_label.replace(' ', '_').lower()
|
||||
new_shelf_set = hou.shelves.newShelfSet(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue