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

Commit

Permalink
SceneInventory: Fix site sync icon conversion (#6123)
Browse files Browse the repository at this point in the history
* use 'get_qt_icon' to convert icon definition

* check if site sync is enabled before getting sites info

* convert containers to list

* Fix wrong method name

---------

Co-authored-by: Petr Kalis <[email protected]>
  • Loading branch information
iLLiCiTiT and kalisp authored Jan 12, 2024
1 parent 1eb7e59 commit f88ab85
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions openpype/tools/ayon_sceneinventory/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ def get_current_folder_id(self):
def get_containers(self):
host = self._host
if isinstance(host, ILoadHost):
return host.get_containers()
return list(host.get_containers())
elif hasattr(host, "ls"):
return host.ls()
return list(host.ls())
return []

# Site Sync methods
Expand Down
5 changes: 3 additions & 2 deletions openpype/tools/ayon_sceneinventory/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
)
from openpype.style import get_default_entity_icon_color
from openpype.tools.utils.models import TreeModel, Item
from openpype.tools.ayon_utils.widgets import get_qt_icon


def walk_hierarchy(node):
Expand Down Expand Up @@ -71,8 +72,8 @@ def __init__(self, controller, parent=None):
site_icons = self._controller.get_site_provider_icons()

self._site_icons = {
provider: QtGui.QIcon(icon_path)
for provider, icon_path in site_icons.items()
provider: get_qt_icon(icon_def)
for provider, icon_def in site_icons.items()
}

def outdated(self, item):
Expand Down
8 changes: 4 additions & 4 deletions openpype/tools/ayon_sceneinventory/models/site_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,23 +150,23 @@ def _get_remote_site_provider(self):
return self._remote_site_provider

def _cache_sites(self):
site_sync = self._get_sync_server_module()
active_site = None
remote_site = None
active_site_provider = None
remote_site_provider = None
if site_sync is not None:
if self.is_sync_server_enabled():
site_sync = self._get_sync_server_module()
project_name = self._controller.get_current_project_name()
active_site = site_sync.get_active_site(project_name)
remote_site = site_sync.get_remote_site(project_name)
active_site_provider = "studio"
remote_site_provider = "studio"
if active_site != "studio":
active_site_provider = site_sync.get_active_provider(
active_site_provider = site_sync.get_provider_for_site(
project_name, active_site
)
if remote_site != "studio":
remote_site_provider = site_sync.get_active_provider(
remote_site_provider = site_sync.get_provider_for_site(
project_name, remote_site
)

Expand Down

0 comments on commit f88ab85

Please sign in to comment.