Skip to content

Commit

Permalink
pass in folder ids with product ids
Browse files Browse the repository at this point in the history
  • Loading branch information
iLLiCiTiT committed Sep 19, 2024
1 parent 90b4344 commit aafab4b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions client/ayon_core/tools/loader/ui/product_group_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@ def __init__(self, controller: "LoaderController", parent):
self._group_btn = group_btn
self._name_line_edit = name_line_edit

def set_product_ids(self, project_name, product_ids):
def set_product_ids(self, project_name, folder_ids, product_ids):
self._project_name = project_name
self._product_ids = product_ids

# Update the product groups
product_groups = self._controller.get_folder_product_group_names(
project_name=self._controller.get_selected_project_name(),
folder_ids=self._controller.get_selected_folder_ids()
project_name=project_name,
folder_ids=folder_ids
)
self._name_line_edit.set_options(list(sorted(product_groups)))

Expand Down
14 changes: 9 additions & 5 deletions client/ayon_core/tools/loader/ui/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,14 +402,18 @@ def _show_group_dialog(self):
if not project_name:
return

product_ids = {
i["product_id"]
for i in self._products_widget.get_selected_version_info()
}
product_ids = set()
folder_ids = set()
for version_info in self._products_widget.get_selected_version_info():
product_ids.add(version_info["product_id"])
folder_ids.add(version_info["folder_id"])

if not product_ids:
return

self._group_dialog.set_product_ids(project_name, product_ids)
self._group_dialog.set_product_ids(
project_name, folder_ids, product_ids
)
self._group_dialog.show()

def _on_folder_filter_change(self, text):
Expand Down

0 comments on commit aafab4b

Please sign in to comment.