Skip to content

Commit

Permalink
Fixed issue with screenshot folder not created before render
Browse files Browse the repository at this point in the history
  • Loading branch information
JR-Morgan committed Oct 17, 2023
1 parent db42fed commit 8b814ff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

from subprocess import run

SCREENSHOTS_PATH = "./Screenshots"

def automate_function(
automate_context: AutomationContext
Expand All @@ -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")

Expand All @@ -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)

Expand Down

0 comments on commit 8b814ff

Please sign in to comment.