fix: clean frames directory before cinematic/turntable re-render

Old frame PNGs from previous render attempts persisted in the frames
directory, causing FFmpeg to stitch the wrong number of frames.
Now rmtree's the directory before creating it fresh.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 22:02:20 +01:00
parent 458c6cd813
commit c159bff2df
+4
View File
@@ -372,6 +372,8 @@ def render_turntable_to_file(
# 2. Render frames with Blender
frames_dir = output_path.parent / f"_frames_{output_path.stem}"
if frames_dir.exists():
_shutil.rmtree(frames_dir, ignore_errors=True)
frames_dir.mkdir(parents=True, exist_ok=True)
output_path.parent.mkdir(parents=True, exist_ok=True)
@@ -600,6 +602,8 @@ def render_cinematic_to_file(
# 2. Render frames with Blender
frames_dir = output_path.parent / f"_frames_{output_path.stem}"
if frames_dir.exists():
_shutil.rmtree(frames_dir, ignore_errors=True)
frames_dir.mkdir(parents=True, exist_ok=True)
output_path.parent.mkdir(parents=True, exist_ok=True)