# headless-blender-render

Render a Blender scene (or a generated test scene) headless from the command line: frames to PNG with Cycles (CPU/GPU) or Eevee, resolution and sample count as flags.

- **Space:** 3d-blender-animation-public (https://github.com/Tech-Realm/space-3d-blender-animation-public/tree/main/headless-blender-render)
- **Level:** L1 (as the registry reports it)
- **Keys it needs (names only):** VAST_API_KEY
- **Tools:** blender
- **Routes:** local-blender, homelab-gpu, vast-gpu; checks: 2
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use 3d-blender-animation-public/headless-blender-render` or MCP `get_pack 3d-blender-animation-public/headless-blender-render`
- **Files:** CHANGELOG.md, code/render.sh, code/render_scene.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/results.json, pack.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

Render a Blender scene (or a generated test scene) headless from the command line: frames to PNG with Cycles (CPU/GPU) or Eevee, resolution and sample count as flags.

## Goal

Turn a .blend file (or nothing: a test scene is built) into rendered PNG frames without opening the Blender UI, so an agent can render on a Mac, a homelab box or a rented GPU.

## Steps

1. Check Blender: `blender --version` (5.x LTS on the Mac via Homebrew).
2. Render: `bash code/render.sh --blend scene.blend --out out --frames 1-24 --res 1920x1080 --engine CYCLES --samples 64` (omit --blend for the built-in test scene).
3. On a GPU box add `--device GPU` (Cycles picks CUDA/OptiX/Metal if available, else stays on CPU).
4. Encode frames if needed: `ffmpeg -framerate 24 -i out/frame_%04d.png -c:v libx264 -pix_fmt yuv420p out.mp4`.
5. Look at real frames (not just exit codes) before calling it done.

## Edge cases

- Eevee needs a GPU/OpenGL context; on headless Linux without a GPU use Cycles CPU.
- Engine id differs across versions (BLENDER_EEVEE vs BLENDER_EEVEE_NEXT); render_scene.py tries both.
- Relative texture paths break when the .blend moves; run `File > External Data > Make Paths Relative` or pack resources first.
- GPU-less VMs cannot run GPU compositors at all (seen with DaVinci Resolve seats); Blender Cycles CPU still works there.

## Don'ts

- Don't judge a render by the exit code alone; open a frame.
- Don't render long sequences on a shared box without a frame range and a time budget.
- Don't commit rendered frames or .blend1 backups to a space (link big media from the host instead).



---

Canonical URL: https://logicpacks.io/packs/3d-blender-animation-public/headless-blender-render

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
