From 09643edc655512a8ab2541d96cb01e53b03d0460 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Thu, 16 Jan 2025 01:27:43 +0200 Subject: [PATCH] get staging dir: pass cached project_settings --- client/ayon_houdini/api/lib.py | 6 ++++-- client/ayon_houdini/api/plugin.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/ayon_houdini/api/lib.py b/client/ayon_houdini/api/lib.py index b6d46da7c3..c7d43ee22e 100644 --- a/client/ayon_houdini/api/lib.py +++ b/client/ayon_houdini/api/lib.py @@ -1629,7 +1629,7 @@ def format_as_collections(files: list[str], pattern: str = "{head}{padding}{tail return result -def get_custom_staging_dir(product_type, product_name, context=None) -> "Optional[str]": +def get_custom_staging_dir(product_type, product_name, context=None, project_settings=None) -> "Optional[str]": """Get Custom Staging Directory Retrieve a custom staging directory for the specified product type and name @@ -1647,6 +1647,7 @@ def get_custom_staging_dir(product_type, product_name, context=None) -> "Optiona product_name (str): The name of the product. context (Optional[dict[str, Union[str, None]]]): A dictionary with AYON context. it expects keys: `project_name`, `folder_path` and `task_name` + project_settings(Dict[str, Any]): Prepared project settings. Returns: Optional[str]: The computed staging directory path. @@ -1672,7 +1673,8 @@ def get_custom_staging_dir(product_type, product_name, context=None) -> "Optiona product_type, product_name, host_name, - always_return_path=False + always_return_path=False, + project_settings=project_settings ) staging_dir_path = None diff --git a/client/ayon_houdini/api/plugin.py b/client/ayon_houdini/api/plugin.py index cabf47a9eb..db5c91de6e 100644 --- a/client/ayon_houdini/api/plugin.py +++ b/client/ayon_houdini/api/plugin.py @@ -354,7 +354,7 @@ def get_staging_dir(self, product_type, product_name, instance_data=None): } staging_dir = get_custom_staging_dir( - product_type, product_name, context + product_type, product_name, context, self.project_settings ) or self.staging_dir return staging_dir.replace("\\", "/").rstrip("/")