Skip to content

Commit

Permalink
Merge branch 'develop' into enhancement/review_collect_otio_subset_re…
Browse files Browse the repository at this point in the history
…source
  • Loading branch information
jakubjezek001 authored Dec 5, 2024
2 parents b832c85 + 38aa810 commit 13e0ad9
Show file tree
Hide file tree
Showing 10 changed files with 764 additions and 484 deletions.
353 changes: 229 additions & 124 deletions client/ayon_core/lib/path_templates.py

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions client/ayon_core/pipeline/load/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,9 @@ def update_container(container, version=-1):
from ayon_core.pipeline import get_current_project_name

# Compute the different version from 'representation'
project_name = get_current_project_name()
project_name = container.get("project_name")
if project_name is None:
project_name = get_current_project_name()
repre_id = container["representation"]
if not _is_valid_representation_id(repre_id):
raise ValueError(
Expand Down Expand Up @@ -542,9 +544,6 @@ def update_container(container, version=-1):
)
)

path = get_representation_path(new_representation)
if not path or not os.path.exists(path):
raise ValueError("Path {} doesn't exist".format(path))
project_entity = ayon_api.get_project(project_name)
context = {
"project": project_entity,
Expand All @@ -553,6 +552,9 @@ def update_container(container, version=-1):
"version": new_version,
"representation": new_representation,
}
path = get_representation_path_from_context(context)
if not path or not os.path.exists(path):
raise ValueError("Path {} doesn't exist".format(path))

return Loader().update(container, context)

Expand Down Expand Up @@ -588,7 +590,9 @@ def switch_container(container, representation, loader_plugin=None):
)

# Get the new representation to switch to
project_name = get_current_project_name()
project_name = container.get("project_name")
if project_name is None:
project_name = get_current_project_name()

context = get_representation_context(
project_name, representation["id"]
Expand Down
14 changes: 7 additions & 7 deletions client/ayon_core/pipeline/template_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,13 @@ def get_folder_template_data(folder_entity, project_name):
"""

path = folder_entity["path"]
hierarchy_parts = path.split("/")
# Remove empty string from the beginning
hierarchy_parts.pop(0)
# Remove empty string from the beginning and split by '/'
parents = path.lstrip("/").split("/")
# Remove last part which is folder name
folder_name = hierarchy_parts.pop(-1)
hierarchy = "/".join(hierarchy_parts)
if hierarchy_parts:
parent_name = hierarchy_parts[-1]
folder_name = parents.pop(-1)
hierarchy = "/".join(parents)
if parents:
parent_name = parents[-1]
else:
parent_name = project_name

Expand All @@ -103,6 +102,7 @@ def get_folder_template_data(folder_entity, project_name):
"name": folder_name,
"type": folder_entity["folderType"],
"path": path,
"parents": parents,
},
"asset": folder_name,
"hierarchy": hierarchy,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@ def _fill_folder_data(self, instance, project_entity, anatomy_data):
# Using 'Shot' is current default behavior of editorial
# (or 'newHierarchyIntegration') publishing.
"type": "Shot",
"parents": parents,
},
})

Expand Down
32 changes: 20 additions & 12 deletions client/ayon_core/tools/sceneinventory/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ def get_current_folder_id(self):
self._current_folder_set = True
return self._current_folder_id

def get_project_status_items(self):
project_name = self.get_current_project_name()
def get_project_status_items(self, project_name=None):
if project_name is None:
project_name = self.get_current_project_name()
return self._projects_model.get_project_status_items(
project_name, None
)
Expand All @@ -105,32 +106,39 @@ def get_container_items(self):
def get_container_items_by_id(self, item_ids):
return self._containers_model.get_container_items_by_id(item_ids)

def get_representation_info_items(self, representation_ids):
def get_representation_info_items(self, project_name, representation_ids):
return self._containers_model.get_representation_info_items(
representation_ids
project_name, representation_ids
)

def get_version_items(self, product_ids):
return self._containers_model.get_version_items(product_ids)
def get_version_items(self, project_name, product_ids):
return self._containers_model.get_version_items(
project_name, product_ids)

# Site Sync methods
def is_sitesync_enabled(self):
return self._sitesync_model.is_sitesync_enabled()

def get_sites_information(self):
return self._sitesync_model.get_sites_information()
def get_sites_information(self, project_name):
return self._sitesync_model.get_sites_information(project_name)

def get_site_provider_icons(self):
return self._sitesync_model.get_site_provider_icons()

def get_representations_site_progress(self, representation_ids):
def get_representations_site_progress(
self, project_name, representation_ids
):
return self._sitesync_model.get_representations_site_progress(
representation_ids
project_name, representation_ids
)

def resync_representations(self, representation_ids, site_type):
def resync_representations(
self, project_name, representation_ids, site_type
):
return self._sitesync_model.resync_representations(
representation_ids, site_type
project_name,
representation_ids,
site_type
)

# Switch dialog methods
Expand Down
Loading

0 comments on commit 13e0ad9

Please sign in to comment.