Skip to content

Instantly share code, notes, and snippets.

@BigRoy
Created February 8, 2024 12:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BigRoy/18afc0cd24958ef73cfacf2371b9cd09 to your computer and use it in GitHub Desktop.
Save BigRoy/18afc0cd24958ef73cfacf2371b9cd09 to your computer and use it in GitHub Desktop.
AYON Pipeline - Load a representation container instance by representation id in Python
from openpype.pipeline.load.plugins import discover_loader_plugins
from openpype.pipeline.load.utils import loaders_from_representation, load_container
loader_name = "GpuCacheLoader"
representation_id = '6b7b5b6e-c677-11ee-b580-18c04d958ef6'
all_loaders = discover_loader_plugins()
loaders = loaders_from_representation(all_loaders, representation_id)
Loader = next((i for i in loaders if i.__name__ == loader_name), None)
if Loader is None:
raise RuntimeError
container_node = load_container(Loader, representation_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment