diff --git a/server_addon/unreal/client/ayon_unreal/__init__.py b/server_addon/unreal/client/ayon_unreal/__init__.py index 7dd6875154..6be5ae13c9 100644 --- a/server_addon/unreal/client/ayon_unreal/__init__.py +++ b/server_addon/unreal/client/ayon_unreal/__init__.py @@ -1,9 +1,10 @@ from .version import __version__ -from .addon import UnrealAddon +from .addon import UNREAL_ADDON_ROOT, UnrealAddon __all__ = ( "__version__", + "UNREAL_ADDON_ROOT", "UnrealAddon", ) diff --git a/server_addon/unreal/client/ayon_unreal/addon.py b/server_addon/unreal/client/ayon_unreal/addon.py index 5cfbc3c019..d9e1bfaca9 100644 --- a/server_addon/unreal/client/ayon_unreal/addon.py +++ b/server_addon/unreal/client/ayon_unreal/addon.py @@ -4,7 +4,7 @@ from ayon_core.addon import AYONAddon, IHostAddon from .version import __version__ -UNREAL_ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) +UNREAL_ADDON_ROOT = os.path.dirname(os.path.abspath(__file__)) class UnrealAddon(AYONAddon, IHostAddon): @@ -14,7 +14,7 @@ class UnrealAddon(AYONAddon, IHostAddon): def get_global_environments(self): return { - "AYON_UNREAL_ROOT": UNREAL_ROOT_DIR, + "AYON_UNREAL_ROOT": UNREAL_ADDON_ROOT, } def add_implementation_envs(self, env, app): @@ -43,11 +43,11 @@ class UnrealAddon(AYONAddon, IHostAddon): ue_version = app.name.replace("-", ".") unreal_plugin_path = os.path.join( - UNREAL_ROOT_DIR, "integration", "UE_{}".format(ue_version), "Ayon" + UNREAL_ADDON_ROOT, "integration", "UE_{}".format(ue_version), "Ayon" ) if not Path(unreal_plugin_path).exists(): compatible_versions = get_compatible_integration( - ue_version, Path(UNREAL_ROOT_DIR) / "integration" + ue_version, Path(UNREAL_ADDON_ROOT) / "integration" ) if compatible_versions: unreal_plugin_path = compatible_versions[-1] / "Ayon" @@ -70,7 +70,7 @@ class UnrealAddon(AYONAddon, IHostAddon): if app.host_name != self.host_name: return [] return [ - os.path.join(UNREAL_ROOT_DIR, "hooks") + os.path.join(UNREAL_ADDON_ROOT, "hooks") ] def get_workfile_extensions(self): diff --git a/server_addon/unreal/client/ayon_unreal/api/pipeline.py b/server_addon/unreal/client/ayon_unreal/api/pipeline.py index a60564d5b0..9f8502669d 100644 --- a/server_addon/unreal/client/ayon_unreal/api/pipeline.py +++ b/server_addon/unreal/client/ayon_unreal/api/pipeline.py @@ -21,8 +21,8 @@ from ayon_core.pipeline import ( get_current_project_name, ) from ayon_core.tools.utils import host_tools -import ayon_core.hosts.unreal from ayon_core.host import HostBase, ILoadHost, IPublishHost +from ayon_unreal import UNREAL_ADDON_ROOT import unreal # noqa @@ -36,8 +36,7 @@ UNREAL_VERSION = semver.VersionInfo( *os.getenv("AYON_UNREAL_VERSION").split(".") ) -HOST_DIR = os.path.dirname(os.path.abspath(ayon_core.hosts.unreal.__file__)) -PLUGINS_DIR = os.path.join(HOST_DIR, "plugins") +PLUGINS_DIR = os.path.join(UNREAL_ADDON_ROOT, "plugins") PUBLISH_PATH = os.path.join(PLUGINS_DIR, "publish") LOAD_PATH = os.path.join(PLUGINS_DIR, "load") CREATE_PATH = os.path.join(PLUGINS_DIR, "create")