From 48098b3dd89da7e21a09b9c507bc2cefd22f4055 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 22 Mar 2026 08:39:27 +0100 Subject: fix(cnn_v3): blender_export.py Blender 5 File Output node slots + file_name - Prefer file_output_items over file_slots; use explicit is-None checks so empty collections do not fall through to the legacy attribute. - Clear out_node.file_name so multilayer EXR frames are named 0001.exr instead of file_name0001.exr. handoff(Gemini): blender_export.py now produces frames/0001.exr on Blender 5.0.1. --- cnn_v3/training/blender_export.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cnn_v3') diff --git a/cnn_v3/training/blender_export.py b/cnn_v3/training/blender_export.py index bb0d3d9..345f395 100644 --- a/cnn_v3/training/blender_export.py +++ b/cnn_v3/training/blender_export.py @@ -161,9 +161,13 @@ def configure_compositor(args): out_node.format.file_format = "OPEN_EXR_MULTILAYER" out_node.format.exr_codec = "ZIP" _set_output_path(out_node, args.output) + if hasattr(out_node, "file_name"): + out_node.file_name = "" # Blender 5: clear prefix so output is just ####.exr # The node starts with one default slot; rename it first, then add the rest. - slots = getattr(out_node, "file_slots", None) or getattr(out_node, "file_output_items", None) + slots = getattr(out_node, "file_output_items", None) + if slots is None: + slots = getattr(out_node, "file_slots", None) if slots is None: candidates = [a for a in dir(out_node) if not a.startswith("__")] _die("cannot find slots attribute on CompositorNodeOutputFile.", candidates) -- cgit v1.2.3