Skip to content

Commit

Permalink
get staging dir: pass cached project_settings
Browse files Browse the repository at this point in the history
  • Loading branch information
MustafaJafar committed Jan 15, 2025
1 parent c6c0003 commit 09643ed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions client/ayon_houdini/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion client/ayon_houdini/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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("/")
Expand Down

0 comments on commit 09643ed

Please sign in to comment.