Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load and manage products from a library project #1005

Merged
Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
aaadaff
refactoring the load container so that it can load the library project
moonyuet Nov 11, 2024
e0ff639
Merge branch 'develop' into enhancement/Load-and-manage-products-from…
moonyuet Nov 11, 2024
dcb838e
resolve the project root during updating container
moonyuet Nov 11, 2024
735409f
do not get the container item from self.get_container
moonyuet Nov 12, 2024
0bec953
query the product id per project
moonyuet Nov 14, 2024
574ea35
codes clean up & make sure it supports mulitple asset loading per pro…
moonyuet Nov 15, 2024
8965a88
clean up code and add project name row into scene inventory
moonyuet Nov 18, 2024
0866c00
code tweaks - kuba's comment
moonyuet Nov 18, 2024
004e962
big roy comment - refactoring the dict per repre_id per project
moonyuet Nov 18, 2024
3078ba2
kuba's comment - add current project name as argument in the get_cont…
moonyuet Nov 19, 2024
d9c1a29
loading the asset per repre_id and per project
moonyuet Nov 21, 2024
ec56335
Merge branch 'develop' into enhancement/Load-and-manage-products-from…
moonyuet Nov 21, 2024
7a22491
remove unused variable
moonyuet Nov 21, 2024
a70135b
implement switch and set version by repre_id/product_id per project
moonyuet Nov 21, 2024
77e5317
remove unused variable
moonyuet Nov 21, 2024
e625901
big roy's comment - code tweak
moonyuet Nov 22, 2024
7edc759
remove unused variables
iLLiCiTiT Nov 22, 2024
ef26dc2
added empty lines for readability
iLLiCiTiT Nov 22, 2024
7935ed3
site sync expects project name
iLLiCiTiT Nov 22, 2024
b25715e
use project name in site sync calls
iLLiCiTiT Nov 22, 2024
a30698e
refactor view codebase
iLLiCiTiT Nov 22, 2024
562f2ed
site sync is fully project specific
iLLiCiTiT Nov 22, 2024
eea31b6
don't slow down project name getter
iLLiCiTiT Nov 22, 2024
e21c7a1
use project name to get correct status icons
iLLiCiTiT Nov 22, 2024
87907b5
fix switch version
iLLiCiTiT Nov 22, 2024
b28f4b0
comment out unused variables
iLLiCiTiT Nov 22, 2024
47fa5e5
check on the active product id before adding version_items
moonyuet Nov 26, 2024
fafcbe8
check on the active product id before adding version_items
moonyuet Nov 26, 2024
10e66c4
comsetic fix
moonyuet Nov 26, 2024
5d7aeaf
better variable name
iLLiCiTiT Nov 28, 2024
1776df1
don't store project name to version items
iLLiCiTiT Nov 28, 2024
5c115ce
switch dialog can work per project
iLLiCiTiT Nov 28, 2024
2eb97b9
show project name on group instead of items
iLLiCiTiT Nov 28, 2024
1ab7a65
fix formatting
iLLiCiTiT Nov 28, 2024
9a0e490
use items() for key, value
moonyuet Dec 3, 2024
51ec36e
Merge branch 'develop' into enhancement/Load-and-manage-products-from…
iLLiCiTiT Dec 5, 2024
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
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
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