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:
@@ -372,6 +372,8 @@ def render_turntable_to_file(
|
|||||||
|
|
||||||
# 2. Render frames with Blender
|
# 2. Render frames with Blender
|
||||||
frames_dir = output_path.parent / f"_frames_{output_path.stem}"
|
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)
|
frames_dir.mkdir(parents=True, exist_ok=True)
|
||||||
output_path.parent.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
|
# 2. Render frames with Blender
|
||||||
frames_dir = output_path.parent / f"_frames_{output_path.stem}"
|
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)
|
frames_dir.mkdir(parents=True, exist_ok=True)
|
||||||
output_path.parent.mkdir(parents=True, exist_ok=True)
|
output_path.parent.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user