Created
February 6, 2025 12:20
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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