Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Scene Inventory: Add subsetGroup column #3658

Merged
merged 2 commits into from
Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions openpype/tools/sceneinventory/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
class InventoryModel(TreeModel):
"""The model for the inventory"""

Columns = ["Name", "version", "count", "family", "loader", "objectName"]
Columns = ["Name", "version", "count", "family",
"subsetGroup", "loader", "objectName"]
BigRoy marked this conversation as resolved.
Show resolved Hide resolved

OUTDATED_COLOR = QtGui.QColor(235, 30, 30)
CHILD_OUTDATED_COLOR = QtGui.QColor(200, 160, 30)
Expand Down Expand Up @@ -157,8 +158,13 @@ def data(self, index, role):
# Family icon
return item.get("familyIcon", None)

column_name = self.Columns[index.column()]

if column_name == "subsetGroup" and item.get("subsetGroup"):
BigRoy marked this conversation as resolved.
Show resolved Hide resolved
return qtawesome.icon("fa.object-group",
color=get_default_entity_icon_color())

if item.get("isGroupNode"):
column_name = self.Columns[index.column()]
if column_name == "active_site":
provider = item.get("active_site_provider")
return self._site_icons.get(provider)
Expand Down Expand Up @@ -423,6 +429,7 @@ def add_items(self, items, parent=None):
group_node["familyIcon"] = family_icon
group_node["count"] = len(group_items)
group_node["isGroupNode"] = True
group_node["subsetGroup"] = subset["data"].get("subsetGroup")
BigRoy marked this conversation as resolved.
Show resolved Hide resolved

if self.sync_enabled:
progress = get_progress_for_repre(
Expand Down
3 changes: 2 additions & 1 deletion openpype/tools/sceneinventory/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ def __init__(self, parent=None):
view.setColumnWidth(1, 55) # version
view.setColumnWidth(2, 55) # count
view.setColumnWidth(3, 150) # family
view.setColumnWidth(4, 100) # namespace
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: Namespace column didn't exist - this was actually setting the loader column. I felt the default width for the loader column was slightly too small and most loader names got cut off. So I've set the loader column width to 150.

view.setColumnWidth(4, 120) # subsetGroup
BigRoy marked this conversation as resolved.
Show resolved Hide resolved
view.setColumnWidth(5, 150) # loader

# apply delegates
version_delegate = VersionDelegate(legacy_io, self)
Expand Down