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 #983

Closed
2 tasks done
BigRoy opened this issue Nov 5, 2024 · 1 comment · Fixed by #1005
Closed
2 tasks done

Load and manage products from a library project #983

BigRoy opened this issue Nov 5, 2024 · 1 comment · Fixed by #1005
Assignees
Labels
sponsored This is directly sponsored by a client or community member

Comments

@BigRoy
Copy link
Collaborator

BigRoy commented Nov 5, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Please describe the feature you have in mind and explain what the current shortcomings are?

The loader is currently able to load products from another (library) project. However, those have traditionally never been able to remain 'managed' and updated.

I'd like to propose a means to allow loading from another project and keep the full management working by persisting the product_name with the container data.

How would you imagine the implementation of the feature?

Upon loading, we also imprint the loaded container with the project_name data alongside the representation id.

That way, anything that takes the container like update_container to set versions or alike is capable of also using the project name data to update correctly to a new version. Due to that we don't need to customize the function signature for update_container

There will be some more we'll need to do:

Required:

  • Loaders will need to be able to imprint the project_name data.
  • The Loader.filepath_from_context method should be tested with it's correctly resolving for another context than the current project.
  • The Scene Inventory (manager) UI should be capable of also listing containers with this project_name metadata and also query the data/info regarding the other project.

Not critical for MVP:

  • The "Switch Asset" UI may need to also support the project_name to allow switching these containers from another project too.
  • The "Collect Scene Inputs" and their input versions are collected solely using representation id for "links". To make that work correctly it may need to also allow representation ids NOT part of the current project also with this project_name data attached to it to correctly identify it.

Are there any labels you wish to add?

  • I have added the relevant labels to the enhancement request.

Describe alternatives you've considered:

No response

Additional context:

No response

@BigRoy BigRoy added the type: enhancement Improvement of existing functionality or minor addition label Nov 5, 2024
@m-u-r-p-h-y m-u-r-p-h-y added the sponsored This is directly sponsored by a client or community member label Nov 5, 2024
@mkolar mkolar removed type: enhancement Improvement of existing functionality or minor addition sponsored This is directly sponsored by a client or community member labels Nov 5, 2024
@moonyuet
Copy link
Member

moonyuet commented Nov 6, 2024

I studied a little bit with the code. The issue possibly contributes to the following function can't manage to find versions and the name of the project as we can always stick with searching the representation and version through the current project name.
Image

def get_representation_info_items(self, representation_ids):
output = {}
missing_repre_ids = set()
for repre_id in representation_ids:
try:
uuid.UUID(repre_id)
except ValueError:
output[repre_id] = RepresentationInfo.new_invalid()
continue
repre_info = self._repre_info_by_id.get(repre_id)
if repre_info is None:
missing_repre_ids.add(repre_id)
else:
output[repre_id] = repre_info
if not missing_repre_ids:
return output
project_name = self._controller.get_current_project_name()
repre_hierarchy_by_id = get_representations_hierarchy(
project_name, missing_repre_ids

project_name = self._controller.get_current_project_name()
version_entities_by_product_id = {
product_id: []
for product_id in missing_ids
}
version_entities = list(ayon_api.get_versions(
project_name,
product_ids=missing_ids,
fields={"id", "version", "productId", "status"}
))

Just discuss with @BigRoy

  1. we need to persist project name data through on Load (aka imprinting project_name and make sure it loaded smoothly e.g. Loader.filepath_from_context)
  2. the scene inventory starts to use that data for updating and switching.

@mkolar mkolar added the sponsored This is directly sponsored by a client or community member label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sponsored This is directly sponsored by a client or community member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants