diff --git a/openpype/hooks/pre_add_last_workfile_arg.py b/openpype/hooks/pre_add_last_workfile_arg.py index 048545a150..653f97b3dd 100644 --- a/openpype/hooks/pre_add_last_workfile_arg.py +++ b/openpype/hooks/pre_add_last_workfile_arg.py @@ -25,7 +25,7 @@ class AddLastWorkfileToLaunchArgs(PreLaunchHook): ] def execute(self): - if not self.data.get("start_last_workfile", True): + if not self.data.get("start_last_workfile"): self.log.info("It is set to not start last workfile on start.") return diff --git a/openpype/hooks/pre_global_host_data.py b/openpype/hooks/pre_global_host_data.py index 3f56c47a42..bae967e25f 100644 --- a/openpype/hooks/pre_global_host_data.py +++ b/openpype/hooks/pre_global_host_data.py @@ -43,7 +43,7 @@ class GlobalHostDataHook(PreLaunchHook): "env": self.launch_context.env, - "start_last_workfile": self.data.get("start_last_workfile", True), + "start_last_workfile": self.data.get("start_last_workfile"), "last_workfile_path": self.data.get("last_workfile_path"), "log": self.log diff --git a/openpype/hooks/pre_non_python_host_launch.py b/openpype/hooks/pre_non_python_host_launch.py index 5bbc0a4834..dd193616e6 100644 --- a/openpype/hooks/pre_non_python_host_launch.py +++ b/openpype/hooks/pre_non_python_host_launch.py @@ -41,7 +41,7 @@ class NonPythonHostHook(PreLaunchHook): # Add workfile path if exists workfile_path = self.data["last_workfile_path"] if ( - self.data.get("start_last_workfile", True) + self.data.get("start_last_workfile") and workfile_path and os.path.exists(workfile_path)): new_launch_args.append(workfile_path) diff --git a/openpype/lib/applications.py b/openpype/lib/applications.py index 930b433ac0..a704c3ae68 100644 --- a/openpype/lib/applications.py +++ b/openpype/lib/applications.py @@ -1505,8 +1505,8 @@ def _prepare_last_workfile(data, workdir): task_name = data["task_name"] task_type = data["task_type"] - start_last_workfile = data.get("start_last_workfile", True) - if start_last_workfile: + start_last_workfile = data.get("start_last_workfile") + if start_last_workfile is None: start_last_workfile = should_start_last_workfile( project_name, app.host_name, task_name, task_type )