Skip to content

Commit

Permalink
comsetic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
moonyuet committed Nov 26, 2024
1 parent fafcbe8 commit 10e66c4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
9 changes: 6 additions & 3 deletions client/ayon_core/tools/sceneinventory/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,15 +273,17 @@ def refresh(self, selected=None):
) = self._get_status_data(project_name, status_name)

repre_name = (
repre_info.representation_name or "<unknown representation>"
repre_info.representation_name or
"<unknown representation>"
)
container_model_items = []
for container_item in container_items:
object_name = container_item.object_name or "<none>"
unique_name = repre_name + object_name
item = QtGui.QStandardItem()
item.setColumnCount(root_item.columnCount())
item.setData(container_item.namespace, QtCore.Qt.DisplayRole)
item.setData(container_item.namespace,
QtCore.Qt.DisplayRole)
item.setData(self.GRAYOUT_COLOR, NAME_COLOR_ROLE)
item.setData(self.GRAYOUT_COLOR, VERSION_COLOR_ROLE)
item.setData(item_icon, QtCore.Qt.DecorationRole)
Expand All @@ -290,7 +292,8 @@ def refresh(self, selected=None):
item.setData(version_label, VERSION_LABEL_ROLE)
item.setData(container_item.loader_name, LOADER_NAME_ROLE)
item.setData(container_item.object_name, OBJECT_NAME_ROLE)
item.setData(container_item.project_name, PROJECT_NAME_ROLE)
item.setData(container_item.project_name,
PROJECT_NAME_ROLE)
item.setData(True, IS_CONTAINER_ITEM_ROLE)
item.setData(unique_name, ITEM_UNIQUE_NAME_ROLE)
container_model_items.append(item)
Expand Down
3 changes: 2 additions & 1 deletion client/ayon_core/tools/sceneinventory/models/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ def _update_cache(self):
current_project_name = self._controller.get_current_project_name()
for container in containers:
try:
item = ContainerItem.from_container_data(current_project_name, container)
item = ContainerItem.from_container_data(
current_project_name, container)
repre_id = item.representation_id
try:
uuid.UUID(repre_id)
Expand Down
7 changes: 5 additions & 2 deletions client/ayon_core/tools/sceneinventory/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,9 @@ def _show_version_dialog(self, item_ids, active_repre_id):
)

repre_info_by_project[project_name] = repres_info
version_items_by_project[project_name] = version_items_by_product_id
version_items_by_project[project_name] = (
version_items_by_product_id
)

active_version_id = active_repre_info.version_id
# active_product_id = active_repre_info.product_id
Expand Down Expand Up @@ -994,7 +996,8 @@ def update_all(self):

def _on_switch_to_versioned(self, item_ids):
# Get container items by ID
containers_items_by_id = self._controller.get_container_items_by_id(item_ids)
containers_items_by_id = self._controller.get_container_items_by_id(
item_ids)
# Extract project names and their corresponding representation IDs
repre_ids_by_project = collections.defaultdict(set)
for container_item in containers_items_by_id.values():
Expand Down

0 comments on commit 10e66c4

Please sign in to comment.