fix: stream Blender frame output to frontend for cinematic renders

The filter only matched [cinematic_render] tag but Blender outputs its
own "Saved: frame_NNNN.png" lines per frame. Now also matches "Saved:"
lines, extracts the frame number, and formats as:
  [cinematic_render] Frame 84/480 rendered

This shows live frame progress in the LiveRenderLog on the frontend.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-15 21:42:36 +01:00
parent caffe7809c
commit e0714854d2
+10 -2
View File
@@ -674,10 +674,18 @@ def render_cinematic_to_file(
line = line.rstrip("\n")
if key.data == "stdout":
logger.info("[cinematic] %s", line)
if "[cinematic_render]" in line:
if "[cinematic_render]" in line or "Saved:" in line:
log_lines.append(line)
if log_callback:
log_callback(line)
# For Blender "Saved:" lines, format as frame progress
if "Saved:" in line and "frame_" in line:
import re as _re
m = _re.search(r'frame_(\d+)', line)
if m:
fnum = int(m.group(1))
log_callback(f"[cinematic_render] Frame {fnum}/480 rendered")
else:
log_callback(line)
else:
stderr_lines.append(line)
logger.warning("[cinematic stderr] %s", line)