Skip to content

Commit

Permalink
Merge branch 'production-2' of https://github.com/MoonShineVFX/avalon…
Browse files Browse the repository at this point in the history
…-core into production-2
  • Loading branch information
rebeccaLinx committed Jan 16, 2023
2 parents 18341f6 + b5f32d2 commit a39e658
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions avalon/tools/sceneinventory/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ def refresh(self, selected=None):
# cherry-pick only.
self.add_items((item for item in items
if item["objectName"] in selected))
self.endResetModel()
return

# Update hierarchy info for all containers
Expand All @@ -174,13 +175,14 @@ def refresh(self, selected=None):

def walk_children(names):
"""Select containers and extend to chlid containers"""
for name in [n for n in names if n not in selected_items]:
selected_items.add(name)
item = items_by_name[name]
yield item

for child in walk_children(item["children"]):
yield child
for name in names:
if name not in selected_items:
selected_items.add(name)
item = items_by_name[name]
yield item

for child in walk_children(item["children"]):
yield child

items = list(walk_children(selected)) # Cherry-picked and extended

Expand Down

0 comments on commit a39e658

Please sign in to comment.