Skip to content

Instantly share code, notes, and snippets.

@BigRoy
Created February 6, 2025 12:20
Show Gist options
  • Save BigRoy/3c2d22bdc0c70519bc118a2c8d9626fb to your computer and use it in GitHub Desktop.
Save BigRoy/3c2d22bdc0c70519bc118a2c8d9626fb to your computer and use it in GitHub Desktop.
Make AYON loader plug-in host specific using `LoaderPlugin.is_compatible_loader` classmethod
from ayon_core.pipeline import load, get_current_host_name
class TestHostSpecificLoad(load.LoaderPlugin):
hosts = ["bla"]
product_types = {"*"}
representations = {"*"}
label = "Test Host Specific Load"
@classmethod
def is_compatible_loader(cls, context):
return get_current_host_name() in cls.hosts
# Alternative
class SingleHostEnabledLoad(load.LoaderPlugin):
enabled = get_current_host_name() == "my_host"
product_types = {"*"}
representations = {"*"}
label = "Single Host Enabled Load"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment