Skip to content

add library type to ContainersFilterResult#1908

Open
vincentullmann wants to merge 3 commits into
ynput:developfrom
vincentullmann:filter_containers_add_library_type
Open

add library type to ContainersFilterResult#1908
vincentullmann wants to merge 3 commits into
ynput:developfrom
vincentullmann:filter_containers_add_library_type

Conversation

@vincentullmann

Copy link
Copy Markdown
Contributor

Changelog Description

add library as another possible category in ContainersFilterResult

Additional info

filter_containers only knows about products from the given project_name.
this causes products imported from a library to be flagged as not_found.

Some hosts use the category to mark the loader nodes different. For example nuke uses them to apply different colors in the node graph. This PR would allow us to apply a different color to nodes reading from the library, rather than them being colored as not_found

Testing notes:

  1. load a bunch of different products (a latest version, a non latest and one product from a library)
  2. run this script (or similar):
from ayon_core.pipeline import registered_host, get_current_project_name
from ayon_core.pipeline.load import filter_containers
from ayon_core.pipeline.load import utils

host = registered_host()
project_name = get_current_project_name()
containers = host.get_containers()

filtered_containers = filter_containers(containers, project_name)
for category, containers in filtered_containers._asdict().items():
    print(category)
    for container in containers:
        print("\t{project_name}, {name}, {version}".format(**container))

Open Questions:

should we distinguish between library_latest and library_outdated?

for the sake of simplicity I decided not to

should we distinguish between library and from_other_project (products from another project where the source project is not a library)?

I think the not_found category covers this well enough for now. I can't think of a use case where users would pull in assets from another project that is not a library

@ynbot ynbot added the size/XS label Jun 26, 2026

@BigRoy BigRoy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say this is straight up wrong.

If from a library, we should still check version status like any other.

What this should really be doing is check whether it's the latest taking into account the container's project name value to look it up in the right project. Personally to me the separate library category makes no sense to me.

Why is it being part of a library relevant to anything?


should we distinguish between library_latest and library_outdated?

for the sake of simplicity I decided not to

should we distinguish between library and from_other_project (products from another project where the source project is not a library)?

I think the not_found category covers this well enough for now. I can't think of a use case where users would pull in assets from another project that is not a library

Not at all, it's just a version - it just belongs to another project. When we check whether it's outdated, we should just check if the version is... regardless of where it comes from.

The bug is that we're not checking apparently across projects whether it is of the right version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants