Skip to content

Commit

Permalink
Merge pull request #61 from ynput/enhancement/allow_app_launch_withou…
Browse files Browse the repository at this point in the history
…t_resolver

Do not 'crash' AYON launch or application launch because of lack of USD resolver
  • Loading branch information
BigRoy authored Oct 2, 2024
2 parents 7238ea2 + 227d5ef commit f64a152
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
9 changes: 5 additions & 4 deletions client/ayon_usd/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ def tray_init(self):
def initialize(self, studio_settings):
"""Initialize USD Addon."""
if not studio_settings["usd"]["allow_addon_start"]:
raise SystemError(
"The experimental AyonUsd addon is currently activated, "
self.log.error(
"The experimental AYON USD addon is currently activated, "
"but you haven't yet acknowledged the user agreement "
"indicating your understanding that this feature is "
"experimental. Please go to the Studio Settings and "
"check the agreement checkbox."
"check the agreement checkbox. The AYON USD addon will now "
"be disabled"
)
self.enabled = True
self.enabled = False
self._download_window = None

def tray_start(self):
Expand Down
14 changes: 8 additions & 6 deletions client/ayon_usd/hooks/pre_resolver_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,25 @@ def execute(self):
resolver_lake_fs_path = utils.get_resolver_to_download(
project_settings, self.app_name)
if not resolver_lake_fs_path:
raise RuntimeError(
"No USD Resolver could be found but "
f"AYON-Usd addon is activated {self.app_name}"
self.log.warning(
"No USD Resolver could be found but AYON-Usd addon is"
f" activated for application: {self.app_name}"
)
return

self.log.info(f"Using resolver from LakeFS: {resolver_lake_fs_path}")
self.log.info(f"Using resolver from lakeFS: {resolver_lake_fs_path}")
lake_fs = config.get_global_lake_instance()
lake_fs_resolver_time_stamp = (
lake_fs.get_element_info(resolver_lake_fs_path).get(
"Modified Time"
)
)
if not lake_fs_resolver_time_stamp:
raise ValueError(
"Could not find resolver timestamp on LakeFs server "
self.log.error(
"Could not find resolver timestamp on lakeFS server "
f"for application: {self.app_name}"
)
return

# Check for existing local resolver that matches the lakefs timestamp
with open(ADDON_DATA_JSON_PATH, "r") as data_json:
Expand Down

0 comments on commit f64a152

Please sign in to comment.