renamed 'HOST_DIR to 'FLAME_ADDON_ROOT'

This commit is contained in:
Jakub Trllo 2024-05-30 11:28:54 +02:00
parent 6bd274df24
commit 7ad67f57b9
5 changed files with 13 additions and 12 deletions

View file

@ -1,10 +1,10 @@
from .addon import (
HOST_DIR,
FLAME_ADDON_ROOT,
FlameAddon,
)
__all__ = (
"HOST_DIR",
"FLAME_ADDON_ROOT",
"FlameAddon",
)

View file

@ -1,7 +1,7 @@
import os
from ayon_core.addon import AYONAddon, IHostAddon
HOST_DIR = os.path.dirname(os.path.abspath(__file__))
FLAME_ADDON_ROOT = os.path.dirname(os.path.abspath(__file__))
class FlameAddon(AYONAddon, IHostAddon):
@ -10,7 +10,7 @@ class FlameAddon(AYONAddon, IHostAddon):
def add_implementation_envs(self, env, _app):
# Add requirements to DL_PYTHON_HOOK_PATH
env["DL_PYTHON_HOOK_PATH"] = os.path.join(HOST_DIR, "startup")
env["DL_PYTHON_HOOK_PATH"] = os.path.join(FLAME_ADDON_ROOT, "startup")
env.pop("QT_AUTO_SCREEN_SCALE_FACTOR", None)
# Set default values if are not already set via settings
@ -25,7 +25,7 @@ class FlameAddon(AYONAddon, IHostAddon):
if app.host_name != self.host_name:
return []
return [
os.path.join(HOST_DIR, "hooks")
os.path.join(FLAME_ADDON_ROOT, "hooks")
]
def get_workfile_extensions(self):

View file

@ -13,6 +13,7 @@ from ayon_core.pipeline import (
deregister_creator_plugin_path,
AVALON_CONTAINER_ID,
)
from ayon_flame import FLAME_ADDON_ROOT
from .lib import (
set_segment_data_marker,
set_publish_attribute,
@ -20,10 +21,8 @@ from .lib import (
get_current_sequence,
reset_segment_selection
)
from .. import HOST_DIR
API_DIR = os.path.join(HOST_DIR, "api")
PLUGINS_DIR = os.path.join(HOST_DIR, "plugins")
PLUGINS_DIR = os.path.join(FLAME_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")

View file

@ -5,6 +5,8 @@ Flame utils for syncing scripts
import os
import shutil
from ayon_core.lib import Logger
from ayon_flame import FLAME_ADDON_ROOT
log = Logger.get_logger(__name__)
@ -16,7 +18,6 @@ def _sync_utility_scripts(env=None):
`/opt/Autodesk/shared/python`. This will be always synchronizing those
folders.
"""
from .. import HOST_DIR
env = env or os.environ
@ -26,7 +27,7 @@ def _sync_utility_scripts(env=None):
flame_shared_dir = "/opt/Autodesk/shared/python"
fsd_paths = [os.path.join(
HOST_DIR,
FLAME_ADDON_ROOT,
"api",
"utility_scripts"
)]

View file

@ -10,7 +10,7 @@ from ayon_core.lib import (
run_subprocess,
)
from ayon_applications import PreLaunchHook, LaunchTypes
from ayon_core.hosts import flame as opflame
from ayon_flame import FLAME_ADDON_ROOT
class FlamePrelaunch(PreLaunchHook):
@ -23,7 +23,8 @@ class FlamePrelaunch(PreLaunchHook):
permissions = 0o777
wtc_script_path = os.path.join(
opflame.HOST_DIR, "api", "scripts", "wiretap_com.py")
FLAME_ADDON_ROOT, "api", "scripts", "wiretap_com.py"
)
launch_types = {LaunchTypes.local}
def __init__(self, *args, **kwargs):