Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
53 changes: 45 additions & 8 deletions client/ayon_core/host/dirmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,38 @@ def _get_local_sync_dirmap(self):
# won't be root on cloud or sftp provider so fallback to studio
if remote_provider != "local_drive":
remote_site = "studio"

# SiteSync stores roots as a list of
# {name, windows, linux, darwin}; normalize to a dict keyed by
# root name so lookups work
remote_roots = sync_settings["sites"][remote_site]["root"]
if isinstance(remote_roots, list):
remote_roots = {
root_item["name"]: root_item
for root_item in remote_roots
}

# roots without local override in Site Settings cannot be
# remapped - make that visible instead of silently skipping
missing_root_names = [
root_name
for root_name in remote_roots
if root_name not in active_roots_overrides
]
if missing_root_names:
self.log.warning(
"Local root overrides are not set for roots '{}' in"
" Site Settings, paths with these roots won't be"
" remapped.".format("', '".join(missing_root_names))
)

for root_name, active_site_dir in active_roots_overrides.items():
if not active_site_dir:
continue

remote_site_dir = (
remote_roots_overrides.get(root_name)
or sync_settings["sites"][remote_site]["root"][root_name]
or remote_roots.get(root_name)
)

if isinstance(remote_site_dir, dict):
Expand All @@ -201,14 +229,23 @@ def _get_local_sync_dirmap(self):
if not remote_site_dir:
continue

if os.path.isdir(active_site_dir):
if "destination_path" not in mapping:
mapping["destination_path"] = []
mapping["destination_path"].append(active_site_dir)
if not os.path.isdir(active_site_dir):
# sync creates the folder on first download - map the
# root anyway so scene paths point where files will be
self.log.warning(
"Local folder '{}' for root '{}' does not exist"
" yet, mapping it anyway.".format(
active_site_dir, root_name
)
)

if "destination_path" not in mapping:
mapping["destination_path"] = []
mapping["destination_path"].append(active_site_dir)

if "source_path" not in mapping:
mapping["source_path"] = []
mapping["source_path"].append(remote_site_dir)
if "source_path" not in mapping:
mapping["source_path"] = []
mapping["source_path"].append(remote_site_dir)

self.log.debug("local sync mapping:: {}".format(mapping))
return mapping
Expand Down
20 changes: 17 additions & 3 deletions client/ayon_core/pipeline/anatomy/anatomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,22 @@ def _get_site_root_overrides(cls, project_name, site_name):
)
else:
# Ask sync server to get roots overrides
roots_overrides = sitesync_addon.get_site_root_overrides(
project_name, site_name
)
# - sitesync raises ValueError for sites other than
# 'studio'/'local'/machine site id (e.g. user picked a
# cloud site as active site) - fall back to no overrides
# instead of breaking Anatomy completely
try:
roots_overrides = sitesync_addon.get_site_root_overrides(
project_name, site_name
)
except ValueError:
log.warning(
"Failed to receive root overrides for site '{}'"
" of project '{}', using no overrides.".format(
site_name, project_name
),
exc_info=True
)
roots_overrides = {}
site_cache.update_data(roots_overrides)
return site_cache.get_data()
2 changes: 1 addition & 1 deletion client/ayon_core/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""Package declaring AYON addon 'core' version."""
__version__ = "1.9.7+dev"
__version__ = "1.9.7+lbs.3"
2 changes: 1 addition & 1 deletion package.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "core"
title = "Core"
version = "1.9.7+dev"
version = "1.9.7+lbs.3"

client_dir = "ayon_core"

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[project]
name = "ayon-core"
version = "1.9.7+dev"
version = "1.9.7+lbs.3"
description = "AYON core provides the base building blocks for all other AYON addons and integrations and is responsible for discovery and initialization of other addons."
authors = [
{name = "Ynput s.r.o.", email = "info@ynput.io"}
Expand Down