diff --git a/client/ayon_usd/hooks/usd_pinning_root.py b/client/ayon_usd/hooks/usd_pinning_root.py index 8f0a0eb..4346091 100644 --- a/client/ayon_usd/hooks/usd_pinning_root.py +++ b/client/ayon_usd/hooks/usd_pinning_root.py @@ -13,16 +13,16 @@ class UsdPinningRoot(PreLaunchHook): def execute(self) -> None: """Set environments necessary for pinning.""" - if not self.launch_context.env.get("PINNING_FILE_PATH"): + if not self.launch_context.env.get("AYON_USD_RESOLVER_PINNING_FILE"): return anatomy = self.data["anatomy"] - self.launch_context.env["PINNING_FILE_PATH"] = anatomy.fill_root( - self.launch_context.env.get("PINNING_FILE_PATH"), + self.launch_context.env["AYON_USD_RESOLVER_PINNING_FILE"] = anatomy.fill_root( + self.launch_context.env.get("AYON_USD_RESOLVER_PINNING_FILE"), ) roots = anatomy.roots self.launch_context.env[ - "PROJECT_ROOTS" + "AYON_USD_RESOLVER_PINNING_ROOTS" ] = ",".join(f"{key}={value}" for key, value in roots.items()) diff --git a/client/ayon_usd/plugins/publish/extract_skeleton_pinning_json.py b/client/ayon_usd/plugins/publish/extract_skeleton_pinning_json.py index 80f3cdc..24ff5a6 100644 --- a/client/ayon_usd/plugins/publish/extract_skeleton_pinning_json.py +++ b/client/ayon_usd/plugins/publish/extract_skeleton_pinning_json.py @@ -60,12 +60,12 @@ def process(self, instance: pyblish.api.Instance) -> None: os.path.dirname(usd_file_path), pin_file_name ) - project_roots = ayon_api.get_project_roots_by_site_id( + AYON_USD_RESOLVER_PINNING_ROOTS = ayon_api.get_project_roots_by_site_id( instance.context.data["projectName"] ) generate_pinning_file( usd_file_path, - project_roots, + AYON_USD_RESOLVER_PINNING_ROOTS, pin_file_path ) @@ -77,8 +77,8 @@ def process(self, instance: pyblish.api.Instance) -> None: FARM_JOB_ENV_DATA_KEY, {} ) farm_job_data.update({ - "PINNING_FILE_PATH": pin_file_path, - "ENABLE_STATIC_GLOBAL_CACHE": "1", + "AYON_USD_RESOLVER_PINNING_FILE": pin_file_path, + "AYON_USD_RESOLVER_ENABLE_PINNING": "1", }) def get_usd_file_path(self, instance): diff --git a/client/ayon_usd/standalone/usd/pinning/_pinning_file_generation_funcs.py b/client/ayon_usd/standalone/usd/pinning/_pinning_file_generation_funcs.py index 1827181..08c821a 100644 --- a/client/ayon_usd/standalone/usd/pinning/_pinning_file_generation_funcs.py +++ b/client/ayon_usd/standalone/usd/pinning/_pinning_file_generation_funcs.py @@ -301,7 +301,7 @@ def _write_pinning_file( def generate_pinning_file( - entry_usd: str, root_info: Dict[str, str], pinning_file_path: str + entry_usd: str, root_info: Dict[str, str], AYON_USD_RESOLVER_PINNING_FILE: str ): """Generate a AYON USD Resolver pinning file. @@ -315,13 +315,13 @@ def generate_pinning_file( root_info: The project roots for the site the pinning should resolve to. These can be obtained via e.g. the AYON REST API get `/api/projects/{project_name}/siteRoots". - pinning_file_path: The destination path to write the pinning file to. + AYON_USD_RESOLVER_PINNING_FILE: The destination path to write the pinning file to. """ - if not pinning_file_path.endswith(".json"): + if not AYON_USD_RESOLVER_PINNING_FILE.endswith(".json"): raise RuntimeError( - f"Pinning file path is not a json file {pinning_file_path}") + f"Pinning file path is not a json file {AYON_USD_RESOLVER_PINNING_FILE}") # Assume that the environment sets up the correct default AyonUsdResolver resolver = Ar.GetResolver() @@ -344,6 +344,6 @@ def generate_pinning_file( ) _write_pinning_file( - pinning_file_path, + AYON_USD_RESOLVER_PINNING_FILE, rootless_pinning_data, ) diff --git a/client/ayon_usd/utils.py b/client/ayon_usd/utils.py index c629a8e..0cce3cb 100644 --- a/client/ayon_usd/utils.py +++ b/client/ayon_usd/utils.py @@ -210,9 +210,9 @@ def _append(_env: dict, key: str, path: str): resolver_settings = settings["usd"]["ayon_usd_resolver"] return { "TF_DEBUG": settings["usd"]["usd"]["usd_tf_debug"], - "AYONLOGGERLOGLVL": resolver_settings["ayon_log_lvl"], - "AYONLOGGERSFILELOGGING": resolver_settings["ayon_file_logger_enabled"], # noqa - "AYONLOGGERSFILEPOS": resolver_settings["file_logger_file_path"], + "AYON_USD_RESOLVER_LOG_LVL": resolver_settings["ayon_log_lvl"], + "AYON_USD_RESOLVER_LOG_FILE_ENABLED": resolver_settings["ayon_file_logger_enabled"], # noqa + "AYON_USD_RESOLVER_LOG_FILE": resolver_settings["file_logger_file_path"], "AYON_LOGGIN_LOGGIN_KEYS": resolver_settings["ayon_logger_logging_keys"], # noqa "PXR_PLUGINPATH_NAME": pxr_pluginpath_name, "PYTHONPATH": python_path, diff --git a/docs/Ayon_Docs/Dev_Docs.md b/docs/Ayon_Docs/Dev_Docs.md index a2064c4..f01cbb5 100644 --- a/docs/Ayon_Docs/Dev_Docs.md +++ b/docs/Ayon_Docs/Dev_Docs.md @@ -29,7 +29,7 @@ creates a pinning file JSON from a given USD stage ```py def generate_pinning_file( - entry_usd: str, root_info: Dict[str, str], pinning_file_path: str + entry_usd: str, root_info: Dict[str, str], AYON_USD_RESOLVER_PINNING_FILE: str ): ```