In this article
Claude Code writes a Python script, runs it with blender -b -P, renders in Cycles and checks the PNGs. Our 3D loop came from a 2,217-line script with no model loaded, rendered at 810 × 1440 and 32 samples in 3 h 32. Use Blender 4.5 LTS, render in resumable chunks, and look at every test frame.
Claude Code can drive Blender without ever opening its interface: it writes a Python script, runs it with blender -b -P script.py, renders in Cycles and looks at the PNGs it produced. Our 3D loop "HOW?" is built that way from start to finish, from a 2,217-line script that loads no model and no .blend file, rendered overnight in 3 h 32.
This article shows how we do it in the studio, with the real commands, render times and the pitfalls that only show up once you render for real. It covers films 94 and 107, which are in our catalogue with their code, and four other Cycles jobs from our project files.
Blender without the interface
Everything starts with one command line. This is the wrapper that ran every Cycles pass of film 107:
${BLENDER:-/Applications/Blender.app/Contents/MacOS/Blender} -b --factory-startup -t 10 \
-P …/studio/out/en/107/loop107.py "$@"-bruns Blender in the background, with no window.--factory-startupskips the user'sstartup.blend, so no preference or add-on on the machine changes the result.-t 10caps Cycles at 10 render threads on our 16-thread Intel i9, which leaves room for everything else.-Pruns the Python script. Anything after--is passed through untouched and read in Python withsys.argv: that is how one script takes--pass,--res,--samplesand--frames.
We run Blender 4.5 LTS (4.5.11 on our machine, as printed in the render log). Blender's release notes say 4.5 LTS is maintained until July 2027 and is the last release with an official Intel macOS build, which matters to us because our render Mac is an Intel one. Our prompts require 4.5 and not 5.x: the 107 script uses the compositor API scene.node_tree and Principled BSDF input names such as Coat Weight and Transmission Weight.
The loop Claude works in is simple. It writes or edits the script, renders a few frames at low resolution, opens the PNGs, compares them with the brief, fixes, and only then launches the long render. Without that look, a 3D scene is guesswork: a light at the wrong height or a camera that clips through the desk does not show up in any error message.
Film 107: a 3D loop from 2,217 lines of Python
The script loop107.py builds the whole scene in code: the beige computer, the CRT, the keyboard, the architect lamp, every material as nodes, every animation as keyframes. The meshes are made with bmesh. When we counted, the built scene had 381 objects, including 123 glass shards (16 stay in the frame, 107 fly) and a camera with 809 keys.
Rendering the full 1080 × 1920 at 64 samples was estimated at 17 hours. That was refused. We rendered at 0.75 scale (810 × 1440) and 32 samples, with an overscan margin and a barrel distortion applied afterwards in numpy, then upscaled with Lanczos. The night ran from 22:26 to 01:58. The log shows a median of 62 seconds per frame. Here is the core of the night script (its one log message translated from French):
zsh run.sh -- --pass portal --frames 0 --res 0.75 --samples 64 --thresh 0.02 || { touch night.fail; exit 1; }
R="--pass beauty --res 0.75 --samples 32 --thresh 0.02 --out hq"
for attempt in 1 2 3; do
for a in $(seq 124 20 144) $(seq 0 20 120) $(seq 164 20 184); do
b=$((a + 19)); (( a == 120 )) && b=123; (( a == 184 )) && b=198
zsh run.sh -- ${=R} --frames $a-$b || echo "$(date) failed $a-$b"
done
(( $(ls hq/beauty | wc -l) >= 199 )) && break
doneTwo details carry most of the weight. The render goes in chunks of 20 frames, and frames already on disk are skipped, so a crash at 01:00 costs one chunk, not the night. And the first pass renders a "portal": frame 0's set without the objects, under the same light. At the end of the film the camera flies into the O of "HOW?", and through the hole you see that portal. When the O fills the frame, you are back at frame 0.

The pixels then go through FFmpeg only: Lanczos to 1080 × 1920, a 16-bit deband, fine grain, H.264 CRF 16, BT.709 tags. No Remotion layer on top: the screen texture the CRT displays was made in Remotion beforehand and loaded into Blender as an image sequence.
Proof that the script is the film
Before selling the prompt for film 107, we gave an agent only the prompt and the pack, in the position of a buyer, and asked it to rebuild the film in low quality. It took 14 min 42 s. The camera came out identical to ours, key for key. Its 27 key frames, compared with the film at 360 × 640, show a mean absolute difference with a median of 1.99 levels out of 255: the noise of 14 samples instead of 32, at a third of the resolution.

Film 94: a real phone, a real profile, real light
Film 94, "200 followers", opens on an iPhone spinning in the dark, its Instagram profile bursting into 3D slabs. The phone is not a downloaded asset. It comes from a 688-line parametric script, dimensions in millimetres, first written for a launch film. The film mixes three Cycles shots (phone, an icon-cube and steel bars) with 3D kinetic type coded in Remotion.
The profile on the screen is the interesting part. Remotion renders it once as a 2640 × 5736 image (six times the screen size), and Blender uses that image as light. From the prompt of film 94:
- **Screen** = the `base` atlas as **emission** (gain 1.3) under a specular varnish (roughness 0.035, IOR 1.5, specular 0.08), set 0.004 mm above the glass. The UVs follow the position in mm (1 pt of the atlas = 1 pt of the profile).Because the UI is inside the 3D scene, it gets real depth of field, real motion blur and real reflections. The exploded view works the same way: each element of the profile becomes an extruded slab, 0.5 to 1.2 mm thick, whose top face carries a second atlas.


The bridge also runs the other way. During the cube shot, the Blender script writes the camera's model-view and projection matrices for every frame to cube_track.json. Remotion reads that file to place a word in orbit exactly around the real cube.
Two choices kept the cost down. The film is delivered at 30 fps from a 60 fps master, so Blender renders even master frames only: 130 phone, 64 cube and 25 bars frames. And the kinetic type stays in Remotion, where it renders in minutes. The blind test of film 94 ran the preview path (540 × 960, 20 samples): 18 min 42 s of Cycles, 74 s of Remotion, and not one command needed fixing.
The prompt behind this filmUgoki · 200 followers12,331 words, ready for ClaudeSee the prompt
Texture or homography: two ways to put a UI on a 3D screen
Film 94 puts the interface in the 3D as a texture. Our TikTok concept (film 16) does the opposite, and both are right for different shots.
In film 16, Blender renders the phone with a black screen and exports, for every frame, where the screen sits. Remotion draws the interface flat in HTML, then warps it onto the four corners with a CSS matrix3d homography, so the text stays as sharp as a screenshot at any size. To put the UI under the glass rather than on top of it, the screen render is laid back over it in screen mode at about 40 %. Full strength washes the UI out.
The phone plays for 607 frames in that film. Blender rendered only 213; Remotion rebuilt the other 394 by warping the two neighbouring renders onto the interpolated screen position and blending them. The script decides which frames to render: as soon as the warp error would exceed 1.2 pixels, it renders a real one.
Our rule: texture when the camera goes close and you want real blur and reflections on the UI (film 94, with a 6× atlas so it stays sharp); homography when the UI must stay razor-sharp and the GPU budget is tight (film 16).
Light, shadow, water: what Cycles gives you that 2D cannot
A real shadow
Our tutorial on shadows lifts headphones off a table, once without a shadow and once with the shadow Cycles computes. The shadow shrinks, softens and fades as the object rises, because it is physics, not a drop-shadow filter.


A car under water, built in layers
For an underwater sports-car concept, we built the look as separate layers and filmed each step: empty scene, water volume, sun through the surface, an animated caustic gobo, god rays, then particles.

Three Cycles lessons from that job. An object invisible to all ray types is ignored entirely, shadows included, so the caustic gobo keeps diffuse and glossy visibility and only hides from the camera. Particles that are not baked get simulated during the render and some frames come out at the wrong instant, which showed as ±5 px jumps: always run bpy.ops.ptcache.bake_all(bake=True) before rendering. And Blender 4.5's Metal backend did not see the Radeon GPU in our Intel Mac, so our renders run on the CPU. One overnight job used Blender 4.2 LTS, which still sees that GPU, and we re-graded its EXR files in 4.5.
Seven pitfalls from our Blender scripts
- Euler flips. Rotation keys written frame by frame in Euler angles flipped by 180° and turned the motion blur into a swirl. Write quaternions with sign continuity, or use
to_euler("XYZ", prev). - Stale camera matrix. Calling
world_to_camera_viewbeforeview_layer.update()projected points to x ≈ 3,000 to 11,000. Update first, then project. - Relative paths. A script copied into another folder computed its project root from its own location and wrote renders in the wrong place. Use absolute paths, or a root passed as an argument.
- Images built in Python. Set
colorspace_settings.namebeforepixels.foreach_set; setting it after wipes the buffer. - numpy yes, scipy no. Blender's embedded Python ships numpy, not scipy. Our procedural textures are numpy only.
- Slotted actions in 4.5.
action.fcurvesdoes not return the camera's lens and depth-of-field curves; read them throughbpy_extras.anim_utils.action_get_channelbag_for_slot. - One heavy render at a time. Our shared lock allows one Blender (at
-t 10) and one Remotion render together, and Blender work goes in chunks of 45 minutes at most so it never blocks the queue.
Where to start
The quickest way in is a film whose code is in the pack. The prompt of film 107 (17,366 words) ships the full loop107.py; film 94 (12,331 words) ships our production code, Blender and Remotion, without the song, which is a third-party track. Open an empty folder, launch Claude Code, paste the prompt and let it build. For the homography approach, start from film 16. Plans are on the pricing page, and the bonus lesson "The 3D that doesn't say its name" in Ugoki Academy explains when 3D is worth it and when it is not.



