Animate Lego CAD models in Blender by inferring their mechanisms

An HN poster has Claude agents read annotated LDraw Lego files, work out which parts form mechanisms, plan the motion and write Blender scripts that rig and animate them, with a crane and a Fabuland plane as results.

Done withClaude· Nov 6, 2026

What they did

antelocnova, who earlier released a toolset for agents that write LDraw Lego models, built a follow-up called LDraw Mecha after commenters asked whether the models could move. The agent gets a Lego model's .mpd source with extra annotations, splits it into submodels, picks out the ones that are mechanisms, reasons about how they move from the part descriptions, and writes a motion plan. It then converts the model to a glTF file whose nodes carry the same annotations, loads it into Blender, and writes Python that builds the rigs and runs the animation, ending with a .blend file. The author had an agent derive the geometry toolset from the earlier project and refined it by feeding it simple models first, then harder ones.

How it went

The author says the pipeline works, though not perfectly. Claude Sonnet 5.5 animated the pneumatic crane of the 42043 Arocs flatbed truck after the whole truck proved too large and complex, and the author took its suggestion to do the crane alone. Sonnet also produced take-off, flight and landing for the 3625 Fabuland plane, kept in place on request. Opus 5.5 built a catalog of ten minifigs with three moves each as a reference for other agents. Earlier tests found mechanism inference consistent across different models, including Haiku 5.5. No time or cost figures are given.

Worth knowing

It depends on hand-annotated source files; plain LDraw files are not the input. The harness running the models is not named, though the author mentions trying Blender MCP before building the annotation approach. The setup is tested on macOS only, with Linux and WSL marked untested. The HN thread had no comments at fetch time.

Try it

With Claude· 3 parts to fill in

Here is the source of a Lego model in LDraw format: [path to .mpd file]. First split it into named submodels and list which ones are mechanisms (hinges, cranes, wheels, pistons), with one line on how each should move. Write a motion plan with joint types, axes, ranges and frame timings for [the mechanism I want animated]. Then import the model into [Blender] as glTF, create the rigs and write a Python script that animates the plan. If the model is too complex, suggest a smaller part to animate instead. Show me the plan and wait for my approval before writing any Blender code.

Square brackets are the parts to fill in. The prompt is ours; the story is theirs.

Where they said it

Related