Claude Code + Blender: real 3D renders from a prompt

Claude Code Blender in practice: how we render real Cycles 3D from Python scripts, with our commands, render times, the 3D loop and the phone reel.

The film · Ugoki
In this article
  1. Blender without the interface
  2. Film 107: a 3D loop from 2,217 lines of Python
  3. Film 94: a real phone, a real profile, real light
  4. Texture or homography: two ways to put a UI on a 3D screen
  5. Light, shadow, water: what Cycles gives you that 2D cannot
  6. Seven pitfalls from our Blender scripts
  7. Where to start
In short

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.

Film 107 "HOW?": a retro computer types by itself, the screen explodes and the camera flies into the O, which lands back on frame 0. 199 frames, all Blender Cycles.See the prompt →

Blender without the interface

Everything starts with one command line. This is the wrapper that ran every Cycles pass of film 107:

bash
${BLENDER:-/Applications/Blender.app/Contents/MacOS/Blender} -b --factory-startup -t 10 \
  -P …/studio/out/en/107/loop107.py "$@"
  • -b runs Blender in the background, with no window.
  • --factory-startup skips the user's startup.blend, so no preference or add-on on the machine changes the result.
  • -t 10 caps Cycles at 10 render threads on our 16-thread Intel i9, which leaves room for everything else.
  • -P runs the Python script. Anything after -- is passed through untouched and read in Python with sys.argv: that is how one script takes --pass, --res, --samples and --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.

2,217lines of Python, no model loaded
199frames at 24 fps (8.29 s)
32Cycles samples per frame
3 h 32for the overnight render

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):

bash
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
done

Two 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.

Film 107 frame 150: the beige retro computer with its CRT screen exploding into glass shards and red 3D letters HOW? flying in front
Frame 150: 123 shards, red 3D letters, depth of field. All Cycles.
Frames 118 to 198, then 0 to 39: find the cut.

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.

Side-by-side strip of 14 pairs of frames from film 107: the blind test render on the left of each pair, the delivered film on the right, nearly identical
Blind test of film 107: in each pair, the tester's frame on the left, ours on the right.

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:

PROMPT.en.md · 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.

Raw Cycles plate of film 94 at master frame 90: the iPhone with its Instagram profile in exploded 3D slabs, on a flat grey background
The raw Cycles plate (master frame 90), on grey.
The same moment in the delivered film 94: the iPhone and its exploded profile over a dark red glow
The same moment in the delivered film (frame 45 at 30 fps).

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.

219Cycles frames rendered (even frames only)
48samples
7,173 sfor the 130 phone frames
3 min 52for the Remotion layer

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.

Cream headphones seen from above on a light background with no shadow: the object looks pasted on
No shadow: the object floats nowhere.
The same headphones lifted 6.5 cm with a soft grey Cycles shadow spreading under them
Lifted 6.5 cm, with its real Cycles shadow.

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.

Contact sheet of 12 frames showing an underwater car scene built step by step: grey viewport, water volume, sunlight, caustics, light shafts and bubbles
One frame every 12 of our 144-frame build clip (540 × 960, Cycles 32 samples): volume, sun, caustics, rays, bubbles.

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_view before view_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.name before pixels.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.fcurves does not return the camera's lens and depth-of-field curves; read them through bpy_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.

Film 94 "200 followers": three Cycles shots and 3D kinetic type, delivered at 30 fps, 468 frames.See the prompt →

FAQ

Can Claude use Blender?

Yes, through Python. Claude Code writes a bpy script and runs it with Blender in background mode (blender -b --factory-startup -P script.py). Our films 107 and 94 were made this way.

Which Blender version should I use with Claude?

We use Blender 4.5 LTS (4.5.11). Blender's release notes say 4.5 LTS is maintained until July 2027. Our scripts are not written for 5.x, because some API and node input names differ.

How long does a Cycles render take?

On our Intel i9 CPU: about 62 s per frame for the 3D loop at 810 × 1440 and 32 samples (199 frames in 3 h 32), and 7,173 s for the 130 phone frames of film 94 at 48 samples.

Can Claude see what it renders in Blender?

Yes, if you make it look. In our workflow Claude renders test frames at low resolution, opens the PNG files and compares them with the brief before launching the long render.

Do I need a GPU to render Blender with Claude?

No. Our renders run on the CPU because Blender 4.5's Metal backend did not see the Radeon GPU in our Intel Mac. A GPU is faster when Blender supports it.
Studio UgokiThe studio that makes every film with Claude.

Make yours, in one prompt.

Pick one of our films, paste its prompt into Claude: same rhythm, same sound, your brand.

Keep reading