Skip to content

"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/

Python

fix(blender): correct EEVEE engine name and force absolute render paths

loriscience8cd857ce291b
diff --git a/blender/agent-harness/cli_anything/blender/core/render.py b/blender/agent-harness/cli_anything/blender/core/render.py
index ece32c54f..cb908a273 100644
--- a/blender/agent-harness/cli_anything/blender/core/render.py
+++ b/blender/agent-harness/cli_anything/blender/core/render.py
@@ -212,7 +212,10 @@ def render_scene(
os.makedirs(script_dir, exist_ok=True)
script_path = os.path.join(script_dir, "_render_script.py")
- script_content = generate_bpy_script(project, output_path, frame=frame, animation=animation)
+ # Ensure output_path is absolute before passing it to the script generator
+ # as Blender's background process may have a different CWD.
+ abs_output_path = os.path.abspath(output_path)
+ script_content = generate_bpy_script(project, abs_output_path, frame=frame, animation=animation)
with open(script_path, "w") as f:
f.write(script_content)
diff --git a/blender/agent-harness/cli_anything/blender/utils/bpy_gen.py b/blender/agent-harness/cli_anything/blender/utils/bpy_gen.py
index 1f91f45db..a3b3ec43a 100644
--- a/blender/agent-harness/cli_anything/blender/utils/bpy_gen.py
+++ b/blender/agent-harness/cli_anything/blender/utils/bpy_gen.py
@@ -521,7 +521,7 @@ def _engine_to_bpy(engine: str) -> str:
"""Convert engine name to bpy enum value."""
mapping = {
"CYCLES": "CYCLES",
- "EEVEE": "BLENDER_EEVEE_NEXT",
+ "EEVEE": "BLENDER_EEVEE",
"WORKBENCH": "BLENDER_WORKBENCH",
}
return mapping.get(engine, "CYCLES")