From b8269f7b3106eefecf7ec30967d7f8bb4260816e Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Sun, 15 Dec 2024 11:44:57 +0100 Subject: [PATCH 1/2] Always increment workfile when requested - instead of only when no unsaved changes --- client/ayon_core/pipeline/context_tools.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/client/ayon_core/pipeline/context_tools.py b/client/ayon_core/pipeline/context_tools.py index 44c9e5d673..b9ae906ab4 100644 --- a/client/ayon_core/pipeline/context_tools.py +++ b/client/ayon_core/pipeline/context_tools.py @@ -585,9 +585,6 @@ def version_up_current_workfile(): """Function to increment and save workfile """ host = registered_host() - if not host.has_unsaved_changes(): - print("No unsaved changes, skipping file save..") - return project_name = get_current_project_name() folder_path = get_current_folder_path() From 037db5dbd31ab615f80600d5926bb2ec901f0bf5 Mon Sep 17 00:00:00 2001 From: Roy Nieterau Date: Fri, 20 Dec 2024 12:23:43 +0100 Subject: [PATCH 2/2] Store in instance data whether the staging dir set is a custom one --- client/ayon_core/pipeline/publish/lib.py | 1 + client/ayon_core/pipeline/staging_dir.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/ayon_core/pipeline/publish/lib.py b/client/ayon_core/pipeline/publish/lib.py index ecdcc0f0c1..586b90a3fd 100644 --- a/client/ayon_core/pipeline/publish/lib.py +++ b/client/ayon_core/pipeline/publish/lib.py @@ -717,6 +717,7 @@ def get_instance_staging_dir(instance): instance.data.update({ "stagingDir": staging_dir_path, "stagingDir_persistent": staging_dir_info.persistent, + "stagingDir_custom": staging_dir_info.custom }) return staging_dir_path diff --git a/client/ayon_core/pipeline/staging_dir.py b/client/ayon_core/pipeline/staging_dir.py index ea22d99389..83878f17a2 100644 --- a/client/ayon_core/pipeline/staging_dir.py +++ b/client/ayon_core/pipeline/staging_dir.py @@ -12,6 +12,7 @@ from .tempdir import get_temp_dir class StagingDir: directory: str persistent: bool + custom: bool # Whether the staging dir is a custom staging dir def get_staging_dir_config( @@ -204,7 +205,8 @@ def get_staging_dir_info( dir_template = staging_dir_config["template"]["directory"] return StagingDir( dir_template.format_strict(ctx_data), - staging_dir_config["persistence"], + persistent=staging_dir_config["persistence"], + custom=True ) # no config found but force an output @@ -216,7 +218,8 @@ def get_staging_dir_info( prefix=prefix, suffix=suffix, ), - False, + persistent=False, + custom=False ) return None