summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-03-22 08:39:27 +0100
committerskal <pascal.massimino@gmail.com>2026-03-22 08:39:27 +0100
commit48098b3dd89da7e21a09b9c507bc2cefd22f4055 (patch)
tree56942b176622eb8ef3d70bdfa5d47c3697a828b8
parent62fb3ffa615aaf51e727f734c7e7fd25a36226e5 (diff)
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.
-rw-r--r--cnn_v3/training/blender_export.py6
1 files changed, 5 insertions, 1 deletions
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)