From e8954219ae3916ffd47ce798fb9d703658f404dd Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:24:49 +0100 Subject: [PATCH 01/19] use 'AYON_LOG_NO_COLORS' and 'AYON_DEBUG' --- client/ayon_core/hosts/aftereffects/addon.py | 2 +- .../ayon_core/hosts/aftereffects/api/extension/js/main.js | 2 +- client/ayon_core/hosts/aftereffects/api/launch_logic.py | 2 +- client/ayon_core/hosts/fusion/addon.py | 2 +- client/ayon_core/hosts/harmony/api/lib.py | 2 +- client/ayon_core/hosts/maya/addon.py | 2 +- client/ayon_core/hosts/photoshop/addon.py | 2 +- client/ayon_core/hosts/photoshop/api/lib.py | 2 +- client/ayon_core/hosts/resolve/hooks/pre_resolve_setup.py | 4 ++-- client/ayon_core/hosts/substancepainter/addon.py | 2 +- client/ayon_core/hosts/tvpaint/addon.py | 2 +- client/ayon_core/hosts/unreal/addon.py | 2 +- client/ayon_core/lib/log.py | 8 ++++---- client/ayon_core/lib/terminal.py | 8 ++++---- .../plugins/publish/submit_aftereffects_deadline.py | 2 +- .../deadline/plugins/publish/submit_blender_deadline.py | 2 +- .../deadline/plugins/publish/submit_fusion_deadline.py | 2 +- .../deadline/plugins/publish/submit_harmony_deadline.py | 2 +- .../plugins/publish/submit_houdini_cache_deadline.py | 2 +- .../plugins/publish/submit_houdini_render_deadline.py | 2 +- .../deadline/plugins/publish/submit_max_deadline.py | 2 +- .../deadline/plugins/publish/submit_maya_deadline.py | 2 +- .../publish/submit_maya_remote_publish_deadline.py | 2 +- .../deadline/plugins/publish/submit_publish_cache_job.py | 2 +- .../deadline/plugins/publish/submit_publish_job.py | 2 +- 25 files changed, 32 insertions(+), 32 deletions(-) diff --git a/client/ayon_core/hosts/aftereffects/addon.py b/client/ayon_core/hosts/aftereffects/addon.py index 2a5da8b3a8..278f836a72 100644 --- a/client/ayon_core/hosts/aftereffects/addon.py +++ b/client/ayon_core/hosts/aftereffects/addon.py @@ -11,7 +11,7 @@ def initialize(self, module_settings): def add_implementation_envs(self, env, _app): """Modify environments to contain all required for implementation.""" defaults = { - "OPENPYPE_LOG_NO_COLORS": "True", + "AYON_LOG_NO_COLORS": "1", "WEBSOCKET_URL": "ws://localhost:8097/ws/" } for key, value in defaults.items(): diff --git a/client/ayon_core/hosts/aftereffects/api/extension/js/main.js b/client/ayon_core/hosts/aftereffects/api/extension/js/main.js index 643671b3e1..a9f91e436f 100644 --- a/client/ayon_core/hosts/aftereffects/api/extension/js/main.js +++ b/client/ayon_core/hosts/aftereffects/api/extension/js/main.js @@ -17,7 +17,7 @@ async function startUp(url){ var res = await promis; log.warn("res: " + res); - promis = runEvalScript("getEnv('OPENPYPE_DEBUG')"); + promis = runEvalScript("getEnv('AYON_DEBUG')"); var debug = await promis; log.warn("debug: " + debug); if (debug && debug.toString() == '3'){ diff --git a/client/ayon_core/hosts/aftereffects/api/launch_logic.py b/client/ayon_core/hosts/aftereffects/api/launch_logic.py index d8516f002f..ad521c2f01 100644 --- a/client/ayon_core/hosts/aftereffects/api/launch_logic.py +++ b/client/ayon_core/hosts/aftereffects/api/launch_logic.py @@ -42,7 +42,7 @@ def main(*subprocess_args): host = AfterEffectsHost() install_host(host) - os.environ["OPENPYPE_LOG_NO_COLORS"] = "False" + os.environ["AYON_LOG_NO_COLORS"] = "0" app = get_ayon_qt_app() app.setQuitOnLastWindowClosed(False) diff --git a/client/ayon_core/hosts/fusion/addon.py b/client/ayon_core/hosts/fusion/addon.py index 67ff5fbe6b..7eff2d93c8 100644 --- a/client/ayon_core/hosts/fusion/addon.py +++ b/client/ayon_core/hosts/fusion/addon.py @@ -63,7 +63,7 @@ def get_launch_hook_paths(self, app): def add_implementation_envs(self, env, app): # Set default values if are not already set via settings - defaults = {"OPENPYPE_LOG_NO_COLORS": "Yes"} + defaults = {"AYON_LOG_NO_COLORS": "1"} for key, value in defaults.items(): if not env.get(key): env[key] = value diff --git a/client/ayon_core/hosts/harmony/api/lib.py b/client/ayon_core/hosts/harmony/api/lib.py index 33fe26e558..782134c343 100644 --- a/client/ayon_core/hosts/harmony/api/lib.py +++ b/client/ayon_core/hosts/harmony/api/lib.py @@ -81,7 +81,7 @@ class _ZipFile(zipfile.ZipFile): def main(*subprocess_args): # coloring in StdOutBroker - os.environ["OPENPYPE_LOG_NO_COLORS"] = "False" + os.environ["AYON_LOG_NO_COLORS"] = "0" app = QtWidgets.QApplication([]) app.setQuitOnLastWindowClosed(False) icon = QtGui.QIcon(style.get_app_icon_path()) diff --git a/client/ayon_core/hosts/maya/addon.py b/client/ayon_core/hosts/maya/addon.py index c411f79d6e..745850f6a8 100644 --- a/client/ayon_core/hosts/maya/addon.py +++ b/client/ayon_core/hosts/maya/addon.py @@ -29,7 +29,7 @@ def add_implementation_envs(self, env, _app): # Set default environments envs = { - "OPENPYPE_LOG_NO_COLORS": "Yes", + "AYON_LOG_NO_COLORS": "1", # For python module 'qtpy' "QT_API": "PySide2", # For python module 'Qt' diff --git a/client/ayon_core/hosts/photoshop/addon.py b/client/ayon_core/hosts/photoshop/addon.py index aa61c08b32..0c7efdb317 100644 --- a/client/ayon_core/hosts/photoshop/addon.py +++ b/client/ayon_core/hosts/photoshop/addon.py @@ -14,7 +14,7 @@ def initialize(self, module_settings): def add_implementation_envs(self, env, _app): """Modify environments to contain all required for implementation.""" defaults = { - "OPENPYPE_LOG_NO_COLORS": "True", + "AYON_LOG_NO_COLORS": "1", "WEBSOCKET_URL": "ws://localhost:8099/ws/" } for key, value in defaults.items(): diff --git a/client/ayon_core/hosts/photoshop/api/lib.py b/client/ayon_core/hosts/photoshop/api/lib.py index 8a11bfee8f..3111503e40 100644 --- a/client/ayon_core/hosts/photoshop/api/lib.py +++ b/client/ayon_core/hosts/photoshop/api/lib.py @@ -28,7 +28,7 @@ def main(*subprocess_args): sys.excepthook = safe_excepthook # coloring in StdOutBroker - os.environ["OPENPYPE_LOG_NO_COLORS"] = "False" + os.environ["AYON_LOG_NO_COLORS"] = "0" app = get_ayon_qt_app() app.setQuitOnLastWindowClosed(False) diff --git a/client/ayon_core/hosts/resolve/hooks/pre_resolve_setup.py b/client/ayon_core/hosts/resolve/hooks/pre_resolve_setup.py index be8ccaa5c5..c14fd75b2f 100644 --- a/client/ayon_core/hosts/resolve/hooks/pre_resolve_setup.py +++ b/client/ayon_core/hosts/resolve/hooks/pre_resolve_setup.py @@ -25,7 +25,7 @@ class PreLaunchResolveSetup(PreLaunchHook): It also defines: - `RESOLVE_UTILITY_SCRIPTS_DIR`: Destination directory for OpenPype Fusion scripts to be copied to for Resolve to pick them up. - - `OPENPYPE_LOG_NO_COLORS` to True to ensure OP doesn't try to + - `AYON_LOG_NO_COLORS` to True to ensure OP doesn't try to use logging with terminal colors as it fails in Resolve. """ @@ -132,7 +132,7 @@ def execute(self): ] = resolve_utility_scripts_dir.as_posix() # remove terminal coloring tags - self.launch_context.env["OPENPYPE_LOG_NO_COLORS"] = "True" + self.launch_context.env["AYON_LOG_NO_COLORS"] = "1" # Resolve Setup integration setup(self.launch_context.env) diff --git a/client/ayon_core/hosts/substancepainter/addon.py b/client/ayon_core/hosts/substancepainter/addon.py index 7fbe93aa21..a7f21c2288 100644 --- a/client/ayon_core/hosts/substancepainter/addon.py +++ b/client/ayon_core/hosts/substancepainter/addon.py @@ -21,7 +21,7 @@ def add_implementation_envs(self, env, _app): env["SUBSTANCE_PAINTER_PLUGINS_PATH"] = plugin_path # Log in Substance Painter doesn't support custom terminal colors - env["OPENPYPE_LOG_NO_COLORS"] = "Yes" + env["AYON_LOG_NO_COLORS"] = "1" def get_launch_hook_paths(self, app): if app.host_name != self.host_name: diff --git a/client/ayon_core/hosts/tvpaint/addon.py b/client/ayon_core/hosts/tvpaint/addon.py index d9f3b219ab..375f7266ae 100644 --- a/client/ayon_core/hosts/tvpaint/addon.py +++ b/client/ayon_core/hosts/tvpaint/addon.py @@ -23,7 +23,7 @@ def add_implementation_envs(self, env, _app): """Modify environments to contain all required for implementation.""" defaults = { - "OPENPYPE_LOG_NO_COLORS": "True" + "AYON_LOG_NO_COLORS": "1" } for key, value in defaults.items(): if not env.get(key): diff --git a/client/ayon_core/hosts/unreal/addon.py b/client/ayon_core/hosts/unreal/addon.py index 3cc695ba99..888246bd97 100644 --- a/client/ayon_core/hosts/unreal/addon.py +++ b/client/ayon_core/hosts/unreal/addon.py @@ -59,7 +59,7 @@ def add_implementation_envs(self, env, app): # Set default environments if are not set via settings defaults = { - "OPENPYPE_LOG_NO_COLORS": "True", + "AYON_LOG_NO_COLORS": "1", "UE_PYTHONPATH": os.environ.get("PYTHONPATH", ""), } for key, value in defaults.items(): diff --git a/client/ayon_core/lib/log.py b/client/ayon_core/lib/log.py index b6fd77021c..cbb1e41bae 100644 --- a/client/ayon_core/lib/log.py +++ b/client/ayon_core/lib/log.py @@ -134,7 +134,7 @@ class Logger: initialized = False _init_lock = threading.Lock() - # Logging level - OPENPYPE_LOG_LEVEL + # Logging level - AYON_LOG_LEVEL log_level = None # Data same for all record documents @@ -194,10 +194,10 @@ def _initialize(cls): cls.initialized = False # Define what is logging level - log_level = os.getenv("OPENPYPE_LOG_LEVEL") + log_level = os.getenv("AYON_LOG_LEVEL") if not log_level: - # Check OPENPYPE_DEBUG for backwards compatibility - op_debug = os.getenv("OPENPYPE_DEBUG") + # Check AYON_DEBUG for debug level + op_debug = os.getenv("AYON_DEBUG") if op_debug and int(op_debug) > 0: log_level = 10 else: diff --git a/client/ayon_core/lib/terminal.py b/client/ayon_core/lib/terminal.py index 29537234e8..f822a37286 100644 --- a/client/ayon_core/lib/terminal.py +++ b/client/ayon_core/lib/terminal.py @@ -21,7 +21,7 @@ class Terminal: If :mod:`Colorama` is not found, it will still work, but without colors. Depends on :mod:`Colorama` - Using **OPENPYPE_LOG_NO_COLORS** environment variable. + Using **AYON_LOG_NO_COLORS** environment variable. """ # Is Terminal initialized @@ -38,7 +38,7 @@ def _initialize(): """Initialize Terminal class as object. First check if colorized output is disabled by environment variable - `OPENPYPE_LOG_NO_COLORS` value. By default is colorized output turned + `AYON_LOG_NO_COLORS` value. By default is colorized output turned on. Then tries to import python module that do the colors magic and create @@ -50,7 +50,7 @@ def _initialize(): from ayon_core.lib import env_value_to_bool log_no_colors = env_value_to_bool( - "OPENPYPE_LOG_NO_COLORS", default=None + "AYON_LOG_NO_COLORS", default=None ) if log_no_colors is not None: Terminal.use_colors = not log_no_colors @@ -169,7 +169,7 @@ def echo(message): def log(message): """Return color formatted message. - If environment variable `OPENPYPE_LOG_NO_COLORS` is set to + If environment variable `AYON_LOG_NO_COLORS` is set to whatever value, message will be formatted but not colorized. Args: diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_aftereffects_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_aftereffects_deadline.py index af8978c43d..2db585f772 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_aftereffects_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_aftereffects_deadline.py @@ -86,7 +86,7 @@ def get_job_info(self): "AVALON_TASK", "AVALON_APP_NAME", "OPENPYPE_DEV", - "OPENPYPE_LOG_NO_COLORS", + "AYON_LOG_NO_COLORS", "IS_TEST" ] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py index cdc19e87a0..ddd2b7cdf8 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py @@ -122,7 +122,7 @@ def get_job_info(self): # to recognize job from PYPE for turning Event On/Off job_info.add_render_job_env_var() - job_info.EnvironmentKeyValue["OPENPYPE_LOG_NO_COLORS"] = "1" + job_info.EnvironmentKeyValue["AYON_LOG_NO_COLORS"] = "1" # Adding file dependencies. if self.asset_dependencies: diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py index a5f590188e..f62c050704 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py @@ -226,7 +226,7 @@ def process(self, instance): "AVALON_TASK", "AVALON_APP_NAME", "OPENPYPE_DEV", - "OPENPYPE_LOG_NO_COLORS", + "AYON_LOG_NO_COLORS", "IS_TEST", "AYON_BUNDLE_NAME", ] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_harmony_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_harmony_deadline.py index 5941b872a4..a1498add42 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_harmony_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_harmony_deadline.py @@ -279,7 +279,7 @@ def get_job_info(self): "AVALON_TASK", "AVALON_APP_NAME", "OPENPYPE_DEV", - "OPENPYPE_LOG_NO_COLORS" + "AYON_LOG_NO_COLORS" "IS_TEST" ] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py index 553e2e58c9..c6514d088e 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py @@ -104,7 +104,7 @@ def get_job_info(self): "AVALON_TASK", "AVALON_APP_NAME", "OPENPYPE_DEV", - "OPENPYPE_LOG_NO_COLORS", + "AYON_LOG_NO_COLORS", ] environment = dict({key: os.environ[key] for key in keys diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 79ab96aa50..0d33534ecb 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -209,7 +209,7 @@ def get_job_info(self, dependency_job_ids=None): "AVALON_TASK", "AVALON_APP_NAME", "OPENPYPE_DEV", - "OPENPYPE_LOG_NO_COLORS", + "AYON_LOG_NO_COLORS", ] environment = dict({key: os.environ[key] for key in keys diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py index caf56db967..87637fc433 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py @@ -126,7 +126,7 @@ def get_job_info(self): # to recognize render jobs job_info.add_render_job_env_var() - job_info.EnvironmentKeyValue["OPENPYPE_LOG_NO_COLORS"] = "1" + job_info.EnvironmentKeyValue["AYON_LOG_NO_COLORS"] = "1" # Add list of expected files to job # --------------------------------- diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py index 1651f377d2..9f83d271f7 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py @@ -219,7 +219,7 @@ def get_job_info(self): # to recognize render jobs job_info.add_render_job_env_var() - job_info.EnvironmentKeyValue["OPENPYPE_LOG_NO_COLORS"] = "1" + job_info.EnvironmentKeyValue["AYON_LOG_NO_COLORS"] = "1" # Adding file dependencies. if not bool(os.environ.get("IS_TEST")) and self.asset_dependencies: diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py index ab78efa196..2b497d0626 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py @@ -106,10 +106,10 @@ def get_job_info(self): environment["AVALON_ASSET"] = instance.context.data["asset"] environment["AVALON_TASK"] = instance.context.data["task"] environment["AVALON_APP_NAME"] = os.environ.get("AVALON_APP_NAME") - environment["OPENPYPE_LOG_NO_COLORS"] = "1" environment["OPENPYPE_USERNAME"] = instance.context.data["user"] environment["OPENPYPE_PUBLISH_SUBSET"] = instance.data["subset"] environment["OPENPYPE_REMOTE_PUBLISH"] = "1" + environment["AYON_LOG_NO_COLORS"] = "1" environment["AYON_REMOTE_PUBLISH"] = "1" for key, value in environment.items(): diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py index cb0251402d..83740b3ff3 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py @@ -134,7 +134,7 @@ def _submit_deadline_post_job(self, instance, job): "AVALON_ASSET": instance.context.data["asset"], "AVALON_TASK": instance.context.data["task"], "OPENPYPE_USERNAME": instance.context.data["user"], - "OPENPYPE_LOG_NO_COLORS": "1", + "AYON_LOG_NO_COLORS": "1", "IS_TEST": str(int(is_in_tests())), "AYON_PUBLISH_JOB": "1", "AYON_RENDER_JOB": "0", diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index 31d57ed2b6..0729629208 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -190,7 +190,7 @@ def _submit_deadline_post_job(self, instance, job, instances): "AVALON_ASSET": instance.context.data["asset"], "AVALON_TASK": instance.context.data["task"], "OPENPYPE_USERNAME": instance.context.data["user"], - "OPENPYPE_LOG_NO_COLORS": "1", + "AYON_LOG_NO_COLORS": "1", "IS_TEST": str(int(is_in_tests())), "AYON_PUBLISH_JOB": "1", "AYON_RENDER_JOB": "0", From 634d2daf606700a7b30fac2117ddd15a5f4f609b Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:38:43 +0100 Subject: [PATCH 02/19] use 'AYON_PROJECT_ROOT_' prefix for project roots --- client/ayon_core/hosts/maya/api/plugin.py | 4 ++-- client/ayon_core/hosts/nuke/api/lib.py | 2 +- client/ayon_core/pipeline/anatomy.py | 20 ++++++++------------ 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/client/ayon_core/hosts/maya/api/plugin.py b/client/ayon_core/hosts/maya/api/plugin.py index 2a1a531012..c5e3f42d10 100644 --- a/client/ayon_core/hosts/maya/api/plugin.py +++ b/client/ayon_core/hosts/maya/api/plugin.py @@ -925,8 +925,8 @@ def remove(self, container): def prepare_root_value(self, file_url, project_name): """Replace root value with env var placeholder. - Use ${OPENPYPE_ROOT_WORK} (or any other root) instead of proper root - value when storing referenced url into a workfile. + Use ${AYON_PROJECT_ROOT_WORK} (or any other root) instead of proper + root value when storing referenced url into a workfile. Useful for remote workflows with SiteSync. Args: diff --git a/client/ayon_core/hosts/nuke/api/lib.py b/client/ayon_core/hosts/nuke/api/lib.py index eb85c14fdb..86496a4804 100644 --- a/client/ayon_core/hosts/nuke/api/lib.py +++ b/client/ayon_core/hosts/nuke/api/lib.py @@ -2227,7 +2227,7 @@ def _get_included_vars(self, config_template): # include all project root related env vars for env_var in os.environ: - if env_var.startswith("OPENPYPE_PROJECT_ROOT_"): + if env_var.startswith("AYON_PROJECT_ROOT_"): included_vars.append(env_var) # use regex to find env var in template with format {ENV_VAR} diff --git a/client/ayon_core/pipeline/anatomy.py b/client/ayon_core/pipeline/anatomy.py index 777158edd1..86b7d92309 100644 --- a/client/ayon_core/pipeline/anatomy.py +++ b/client/ayon_core/pipeline/anatomy.py @@ -125,7 +125,7 @@ def roots_obj(self): return self._roots_obj def root_environments(self): - """Return OPENPYPE_ROOT_* environments for current project in dict.""" + """Return AYON_PROJECT_ROOT_* environments for current project.""" return self._roots_obj.root_environments() def root_environmets_fill_data(self, template=None): @@ -150,7 +150,7 @@ def all_root_paths(self): return self.roots_obj.all_root_paths() def set_root_environments(self): - """Set OPENPYPE_ROOT_* environments for current project.""" + """Set AYON_PROJECT_ROOT_* environments for current project.""" self._roots_obj.set_root_environments() def root_names(self): @@ -289,7 +289,7 @@ def replace_root_with_env_key(self, filepath, template=None): "<{}>" ## Output - "/project/asset/task/animation_v001.ma" + "/project/asset/task/animation_v001.ma" Args: filepath (str): Full file path where root should be replaced. @@ -1206,7 +1206,7 @@ class Roots: anatomy Anatomy: Anatomy object created for a specific project. """ - env_prefix = "OPENPYPE_PROJECT_ROOT" + env_prefix = "AYON_PROJECT_ROOT" roots_filename = "roots.json" def __init__(self, anatomy): @@ -1312,8 +1312,8 @@ def set_root_environments(self): def root_environments(self): """Use root keys to create unique keys for environment variables. - Concatenates prefix "OPENPYPE_ROOT" with root keys to create unique - keys. + Concatenates prefix "AYON_PROJECT_ROOT_" with root keys to create + unique keys. Returns: dict: Result is `{(str): (str)}` dicitonary where key represents @@ -1335,14 +1335,10 @@ def root_environments(self): Result on windows platform:: { - "OPENPYPE_ROOT_WORK": "P:/projects/work", - "OPENPYPE_ROOT_PUBLISH": "P:/projects/publish" + "AYON_PROJECT_ROOT_WORK": "P:/projects/work", + "AYON_PROJECT_ROOT_PUBLISH": "P:/projects/publish" } - Short example when multiroot is not used:: - { - "OPENPYPE_ROOT": "P:/projects" - } """ return self._root_environments() From 92ad7b49fc783bcc2cd6526a006803141740fded Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:39:38 +0100 Subject: [PATCH 03/19] removed unused 'OPENPYPE_DEV' env key --- .../deadline/plugins/publish/submit_aftereffects_deadline.py | 1 - .../modules/deadline/plugins/publish/submit_blender_deadline.py | 1 - .../modules/deadline/plugins/publish/submit_fusion_deadline.py | 1 - .../modules/deadline/plugins/publish/submit_harmony_deadline.py | 1 - .../deadline/plugins/publish/submit_houdini_cache_deadline.py | 1 - .../deadline/plugins/publish/submit_houdini_render_deadline.py | 1 - .../modules/deadline/plugins/publish/submit_max_deadline.py | 1 - .../modules/deadline/plugins/publish/submit_maya_deadline.py | 1 - 8 files changed, 8 deletions(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_aftereffects_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_aftereffects_deadline.py index 2db585f772..f7bc5529fb 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_aftereffects_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_aftereffects_deadline.py @@ -85,7 +85,6 @@ def get_job_info(self): "AVALON_ASSET", "AVALON_TASK", "AVALON_APP_NAME", - "OPENPYPE_DEV", "AYON_LOG_NO_COLORS", "IS_TEST" ] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py index ddd2b7cdf8..c8b72ca52b 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_blender_deadline.py @@ -107,7 +107,6 @@ def get_job_info(self): "AVALON_ASSET", "AVALON_TASK", "AVALON_APP_NAME", - "OPENPYPE_DEV" "IS_TEST" ] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py index f62c050704..77505eb623 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_fusion_deadline.py @@ -225,7 +225,6 @@ def process(self, instance): "AVALON_ASSET", "AVALON_TASK", "AVALON_APP_NAME", - "OPENPYPE_DEV", "AYON_LOG_NO_COLORS", "IS_TEST", "AYON_BUNDLE_NAME", diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_harmony_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_harmony_deadline.py index a1498add42..781b5ba74b 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_harmony_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_harmony_deadline.py @@ -278,7 +278,6 @@ def get_job_info(self): "AVALON_ASSET", "AVALON_TASK", "AVALON_APP_NAME", - "OPENPYPE_DEV", "AYON_LOG_NO_COLORS" "IS_TEST" ] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py index c6514d088e..eed930e372 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_cache_deadline.py @@ -103,7 +103,6 @@ def get_job_info(self): "AVALON_ASSET", "AVALON_TASK", "AVALON_APP_NAME", - "OPENPYPE_DEV", "AYON_LOG_NO_COLORS", ] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py index 0d33534ecb..9988248957 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_houdini_render_deadline.py @@ -208,7 +208,6 @@ def get_job_info(self, dependency_job_ids=None): "AVALON_ASSET", "AVALON_TASK", "AVALON_APP_NAME", - "OPENPYPE_DEV", "AYON_LOG_NO_COLORS", ] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py index 87637fc433..0a7c96008e 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_max_deadline.py @@ -111,7 +111,6 @@ def get_job_info(self): "AVALON_ASSET", "AVALON_TASK", "AVALON_APP_NAME", - "OPENPYPE_DEV", "IS_TEST" ] diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py index 9f83d271f7..84e6e93e6a 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_deadline.py @@ -204,7 +204,6 @@ def get_job_info(self): "AVALON_ASSET", "AVALON_TASK", "AVALON_APP_NAME", - "OPENPYPE_DEV" "IS_TEST" ] From 4ca1fae9417411db26db4f1becfb794c26df4865 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:42:45 +0100 Subject: [PATCH 04/19] removed unused 'OPENPYPE_METADATA_FILE' --- .../plugins/publish/submit_publish_cache_job.py | 10 ---------- .../plugins/publish/submit_publish_job.py | 10 ---------- .../publish/create_publish_royalrender_job.py | 16 ---------------- 3 files changed, 36 deletions(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py index 83740b3ff3..42f60f07a6 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py @@ -64,10 +64,6 @@ class ProcessSubmittedCacheJobOnFarm(pyblish.api.InstancePlugin, families = ["publish.hou"] - environ_job_filter = [ - "OPENPYPE_METADATA_FILE" - ] - environ_keys = [ "FTRACK_API_USER", "FTRACK_API_KEY", @@ -147,12 +143,6 @@ def _submit_deadline_post_job(self, instance, job): if os.getenv(env_key): environment[env_key] = os.environ[env_key] - # pass environment keys from self.environ_job_filter - job_environ = job["Props"].get("Env", {}) - for env_j_key in self.environ_job_filter: - if job_environ.get(env_j_key): - environment[env_j_key] = job_environ[env_j_key] - priority = self.deadline_priority or instance.data.get("priority", 50) instance_settings = self.get_attr_values_from_data(instance.data) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index 0729629208..cfbff118a5 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -106,10 +106,6 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, "celaction": [r".*"], "max": [r".*"]} - environ_job_filter = [ - "OPENPYPE_METADATA_FILE" - ] - environ_keys = [ "FTRACK_API_USER", "FTRACK_API_KEY", @@ -203,12 +199,6 @@ def _submit_deadline_post_job(self, instance, job, instances): if os.getenv(env_key): environment[env_key] = os.environ[env_key] - # pass environment keys from self.environ_job_filter - job_environ = job["Props"].get("Env", {}) - for env_j_key in self.environ_job_filter: - if job_environ.get(env_j_key): - environment[env_j_key] = job_environ[env_j_key] - priority = self.deadline_priority or instance.data.get("priority", 50) instance_settings = self.get_attr_values_from_data(instance.data) diff --git a/client/ayon_core/modules/royalrender/plugins/publish/create_publish_royalrender_job.py b/client/ayon_core/modules/royalrender/plugins/publish/create_publish_royalrender_job.py index 8a4f6b53ae..40c279d011 100644 --- a/client/ayon_core/modules/royalrender/plugins/publish/create_publish_royalrender_job.py +++ b/client/ayon_core/modules/royalrender/plugins/publish/create_publish_royalrender_job.py @@ -62,10 +62,6 @@ class CreatePublishRoyalRenderJob(pyblish.api.InstancePlugin, # list of family names to transfer to new family if present families_transfer = ["render3d", "render2d", "ftrack", "slate"] - environ_job_filter = [ - "OPENPYPE_METADATA_FILE" - ] - environ_keys = [ "FTRACK_API_USER", "FTRACK_API_KEY", @@ -200,22 +196,10 @@ def get_job(self, instance, instances): # pass environment keys from self.environ_job_filter # and collect all pre_ids to wait for - job_environ = {} jobs_pre_ids = [] for job in instance.data["rrJobs"]: # type: RRJob - if job.rrEnvList: - if len(job.rrEnvList) > 2000: - self.log.warning(("Job environment is too long " - f"{len(job.rrEnvList)} > 2000")) - job_environ.update( - dict(RREnvList.parse(job.rrEnvList)) - ) jobs_pre_ids.append(job.PreID) - for env_j_key in self.environ_job_filter: - if job_environ.get(env_j_key): - environment[env_j_key] = job_environ[env_j_key] - priority = self.priority or instance.data.get("priority", 50) # rr requires absolut path or all jobs won't show up in rControl From b6f81f64a056ec7cba23b5cbebe4b26333a73742 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:51:14 +0100 Subject: [PATCH 05/19] use 'AYON_WORKFILE_TOOL_ON_START' instead of 'OPENPYPE_WORKFILE_TOOL_ON_START' --- client/ayon_core/hosts/nuke/api/lib.py | 2 +- client/ayon_core/lib/applications.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/hosts/nuke/api/lib.py b/client/ayon_core/hosts/nuke/api/lib.py index 86496a4804..0a2a218bf8 100644 --- a/client/ayon_core/hosts/nuke/api/lib.py +++ b/client/ayon_core/hosts/nuke/api/lib.py @@ -2890,7 +2890,7 @@ def launch_workfiles_app(): # get all imortant settings open_at_start = env_value_to_bool( - env_key="OPENPYPE_WORKFILE_TOOL_ON_START", + env_key="AYON_WORKFILE_TOOL_ON_START", default=None) # return if none is defined diff --git a/client/ayon_core/lib/applications.py b/client/ayon_core/lib/applications.py index e05a440990..fbdb3604bf 100644 --- a/client/ayon_core/lib/applications.py +++ b/client/ayon_core/lib/applications.py @@ -1874,7 +1874,7 @@ def _prepare_last_workfile(data, workdir, addons_manager): data["env"]["AVALON_OPEN_LAST_WORKFILE"] = ( str(int(bool(start_last_workfile))) ) - data["env"]["OPENPYPE_WORKFILE_TOOL_ON_START"] = ( + data["env"]["AYON_WORKFILE_TOOL_ON_START"] = ( str(int(bool(workfile_startup))) ) @@ -1989,7 +1989,7 @@ def should_workfile_tool_start( """Define if host should start workfile tool at host launch. Default output is `False`. Can be overridden with environment variable - `OPENPYPE_WORKFILE_TOOL_ON_START`, valid values without case sensitivity are + `AYON_WORKFILE_TOOL_ON_START`, valid values without case sensitivity are `"0", "1", "true", "false", "yes", "no"`. Args: From 5e90b551f6d6714a770081d01213c654de4af723 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:52:05 +0100 Subject: [PATCH 06/19] use 'AYON_HARMONY_JS' instead of 'OPENPYPE_HARMONY_JS' --- client/ayon_core/hosts/harmony/api/pipeline.py | 2 +- client/ayon_core/hosts/harmony/js/creators/CreateRender.js | 4 ++-- .../ayon_core/hosts/harmony/js/loaders/ImageSequenceLoader.js | 4 ++-- client/ayon_core/hosts/harmony/js/loaders/TemplateLoader.js | 4 ++-- .../ayon_core/hosts/harmony/js/publish/CollectCurrentFile.js | 4 ++-- .../ayon_core/hosts/harmony/js/publish/CollectFarmRender.js | 4 ++-- client/ayon_core/hosts/harmony/js/publish/CollectPalettes.js | 4 ++-- client/ayon_core/hosts/harmony/js/publish/ExtractPalette.js | 4 ++-- client/ayon_core/hosts/harmony/js/publish/ExtractTemplate.js | 4 ++-- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/client/ayon_core/hosts/harmony/api/pipeline.py b/client/ayon_core/hosts/harmony/api/pipeline.py index 47fae6860d..863053dddc 100644 --- a/client/ayon_core/hosts/harmony/api/pipeline.py +++ b/client/ayon_core/hosts/harmony/api/pipeline.py @@ -126,7 +126,7 @@ def check_inventory(): def application_launch(event): """Event that is executed after Harmony is launched.""" - # fills OPENPYPE_HARMONY_JS + # fills AYON_HARMONY_JS pype_harmony_path = Path(__file__).parent.parent / "js" / "PypeHarmony.js" pype_harmony_js = pype_harmony_path.read_text() diff --git a/client/ayon_core/hosts/harmony/js/creators/CreateRender.js b/client/ayon_core/hosts/harmony/js/creators/CreateRender.js index 92ec6dfd2f..1a2b606eb9 100644 --- a/client/ayon_core/hosts/harmony/js/creators/CreateRender.js +++ b/client/ayon_core/hosts/harmony/js/creators/CreateRender.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); + var AYON_HARMONY_JS = System.getenv('AYON_HARMONY_JS') + '/PypeHarmony.js'; + include(AYON_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/client/ayon_core/hosts/harmony/js/loaders/ImageSequenceLoader.js b/client/ayon_core/hosts/harmony/js/loaders/ImageSequenceLoader.js index cf8a9a29ca..25afeff214 100644 --- a/client/ayon_core/hosts/harmony/js/loaders/ImageSequenceLoader.js +++ b/client/ayon_core/hosts/harmony/js/loaders/ImageSequenceLoader.js @@ -5,8 +5,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); + var AYON_HARMONY_JS = System.getenv('AYON_HARMONY_JS') + '/PypeHarmony.js'; + include(AYON_HARMONY_JS.replace(/\\/g, "/")); } if (typeof $ === 'undefined'){ diff --git a/client/ayon_core/hosts/harmony/js/loaders/TemplateLoader.js b/client/ayon_core/hosts/harmony/js/loaders/TemplateLoader.js index 1df04c8282..06ef1671ea 100644 --- a/client/ayon_core/hosts/harmony/js/loaders/TemplateLoader.js +++ b/client/ayon_core/hosts/harmony/js/loaders/TemplateLoader.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); + var AYON_HARMONY_JS = System.getenv('AYON_HARMONY_JS') + '/PypeHarmony.js'; + include(AYON_HARMONY_JS.replace(/\\/g, "/")); } if (typeof $ === 'undefined'){ diff --git a/client/ayon_core/hosts/harmony/js/publish/CollectCurrentFile.js b/client/ayon_core/hosts/harmony/js/publish/CollectCurrentFile.js index 2eeb7fb764..b9863d4b29 100644 --- a/client/ayon_core/hosts/harmony/js/publish/CollectCurrentFile.js +++ b/client/ayon_core/hosts/harmony/js/publish/CollectCurrentFile.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); + var AYON_HARMONY_JS = System.getenv('AYON_HARMONY_JS') + '/PypeHarmony.js'; + include(AYON_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/client/ayon_core/hosts/harmony/js/publish/CollectFarmRender.js b/client/ayon_core/hosts/harmony/js/publish/CollectFarmRender.js index 759dc5ce5d..3d9f69ebde 100644 --- a/client/ayon_core/hosts/harmony/js/publish/CollectFarmRender.js +++ b/client/ayon_core/hosts/harmony/js/publish/CollectFarmRender.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); + var AYON_HARMONY_JS = System.getenv('AYON_HARMONY_JS') + '/PypeHarmony.js'; + include(AYON_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/client/ayon_core/hosts/harmony/js/publish/CollectPalettes.js b/client/ayon_core/hosts/harmony/js/publish/CollectPalettes.js index afb0ad854a..0b119c3118 100644 --- a/client/ayon_core/hosts/harmony/js/publish/CollectPalettes.js +++ b/client/ayon_core/hosts/harmony/js/publish/CollectPalettes.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); + var AYON_HARMONY_JS = System.getenv('AYON_HARMONY_JS') + '/PypeHarmony.js'; + include(AYON_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/client/ayon_core/hosts/harmony/js/publish/ExtractPalette.js b/client/ayon_core/hosts/harmony/js/publish/ExtractPalette.js index c4765354c4..fd96de518d 100644 --- a/client/ayon_core/hosts/harmony/js/publish/ExtractPalette.js +++ b/client/ayon_core/hosts/harmony/js/publish/ExtractPalette.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); + var AYON_HARMONY_JS = System.getenv('AYON_HARMONY_JS') + '/PypeHarmony.js'; + include(AYON_HARMONY_JS.replace(/\\/g, "/")); } /** diff --git a/client/ayon_core/hosts/harmony/js/publish/ExtractTemplate.js b/client/ayon_core/hosts/harmony/js/publish/ExtractTemplate.js index 4676e1ff68..3ddad39117 100644 --- a/client/ayon_core/hosts/harmony/js/publish/ExtractTemplate.js +++ b/client/ayon_core/hosts/harmony/js/publish/ExtractTemplate.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); + var AYON_HARMONY_JS = System.getenv('AYON_HARMONY_JS') + '/PypeHarmony.js'; + include(AYON_HARMONY_JS.replace(/\\/g, "/")); } From 7b2c54b97a896f560e9c849e1c1329a98c808b63 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:52:24 +0100 Subject: [PATCH 07/19] use 'AYON_OPEN_WORKFILE_POST_INITIALIZATION' instead of 'OPENPYPE_OPEN_WORKFILE_POST_INITIALIZATION' --- client/ayon_core/hosts/maya/hooks/pre_auto_load_plugins.py | 2 +- .../hosts/maya/hooks/pre_open_workfile_post_initialization.py | 2 +- client/ayon_core/hosts/maya/startup/userSetup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/hosts/maya/hooks/pre_auto_load_plugins.py b/client/ayon_core/hosts/maya/hooks/pre_auto_load_plugins.py index 599a75feb7..ed294da125 100644 --- a/client/ayon_core/hosts/maya/hooks/pre_auto_load_plugins.py +++ b/client/ayon_core/hosts/maya/hooks/pre_auto_load_plugins.py @@ -23,7 +23,7 @@ def execute(self): # Force post initialization so our dedicated plug-in load can run # prior to Maya opening a scene file. - key = "OPENPYPE_OPEN_WORKFILE_POST_INITIALIZATION" + key = "AYON_OPEN_WORKFILE_POST_INITIALIZATION" self.launch_context.env[key] = "1" self.log.debug("Explicit plugins loading.") diff --git a/client/ayon_core/hosts/maya/hooks/pre_open_workfile_post_initialization.py b/client/ayon_core/hosts/maya/hooks/pre_open_workfile_post_initialization.py index 11d7172994..6bf678474f 100644 --- a/client/ayon_core/hosts/maya/hooks/pre_open_workfile_post_initialization.py +++ b/client/ayon_core/hosts/maya/hooks/pre_open_workfile_post_initialization.py @@ -22,5 +22,5 @@ def execute(self): self.data.pop("start_last_workfile") self.log.debug("Opening workfile post initialization.") - key = "OPENPYPE_OPEN_WORKFILE_POST_INITIALIZATION" + key = "AYON_OPEN_WORKFILE_POST_INITIALIZATION" self.launch_context.env[key] = "1" diff --git a/client/ayon_core/hosts/maya/startup/userSetup.py b/client/ayon_core/hosts/maya/startup/userSetup.py index 588dd626b9..882f2df27c 100644 --- a/client/ayon_core/hosts/maya/startup/userSetup.py +++ b/client/ayon_core/hosts/maya/startup/userSetup.py @@ -35,7 +35,7 @@ def _explicit_load_plugins(): ) # Open Workfile Post Initialization. -key = "OPENPYPE_OPEN_WORKFILE_POST_INITIALIZATION" +key = "AYON_OPEN_WORKFILE_POST_INITIALIZATION" if bool(int(os.environ.get(key, "0"))): def _log_and_open(): path = os.environ["AVALON_LAST_WORKFILE"] From a414fc53f614c193c52b723ebdbbc66ece45dbd1 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:54:00 +0100 Subject: [PATCH 08/19] use 'AYON_RESOLVE_OPEN_ON_LAUNCH' instead of 'OPENPYPE_RESOLVE_OPEN_ON_LAUNCH' --- .../hosts/resolve/hooks/pre_resolve_last_workfile.py | 4 ++-- client/ayon_core/hosts/resolve/startup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/hosts/resolve/hooks/pre_resolve_last_workfile.py b/client/ayon_core/hosts/resolve/hooks/pre_resolve_last_workfile.py index c0b38ab757..d82651289c 100644 --- a/client/ayon_core/hosts/resolve/hooks/pre_resolve_last_workfile.py +++ b/client/ayon_core/hosts/resolve/hooks/pre_resolve_last_workfile.py @@ -28,8 +28,8 @@ def execute(self): # Add path to launch environment for the startup script to pick up self.log.info( - "Setting OPENPYPE_RESOLVE_OPEN_ON_LAUNCH to launch " + "Setting AYON_RESOLVE_OPEN_ON_LAUNCH to launch " f"last workfile: {last_workfile}" ) - key = "OPENPYPE_RESOLVE_OPEN_ON_LAUNCH" + key = "AYON_RESOLVE_OPEN_ON_LAUNCH" self.launch_context.env[key] = last_workfile diff --git a/client/ayon_core/hosts/resolve/startup.py b/client/ayon_core/hosts/resolve/startup.py index f021f35542..174a2878c5 100644 --- a/client/ayon_core/hosts/resolve/startup.py +++ b/client/ayon_core/hosts/resolve/startup.py @@ -46,7 +46,7 @@ def open_workfile(path): def main(): # Open last workfile - workfile_path = os.environ.get("OPENPYPE_RESOLVE_OPEN_ON_LAUNCH") + workfile_path = os.environ.get("AYON_RESOLVE_OPEN_ON_LAUNCH") if workfile_path and os.path.exists(workfile_path): log.info(f"Opening last workfile: {workfile_path}") From a263fe214d66e991610f9b2ddc5a36bba43d2f2e Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:54:24 +0100 Subject: [PATCH 09/19] use 'AYON_RESOLVE_STARTUP_SCRIPT' instead of 'OPENPYPE_RESOLVE_STARTUP_SCRIPT' --- client/ayon_core/hosts/resolve/hooks/pre_resolve_startup.py | 4 ++-- .../hosts/resolve/utility_scripts/ayon_startup.scriptlib | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/hosts/resolve/hooks/pre_resolve_startup.py b/client/ayon_core/hosts/resolve/hooks/pre_resolve_startup.py index 1937778335..ab16053450 100644 --- a/client/ayon_core/hosts/resolve/hooks/pre_resolve_startup.py +++ b/client/ayon_core/hosts/resolve/hooks/pre_resolve_startup.py @@ -17,9 +17,9 @@ def execute(self): # in the LUA .scriptlib code op_resolve_root = os.path.dirname(ayon_core.hosts.resolve.__file__) script_path = os.path.join(op_resolve_root, "startup.py") - key = "OPENPYPE_RESOLVE_STARTUP_SCRIPT" + key = "AYON_RESOLVE_STARTUP_SCRIPT" self.launch_context.env[key] = script_path self.log.info( - f"Setting OPENPYPE_RESOLVE_STARTUP_SCRIPT to: {script_path}" + f"Setting AYON_RESOLVE_STARTUP_SCRIPT to: {script_path}" ) diff --git a/client/ayon_core/hosts/resolve/utility_scripts/ayon_startup.scriptlib b/client/ayon_core/hosts/resolve/utility_scripts/ayon_startup.scriptlib index aefd03aa8b..22253390a3 100644 --- a/client/ayon_core/hosts/resolve/utility_scripts/ayon_startup.scriptlib +++ b/client/ayon_core/hosts/resolve/utility_scripts/ayon_startup.scriptlib @@ -5,7 +5,7 @@ function file_exists(name) end -ayon_startup_script = os.getenv("OPENPYPE_RESOLVE_STARTUP_SCRIPT") +ayon_startup_script = os.getenv("AYON_RESOLVE_STARTUP_SCRIPT") if ayon_startup_script ~= nil then script = fusion:MapPath(ayon_startup_script) From 9275fa22a718a42922286d8401d51d447128926e Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:54:45 +0100 Subject: [PATCH 10/19] use AYON_ prefix for 3rd party bin --- client/ayon_core/lib/vendor_bin_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/lib/vendor_bin_utils.py b/client/ayon_core/lib/vendor_bin_utils.py index bac82134ac..41654476c2 100644 --- a/client/ayon_core/lib/vendor_bin_utils.py +++ b/client/ayon_core/lib/vendor_bin_utils.py @@ -306,7 +306,7 @@ def get_oiio_tools_path(tool="oiiotool"): CachedToolPaths.cache_executable_path(tool, tool_executable_path) return tool_executable_path - custom_paths_str = os.environ.get("OPENPYPE_OIIO_PATHS") or "" + custom_paths_str = os.environ.get("AYON_OIIO_PATHS") or "" tool_executable_path = find_tool_in_custom_paths( custom_paths_str.split(os.pathsep), tool, @@ -423,7 +423,7 @@ def get_ffmpeg_tool_path(tool="ffmpeg"): CachedToolPaths.cache_executable_path(tool, tool_executable_path) return tool_executable_path - custom_paths_str = os.environ.get("OPENPYPE_FFMPEG_PATHS") or "" + custom_paths_str = os.environ.get("AYON_FFMPEG_PATHS") or "" tool_executable_path = find_tool_in_custom_paths( custom_paths_str.split(os.pathsep), tool, From 2e206476ca47268358dfd0aeaebe5996659e256a Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:57:22 +0100 Subject: [PATCH 11/19] check for 'AYON_REMOTE_PUBLISH' --- client/ayon_core/pipeline/context_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_core/pipeline/context_tools.py b/client/ayon_core/pipeline/context_tools.py index 9773da2529..3f11aacab7 100644 --- a/client/ayon_core/pipeline/context_tools.py +++ b/client/ayon_core/pipeline/context_tools.py @@ -146,7 +146,7 @@ def modified_emit(obj, record): MessageHandler.emit = modified_emit - if os.environ.get("OPENPYPE_REMOTE_PUBLISH"): + if os.environ.get("AYON_REMOTE_PUBLISH"): # target "farm" == rendering on farm, expects OPENPYPE_PUBLISH_DATA # target "remote" == remote execution, installs host print("Registering pyblish target: remote") From 6a0e4b5f71ae2655b8e638897fbf4299580356ec Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:58:00 +0100 Subject: [PATCH 12/19] use AYON prefixes in pyblish_pype --- client/ayon_core/tools/pyblish_pype/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/tools/pyblish_pype/settings.py b/client/ayon_core/tools/pyblish_pype/settings.py index aaa35d0b56..5b69eb6a50 100644 --- a/client/ayon_core/tools/pyblish_pype/settings.py +++ b/client/ayon_core/tools/pyblish_pype/settings.py @@ -24,7 +24,7 @@ } # Allow animations in GUI -Animated = env_variable_to_bool("OPENPYPE_PYBLISH_ANIMATED", True) +Animated = env_variable_to_bool("AYON_PYBLISH_ANIMATED", True) # Print UI info message to console -PrintInfo = env_variable_to_bool("OPENPYPE_PYBLISH_PRINT_INFO", True) +PrintInfo = env_variable_to_bool("AYON_PYBLISH_PRINT_INFO", True) From 9a3f4c92b34d513c163baf88a47bf70a6bab227c Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:58:29 +0100 Subject: [PATCH 13/19] use 'AYON_TMPDIR' instead of 'OPENPYPE_TMPDIR' --- client/ayon_core/pipeline/publish/lib.py | 4 ++-- client/ayon_core/pipeline/tempdir.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/client/ayon_core/pipeline/publish/lib.py b/client/ayon_core/pipeline/publish/lib.py index c8a2ea8ca3..47f4be9e69 100644 --- a/client/ayon_core/pipeline/publish/lib.py +++ b/client/ayon_core/pipeline/publish/lib.py @@ -623,7 +623,7 @@ def get_instance_staging_dir(instance): First check if 'stagingDir' is already set in instance data. In case there already is new tempdir will not be created. - It also supports `OPENPYPE_TMPDIR`, so studio can define own temp + It also supports `AYON_TMPDIR`, so studio can define own temp shared repository per project or even per more granular context. Template formatting is supported also with optional keys. Folder is created in case it doesn't exists. @@ -649,7 +649,7 @@ def get_instance_staging_dir(instance): anatomy = instance.context.data.get("anatomy") - # get customized tempdir path from `OPENPYPE_TMPDIR` env var + # get customized tempdir path from `AYON_TMPDIR` env var custom_temp_dir = tempdir.create_custom_tempdir( anatomy.project_name, anatomy) diff --git a/client/ayon_core/pipeline/tempdir.py b/client/ayon_core/pipeline/tempdir.py index 8084af6350..29d4659393 100644 --- a/client/ayon_core/pipeline/tempdir.py +++ b/client/ayon_core/pipeline/tempdir.py @@ -23,9 +23,15 @@ def create_custom_tempdir(project_name, anatomy=None): Returns: str | None: formatted path or None """ - env_tmpdir = os.getenv("OPENPYPE_TMPDIR") + env_tmpdir = os.getenv("AYON_TMPDIR") if not env_tmpdir: - return + env_tmpdir = os.getenv("OPENPYPE_TMPDIR") + if not env_tmpdir: + return + print( + "DEPRECATION WARNING: Used 'OPENPYPE_TMPDIR' environment" + " variable. Please use 'AYON_TMPDIR' instead." + ) custom_tempdir = None if "{" in env_tmpdir: From ee018456c8f3e6e6f8278eba4b45a2c3f96ed37f Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:59:02 +0100 Subject: [PATCH 14/19] use 'AYON_FUSION_ROOT' over 'OPENPYPE_FUSION_ROOT' --- client/ayon_core/hosts/fusion/deploy/ayon/fusion_shared.prefs | 2 +- client/ayon_core/hosts/fusion/hooks/pre_fusion_setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/client/ayon_core/hosts/fusion/deploy/ayon/fusion_shared.prefs b/client/ayon_core/hosts/fusion/deploy/ayon/fusion_shared.prefs index 9c67af7db9..59b0f82bad 100644 --- a/client/ayon_core/hosts/fusion/deploy/ayon/fusion_shared.prefs +++ b/client/ayon_core/hosts/fusion/deploy/ayon/fusion_shared.prefs @@ -3,7 +3,7 @@ Locked = true, Global = { Paths = { Map = { - ["AYON:"] = "$(OPENPYPE_FUSION)/deploy/ayon", + ["AYON:"] = "$(AYON_FUSION_ROOT)/deploy/ayon", ["Config:"] = "UserPaths:Config;AYON:Config", ["Scripts:"] = "UserPaths:Scripts;Reactor:System/Scripts", }, diff --git a/client/ayon_core/hosts/fusion/hooks/pre_fusion_setup.py b/client/ayon_core/hosts/fusion/hooks/pre_fusion_setup.py index 4a6ffcbb25..7cfa9d0a26 100644 --- a/client/ayon_core/hosts/fusion/hooks/pre_fusion_setup.py +++ b/client/ayon_core/hosts/fusion/hooks/pre_fusion_setup.py @@ -67,5 +67,5 @@ def execute(self): # for hook installing PySide2 self.data["fusion_python3_home"] = py3_dir - self.log.info(f"Setting OPENPYPE_FUSION: {FUSION_HOST_DIR}") - self.launch_context.env["OPENPYPE_FUSION"] = FUSION_HOST_DIR + self.log.info(f"Setting AYON_FUSION_ROOT: {FUSION_HOST_DIR}") + self.launch_context.env["AYON_FUSION_ROOT"] = FUSION_HOST_DIR From d13498a4e8a279fe51bacb728f9573fdec2feada Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 16:59:22 +0100 Subject: [PATCH 15/19] use AYON prefix in fusion env variables --- client/ayon_core/hosts/fusion/api/pipeline.py | 2 +- client/ayon_core/hosts/fusion/api/pulse.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/fusion/api/pipeline.py b/client/ayon_core/hosts/fusion/api/pipeline.py index bbfb83a573..dc6e30159e 100644 --- a/client/ayon_core/hosts/fusion/api/pipeline.py +++ b/client/ayon_core/hosts/fusion/api/pipeline.py @@ -308,7 +308,7 @@ def run(self): # getattr of UIManager.GetEvent tries to resolve the Remote Function # through the PyRemoteObject get_event = app.UIManager.GetEvent - delay = int(os.environ.get("OPENPYPE_FUSION_CALLBACK_INTERVAL", 1000)) + delay = int(os.environ.get("AYON_FUSION_CALLBACK_INTERVAL", 1000)) while True: if self.isInterruptionRequested(): return diff --git a/client/ayon_core/hosts/fusion/api/pulse.py b/client/ayon_core/hosts/fusion/api/pulse.py index 762f05ba7e..7128b7e1ff 100644 --- a/client/ayon_core/hosts/fusion/api/pulse.py +++ b/client/ayon_core/hosts/fusion/api/pulse.py @@ -14,7 +14,7 @@ def run(self): app = getattr(sys.modules["__main__"], "app", None) # Interval in milliseconds - interval = os.environ.get("OPENPYPE_FUSION_PULSE_INTERVAL", 1000) + interval = os.environ.get("AYON_FUSION_PULSE_INTERVAL", 1000) while True: if self.isInterruptionRequested(): From 6fa881dcc6d92152d8a26a40734ff939daeeee3b Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 17:00:04 +0100 Subject: [PATCH 16/19] use AYON prefixes in FLAME env variables --- client/ayon_core/hosts/flame/api/scripts/wiretap_com.py | 2 +- client/ayon_core/hosts/flame/hooks/pre_flame_setup.py | 4 ++-- server_addon/applications/server/applications.json | 4 ++-- server_addon/applications/server/version.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/ayon_core/hosts/flame/api/scripts/wiretap_com.py b/client/ayon_core/hosts/flame/api/scripts/wiretap_com.py index a74172c405..cffc6ec782 100644 --- a/client/ayon_core/hosts/flame/api/scripts/wiretap_com.py +++ b/client/ayon_core/hosts/flame/api/scripts/wiretap_com.py @@ -44,7 +44,7 @@ def __init__(self, host_name=None, volume_name=None, group_name=None): self.group_name = group_name or "staff" # wiretap tools dir path - self.wiretap_tools_dir = os.getenv("OPENPYPE_WIRETAP_TOOLS") + self.wiretap_tools_dir = os.getenv("AYON_WIRETAP_TOOLS") # initialize WireTap client WireTapClientInit() diff --git a/client/ayon_core/hosts/flame/hooks/pre_flame_setup.py b/client/ayon_core/hosts/flame/hooks/pre_flame_setup.py index e958ccbcd3..391332d368 100644 --- a/client/ayon_core/hosts/flame/hooks/pre_flame_setup.py +++ b/client/ayon_core/hosts/flame/hooks/pre_flame_setup.py @@ -32,8 +32,8 @@ def __init__(self, *args, **kwargs): def execute(self): _env = self.launch_context.env - self.flame_python_exe = _env["OPENPYPE_FLAME_PYTHON_EXEC"] - self.flame_pythonpath = _env["OPENPYPE_FLAME_PYTHONPATH"] + self.flame_python_exe = _env["AYON_FLAME_PYTHON_EXEC"] + self.flame_pythonpath = _env["AYON_FLAME_PYTHONPATH"] """Hook entry method.""" project_doc = self.data["project_doc"] diff --git a/server_addon/applications/server/applications.json b/server_addon/applications/server/applications.json index 82dfd3b8d3..a2fbbac83f 100644 --- a/server_addon/applications/server/applications.json +++ b/server_addon/applications/server/applications.json @@ -185,7 +185,7 @@ "darwin": [], "linux": [] }, - "environment": "{\n \"OPENPYPE_FLAME_PYTHON_EXEC\": \"/opt/Autodesk/python/2021/bin/python2.7\",\n \"OPENPYPE_FLAME_PYTHONPATH\": \"/opt/Autodesk/flame_2021/python\",\n \"OPENPYPE_WIRETAP_TOOLS\": \"/opt/Autodesk/wiretap/tools/2021\"\n}", + "environment": "{\n \"AYON_FLAME_PYTHON_EXEC\": \"/opt/Autodesk/python/2021/bin/python2.7\",\n \"AYON_FLAME_PYTHONPATH\": \"/opt/Autodesk/flame_2021/python\",\n \"AYON_WIRETAP_TOOLS\": \"/opt/Autodesk/wiretap/tools/2021\"\n}", "use_python_2": true }, { @@ -205,7 +205,7 @@ "darwin": [], "linux": [] }, - "environment": "{\n \"OPENPYPE_FLAME_PYTHON_EXEC\": \"/opt/Autodesk/python/2021.1/bin/python2.7\",\n \"OPENPYPE_FLAME_PYTHONPATH\": \"/opt/Autodesk/flame_2021.1/python\",\n \"OPENPYPE_WIRETAP_TOOLS\": \"/opt/Autodesk/wiretap/tools/2021.1\"\n}", + "environment": "{\n \"AYON_FLAME_PYTHON_EXEC\": \"/opt/Autodesk/python/2021.1/bin/python2.7\",\n \"AYON_FLAME_PYTHONPATH\": \"/opt/Autodesk/flame_2021.1/python\",\n \"AYON_WIRETAP_TOOLS\": \"/opt/Autodesk/wiretap/tools/2021.1\"\n}", "use_python_2": true } ] diff --git a/server_addon/applications/server/version.py b/server_addon/applications/server/version.py index bbab0242f6..1276d0254f 100644 --- a/server_addon/applications/server/version.py +++ b/server_addon/applications/server/version.py @@ -1 +1 @@ -__version__ = "0.1.4" +__version__ = "0.1.5" From 90daf1ee95f154eb545460bdfc3396b900e5cb04 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 17:02:28 +0100 Subject: [PATCH 17/19] use AYON_USERNAME over OPENPYPE_USERNAME --- .../plugins/publish/submit_maya_remote_publish_deadline.py | 2 +- .../deadline/plugins/publish/submit_publish_cache_job.py | 4 ++-- .../modules/deadline/plugins/publish/submit_publish_job.py | 4 ++-- .../plugins/publish/create_publish_royalrender_job.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py index 2b497d0626..0bf7cf61fe 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_maya_remote_publish_deadline.py @@ -106,10 +106,10 @@ def get_job_info(self): environment["AVALON_ASSET"] = instance.context.data["asset"] environment["AVALON_TASK"] = instance.context.data["task"] environment["AVALON_APP_NAME"] = os.environ.get("AVALON_APP_NAME") - environment["OPENPYPE_USERNAME"] = instance.context.data["user"] environment["OPENPYPE_PUBLISH_SUBSET"] = instance.data["subset"] environment["OPENPYPE_REMOTE_PUBLISH"] = "1" environment["AYON_LOG_NO_COLORS"] = "1" + environment["AYON_USERNAME"] = instance.context.data["user"] environment["AYON_REMOTE_PUBLISH"] = "1" for key, value in environment.items(): diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py index 42f60f07a6..a90397baa2 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_cache_job.py @@ -69,7 +69,7 @@ class ProcessSubmittedCacheJobOnFarm(pyblish.api.InstancePlugin, "FTRACK_API_KEY", "FTRACK_SERVER", "AVALON_APP_NAME", - "OPENPYPE_USERNAME", + "AYON_USERNAME", "OPENPYPE_SG_USER", "KITSU_LOGIN", "KITSU_PWD" @@ -129,7 +129,7 @@ def _submit_deadline_post_job(self, instance, job): "AVALON_PROJECT": instance.context.data["projectName"], "AVALON_ASSET": instance.context.data["asset"], "AVALON_TASK": instance.context.data["task"], - "OPENPYPE_USERNAME": instance.context.data["user"], + "AYON_USERNAME": instance.context.data["user"], "AYON_LOG_NO_COLORS": "1", "IS_TEST": str(int(is_in_tests())), "AYON_PUBLISH_JOB": "1", diff --git a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py index cfbff118a5..bd343e103a 100644 --- a/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py +++ b/client/ayon_core/modules/deadline/plugins/publish/submit_publish_job.py @@ -111,7 +111,7 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin, "FTRACK_API_KEY", "FTRACK_SERVER", "AVALON_APP_NAME", - "OPENPYPE_USERNAME", + "AYON_USERNAME", "OPENPYPE_SG_USER", "KITSU_LOGIN", "KITSU_PWD" @@ -185,7 +185,7 @@ def _submit_deadline_post_job(self, instance, job, instances): "AVALON_PROJECT": instance.context.data["projectName"], "AVALON_ASSET": instance.context.data["asset"], "AVALON_TASK": instance.context.data["task"], - "OPENPYPE_USERNAME": instance.context.data["user"], + "AYON_USERNAME": instance.context.data["user"], "AYON_LOG_NO_COLORS": "1", "IS_TEST": str(int(is_in_tests())), "AYON_PUBLISH_JOB": "1", diff --git a/client/ayon_core/modules/royalrender/plugins/publish/create_publish_royalrender_job.py b/client/ayon_core/modules/royalrender/plugins/publish/create_publish_royalrender_job.py index 40c279d011..680795a329 100644 --- a/client/ayon_core/modules/royalrender/plugins/publish/create_publish_royalrender_job.py +++ b/client/ayon_core/modules/royalrender/plugins/publish/create_publish_royalrender_job.py @@ -67,7 +67,7 @@ class CreatePublishRoyalRenderJob(pyblish.api.InstancePlugin, "FTRACK_API_KEY", "FTRACK_SERVER", "AVALON_APP_NAME", - "OPENPYPE_USERNAME", + "AYON_USERNAME", "OPENPYPE_SG_USER", ] priority = 50 @@ -186,7 +186,7 @@ def get_job(self, instance, instances): "AVALON_PROJECT": anatomy_data["project"]["name"], "AVALON_ASSET": instance.context.data["asset"], "AVALON_TASK": anatomy_data["task"]["name"], - "OPENPYPE_USERNAME": anatomy_data["user"] + "AYON_USERNAME": anatomy_data["user"] }) # add environments from self.environ_keys From b506a9fb2c1f3b5f4bdcdb6c00d4319df7d4bc4a Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 17:09:07 +0100 Subject: [PATCH 18/19] use 'AYON_PUBLISH_DATA' over 'OPENPYPE_PUBLISH_DATA' --- client/ayon_core/cli_commands.py | 2 +- .../photoshop/plugins/publish/collect_batch_data.py | 9 ++++++--- .../plugins/publish/collect_color_coded_instances.py | 5 ++++- .../plugins/publish/collect_sequences_from_job.py | 12 ++++++++---- client/ayon_core/pipeline/context_tools.py | 2 +- .../plugins/publish/collect_rendered_files.py | 12 ++++++++---- 6 files changed, 28 insertions(+), 14 deletions(-) diff --git a/client/ayon_core/cli_commands.py b/client/ayon_core/cli_commands.py index cd21a6c4c6..a4816e04b2 100644 --- a/client/ayon_core/cli_commands.py +++ b/client/ayon_core/cli_commands.py @@ -108,7 +108,7 @@ def publish(paths, targets=None, gui=False): else: pyblish.api.register_target("farm") - os.environ["OPENPYPE_PUBLISH_DATA"] = os.pathsep.join(paths) + os.environ["AYON_PUBLISH_DATA"] = os.pathsep.join(paths) os.environ["HEADLESS_PUBLISH"] = 'true' # to use in app lib log.info("Running publish ...") diff --git a/client/ayon_core/hosts/photoshop/plugins/publish/collect_batch_data.py b/client/ayon_core/hosts/photoshop/plugins/publish/collect_batch_data.py index 1d51d90866..5e43a021c3 100644 --- a/client/ayon_core/hosts/photoshop/plugins/publish/collect_batch_data.py +++ b/client/ayon_core/hosts/photoshop/plugins/publish/collect_batch_data.py @@ -26,7 +26,7 @@ class CollectBatchData(pyblish.api.ContextPlugin): - """Collect batch data from json stored in 'OPENPYPE_PUBLISH_DATA' env dir. + """Collect batch data from json stored in 'AYON_PUBLISH_DATA' env dir. The directory must contain 'manifest.json' file where batch data should be stored. @@ -39,13 +39,16 @@ class CollectBatchData(pyblish.api.ContextPlugin): def process(self, context): self.log.info("CollectBatchData") - batch_dir = os.environ.get("OPENPYPE_PUBLISH_DATA") + batch_dir = ( + os.environ.get("AYON_PUBLISH_DATA") + or os.environ.get("OPENPYPE_PUBLISH_DATA") + ) if is_in_tests(): self.log.debug("Automatic testing, no batch data, skipping") return assert batch_dir, ( - "Missing `OPENPYPE_PUBLISH_DATA`") + "Missing `AYON_PUBLISH_DATA`") assert os.path.exists(batch_dir), \ "Folder {} doesn't exist".format(batch_dir) diff --git a/client/ayon_core/hosts/photoshop/plugins/publish/collect_color_coded_instances.py b/client/ayon_core/hosts/photoshop/plugins/publish/collect_color_coded_instances.py index 2d90b09bb1..e309da62ba 100644 --- a/client/ayon_core/hosts/photoshop/plugins/publish/collect_color_coded_instances.py +++ b/client/ayon_core/hosts/photoshop/plugins/publish/collect_color_coded_instances.py @@ -46,7 +46,10 @@ class CollectColorCodedInstances(pyblish.api.ContextPlugin): def process(self, context): self.log.info("CollectColorCodedInstances") - batch_dir = os.environ.get("OPENPYPE_PUBLISH_DATA") + batch_dir = ( + os.environ.get("AYON_PUBLISH_DATA") + or os.environ.get("OPENPYPE_PUBLISH_DATA") + ) if (is_in_tests() and (not batch_dir or not os.path.exists(batch_dir))): self.log.debug("Automatic testing, no batch data, skipping") diff --git a/client/ayon_core/modules/royalrender/plugins/publish/collect_sequences_from_job.py b/client/ayon_core/modules/royalrender/plugins/publish/collect_sequences_from_job.py index 8a076e7817..a253a1ec5b 100644 --- a/client/ayon_core/modules/royalrender/plugins/publish/collect_sequences_from_job.py +++ b/client/ayon_core/modules/royalrender/plugins/publish/collect_sequences_from_job.py @@ -70,7 +70,7 @@ def collect(root, class CollectSequencesFromJob(pyblish.api.ContextPlugin): """Gather file sequences from job directory. - When "OPENPYPE_PUBLISH_DATA" environment variable is set these paths + When "AYON_PUBLISH_DATA" environment variable is set these paths (folders or .json files) are parsed for image sequences. Otherwise, the current working directory is searched for file sequences. @@ -91,9 +91,13 @@ def process(self, context): ["review"] ) - if os.environ.get("OPENPYPE_PUBLISH_DATA"): - self.log.debug(os.environ.get("OPENPYPE_PUBLISH_DATA")) - paths = os.environ["OPENPYPE_PUBLISH_DATA"].split(os.pathsep) + publish_data_paths = ( + os.environ.get("AYON_PUBLISH_DATA") + or os.environ.get("OPENPYPE_PUBLISH_DATA") + ) + if publish_data_paths: + self.log.debug(publish_data_paths) + paths = publish_data_paths.split(os.pathsep) self.log.info("Collecting paths: {}".format(paths)) else: cwd = context.get("workspaceDir", os.getcwd()) diff --git a/client/ayon_core/pipeline/context_tools.py b/client/ayon_core/pipeline/context_tools.py index 3f11aacab7..197b1eb6e6 100644 --- a/client/ayon_core/pipeline/context_tools.py +++ b/client/ayon_core/pipeline/context_tools.py @@ -147,7 +147,7 @@ def modified_emit(obj, record): MessageHandler.emit = modified_emit if os.environ.get("AYON_REMOTE_PUBLISH"): - # target "farm" == rendering on farm, expects OPENPYPE_PUBLISH_DATA + # target "farm" == rendering on farm, expects AYON_PUBLISH_DATA # target "remote" == remote execution, installs host print("Registering pyblish target: remote") pyblish.api.register_target("remote") diff --git a/client/ayon_core/plugins/publish/collect_rendered_files.py b/client/ayon_core/plugins/publish/collect_rendered_files.py index fad0ca27a8..5ffcd669a0 100644 --- a/client/ayon_core/plugins/publish/collect_rendered_files.py +++ b/client/ayon_core/plugins/publish/collect_rendered_files.py @@ -19,7 +19,7 @@ class CollectRenderedFiles(pyblish.api.ContextPlugin): """ This collector will try to find json files in provided - `OPENPYPE_PUBLISH_DATA`. Those files _MUST_ share same context. + `AYON_PUBLISH_DATA`. Those files _MUST_ share same context. Note: We should split this collector and move the part which handle reading @@ -140,13 +140,17 @@ def _process_path(self, data, anatomy): def process(self, context): self._context = context - if not os.environ.get("OPENPYPE_PUBLISH_DATA"): - raise KnownPublishError("Missing `OPENPYPE_PUBLISH_DATA`") + publish_data_paths = ( + os.environ.get("AYON_PUBLISH_DATA") + or os.environ.get("OPENPYPE_PUBLISH_DATA") + ) + if publish_data_paths: + raise KnownPublishError("Missing `AYON_PUBLISH_DATA`") # QUESTION # Do we support (or want support) multiple files in the variable? # - what if they have different context? - paths = os.environ["OPENPYPE_PUBLISH_DATA"].split(os.pathsep) + paths = publish_data_paths.split(os.pathsep) # Using already collected Anatomy anatomy = context.data["anatomy"] From 3bb8b97eb7541c73331631eb10bc68ce37376c7a Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Wed, 7 Feb 2024 17:36:54 +0100 Subject: [PATCH 19/19] replace check for OPENPYPE_DEVELOP --- client/ayon_core/hosts/hiero/api/menu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/hosts/hiero/api/menu.py b/client/ayon_core/hosts/hiero/api/menu.py index 4e061edbf8..fb24629d5e 100644 --- a/client/ayon_core/hosts/hiero/api/menu.py +++ b/client/ayon_core/hosts/hiero/api/menu.py @@ -6,7 +6,7 @@ from qtpy import QtGui -from ayon_core.lib import Logger +from ayon_core.lib import Logger, is_dev_mode_enabled from ayon_core.tools.utils import host_tools from ayon_core.settings import get_project_settings from ayon_core.pipeline import ( @@ -125,7 +125,7 @@ def menu_install(): lambda: host_tools.show_library_loader(parent=main_window) ) - if os.getenv("OPENPYPE_DEVELOP"): + if is_dev_mode_enabled(): menu.addSeparator() reload_action = menu.addAction("Reload pipeline") reload_action.setIcon(QtGui.QIcon("icons:ColorAdd.png"))