From 65d7404d428229e8573169040cb5fec4b5f4e522 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Sat, 15 Feb 2025 01:03:34 +0200 Subject: [PATCH] add a note about `get_last_workfile` --- client/ayon_core/pipeline/context_tools.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/ayon_core/pipeline/context_tools.py b/client/ayon_core/pipeline/context_tools.py index a809261fa2..beb62755f5 100644 --- a/client/ayon_core/pipeline/context_tools.py +++ b/client/ayon_core/pipeline/context_tools.py @@ -617,6 +617,9 @@ def version_up_current_workfile(): last_workfile_path = get_last_workfile( work_root, file_template, data, extensions, True ) + # `get_last_workfile` will return the first expected file version + # if no files exist yet. In that case, if they do not exist we will + # want to save v001 new_workfile_path = last_workfile_path if os.path.exists(new_workfile_path): new_workfile_path = version_up(new_workfile_path)