fix: resolve NameError masking cinematic render errors and fix frame count

- `render_cinematic_to_file` referenced undefined `stdout`/`stderr` in the
  Blender error path; replaced with `log_lines`/`stderr_lines` so the real
  Blender error is actually stored in render_log instead of a Python NameError
- Progress callback hardcoded 480 frames; now uses the `frame_count` variable
- Updated docstring to reflect actual 250 frames @ 25fps (not 480 @ 24fps)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-21 19:09:28 +02:00
co-authored by Claude Sonnet 4.6
parent 715cef7971
commit 84f40647b0
+7 -5
View File
@@ -768,9 +768,9 @@ def render_cinematic_to_file(
template_inputs: dict | None = None, template_inputs: dict | None = None,
log_callback: "Callable[[str], None] | None" = None, log_callback: "Callable[[str], None] | None" = None,
) -> dict: ) -> dict:
"""Render a cinematic highlight animation: STEP -> GLB/USD -> 480 frames @ 24fps (Blender) -> mp4 (ffmpeg). """Render a cinematic highlight animation: STEP -> GLB/USD -> 250 frames @ 25fps (Blender) -> mp4 (ffmpeg).
Fixed at 24fps, 480 frames (20 seconds). Uses cinematic_render.py which Fixed at 25fps, 250 frames (10 seconds). Uses cinematic_render.py which
creates a procedural 4-segment camera animation with varying focal lengths, creates a procedural 4-segment camera animation with varying focal lengths,
elevations, and bezier-eased transitions. elevations, and bezier-eased transitions.
@@ -931,7 +931,7 @@ def render_cinematic_to_file(
m = _re.search(r'frame_(\d+)', line) m = _re.search(r'frame_(\d+)', line)
if m: if m:
fnum = int(m.group(1)) fnum = int(m.group(1))
log_callback(f"[cinematic_render] Frame {fnum}/480 rendered") log_callback(f"[cinematic_render] Frame {fnum}/{frame_count} rendered")
else: else:
log_callback(line) log_callback(line)
else: else:
@@ -943,10 +943,12 @@ def render_cinematic_to_file(
proc.wait() proc.wait()
if proc.returncode != 0: if proc.returncode != 0:
stdout_tail = "\n".join(log_lines[-50:]) if log_lines else ""
stderr_tail = "\n".join(stderr_lines[-20:]) if stderr_lines else ""
raise RuntimeError( raise RuntimeError(
f"cinematic_render.py exited with code {proc.returncode}.\n" f"cinematic_render.py exited with code {proc.returncode}.\n"
f"stdout: {(stdout or '')[-2000:]}\n" f"stdout: {stdout_tail[-2000:]}\n"
f"stderr: {(stderr or '')[-500:]}" f"stderr: {stderr_tail[-500:]}"
) )
render_duration_s = round(time.monotonic() - t_render, 2) render_duration_s = round(time.monotonic() - t_render, 2)