From 6a4b7f0cb44eb8a22a9bde6bc8db5cf56f5251ab Mon Sep 17 00:00:00 2001 From: Cyprien CAILLOT Date: Wed, 11 Sep 2024 16:24:23 +0200 Subject: [PATCH] Bug: Fix Tv Paint get_current_workfile when no scene is opened --- openpype/hosts/tvpaint/api/pipeline.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/openpype/hosts/tvpaint/api/pipeline.py b/openpype/hosts/tvpaint/api/pipeline.py index c125da15331..deb32fcc684 100644 --- a/openpype/hosts/tvpaint/api/pipeline.py +++ b/openpype/hosts/tvpaint/api/pipeline.py @@ -160,7 +160,15 @@ def work_root(self, session): return session["AVALON_WORKDIR"] def get_current_workfile(self): - return execute_george("tv_GetProjectName") + # tvPaint return a '\' character when no scene is currently + # opened instead of a None value, which causes interferences + # in OpenPype's core code. + # So we check the returned value and send None if this + # character is retrieved. + current_workfile = execute_george("tv_GetProjectName") + if current_workfile == '\\': + current_workfile = None + return current_workfile def workfile_has_unsaved_changes(self): return None