From 8b814ff4cd8b71d52890d6cda056d6f8a8fce141 Mon Sep 17 00:00:00 2001 From: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com> Date: Tue, 17 Oct 2023 15:33:43 +0100 Subject: [PATCH] Fixed issue with screenshot folder not created before render --- main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index ae9fafd..74f687d 100644 --- a/main.py +++ b/main.py @@ -12,6 +12,7 @@ from subprocess import run +SCREENSHOTS_PATH = "./Screenshots" def automate_function( automate_context: AutomationContext @@ -30,6 +31,7 @@ def automate_function( } Path("./automate_data.json").write_text(json.dumps(data)) + Path(SCREENSHOTS_PATH).mkdir(exist_ok=True) print("Starting blender") @@ -50,7 +52,7 @@ def automate_function( if (returncode := process.returncode) != 0: automate_context.mark_run_failed(f"The blender process exited with error code {returncode}\n{process.stdout}") else: - files = list(Path("./Screenshots").glob("**/*.png")) + files = list(Path(SCREENSHOTS_PATH).glob("**/*.png")) for file_path in files: automate_context.store_file_result(file_path)