An AI agent skill that turns any subject into a 3D film or app
Mirror the house and Minecraft skills from their source, with newer hydrant example; release 0.1.2
Nguyen Xuan Anc5094d412f23
diff --git a/plugins/build-house-from-plan/.claude-plugin/plugin.json b/plugins/build-house-from-plan/.claude-plugin/plugin.jsonindex ccd0756..6c9b446 100644--- a/plugins/build-house-from-plan/.claude-plugin/plugin.json+++ b/plugins/build-house-from-plan/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "build-house-from-plan",- "version": "0.1.1",+ "version": "0.1.2","description": "Turn a 2D house plan into a photoreal 3D house in Blender Cycles, checked by overlaying the build on the drawing, with stills, a build-up film and whole streets.","author": {"name": "CodePawl",diff --git a/plugins/build-house-from-plan/skills/build-house-from-plan/SKILL.md b/plugins/build-house-from-plan/skills/build-house-from-plan/SKILL.mdindex 1510cfd..0cb6ba9 100644--- a/plugins/build-house-from-plan/skills/build-house-from-plan/SKILL.md+++ b/plugins/build-house-from-plan/skills/build-house-from-plan/SKILL.md@@ -1,10 +1,12 @@---name: build-house-from-plan-description: Turn a 2D house plan into a photoreal 3D house in Blender Cycles, checked by overlaying the build on the drawing. Stills, a film of the walls rising off the drawing, and whole streets of houses. Use for a floor plan, a house plan or a blueprint that should become a real-looking 3D house or street.+description: Turn a 2D house plan into a photoreal 3D house in Blender Cycles, checked by overlaying the build on the drawing. Stills, a film of the walls rising off the drawing, and whole streets of houses. Use for a floor plan, a house plan or a blueprint that should become a real-looking 3D house or street, "từ house plan làm nhà 3D", "bản vẽ thành nhà 3D", "dựng nhà từ mặt bằng", "nhà 3D từ bản vẽ".license: MIT----# Build a photoreal 3D house from a 2D plan+# Build a photoreal 3D house from a 2D plan (Dựng nhà 3D siêu chân thật từ bản vẽ 2D)++If `references/local.md` exists, read it first: it sets the folders and house rules for this machine.A plan file is read off the drawing, checked against the drawing, built with real wall thickness and real frames, thendressed with scanned materials and models and rendered in Cycles. The drawing stays the judge: nothing ships unless thediff --git a/plugins/build-minecraft-model-from-image/.claude-plugin/plugin.json b/plugins/build-minecraft-model-from-image/.claude-plugin/plugin.jsonindex 1c45d23..eb360e7 100644--- a/plugins/build-minecraft-model-from-image/.claude-plugin/plugin.json+++ b/plugins/build-minecraft-model-from-image/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "build-minecraft-model-from-image",- "version": "0.1.1",+ "version": "0.1.2","description": "Turn a 2D picture of an object into a Minecraft-style 3D model: a few clean cuboids with pixel textures, written by the agent as code, with GLB export, a viewer, renders and checks.","author": {"name": "CodePawl",diff --git a/plugins/build-minecraft-model-from-image/skills/build-minecraft-model-from-image/SKILL.md b/plugins/build-minecraft-model-from-image/skills/build-minecraft-model-from-image/SKILL.mdindex 8d64c16..3512ed4 100644--- a/plugins/build-minecraft-model-from-image/skills/build-minecraft-model-from-image/SKILL.md+++ b/plugins/build-minecraft-model-from-image/skills/build-minecraft-model-from-image/SKILL.md@@ -1,10 +1,12 @@---name: build-minecraft-model-from-image-description: Turn a 2D picture of an object into a Minecraft-style 3D model, a few clean cuboids with pixel textures in the Blockbench look, never fine jagged voxels. Exports GLB, a viewer and renders. Use for "make this photo a Minecraft model", "block model from an image", "turn this object into blocks", "voxel from a picture".+description: Turn a 2D picture of an object into a Minecraft-style 3D model, a few clean cuboids with pixel textures in the Blockbench look, never fine jagged voxels. Exports GLB, a viewer and renders. Use for "make this photo a Minecraft model", "block model from an image", "turn this object into blocks", "voxel from a picture", "từ ảnh làm khối 3D minecraft", "voxel từ ảnh", "biến ảnh đồ vật thành block", "làm model minecraft".license: MIT----# Build a Minecraft-style model from a picture+# Build a Minecraft-style model from a picture (Dựng model kiểu Minecraft từ ảnh đồ vật)++If `references/local.md` exists, read it first: it sets the folders and house rules for this machine.The agent looks at the picture and writes the model by hand as code. There is no image-to-3D model, no heightmap and no extrusion.@@ -21,7 +23,7 @@ A fine voxel grid looks jagged and ugly. The target is how Minecraft itself is m## Steps-Scripts are in `{{SKILL_DIR}}/scripts`. Put each job in its own folder under `{{WORK_DIR}}`, with the picture as `source.jpg`. The scripts declare their Python dependencies inline, so `uv run` installs them. Blender 5.x does the renders. Set `BLENDER_PATH` if it is not on your PATH.+`{{SKILL_DIR}}` is this skill's folder and `{{WORK_DIR}}` the folder where projects live. Scripts are in `{{SKILL_DIR}}/scripts`. Put each job in its own folder under `{{WORK_DIR}}`, with the picture as `source.jpg`. The scripts declare their Python dependencies inline, so `uv run` installs them. Blender 5.x does the renders. Set `BLENDER_PATH` if it is not on your PATH.1. **Look at the whole picture at full size before any tool.** Name each real part, and what is only shadow, reflection or background. Blueprints blur this: on the test run a port's shadow was read as a "dark neck", and a collared shirt as a white bib.2. **Read it:** `uv run --no-project {{SKILL_DIR}}/scripts/read_image.py source.jpg --blocks 24 --box x0,y0,x1,y1 --out read`. Add `--clear-background 18` on a plain background so holes open up (handles, slats). This writes `mask.png`, `blueprint.png` (block coordinates with a ruler), `palette.png` and `rows.json`. Pick `--blocks` so the thinnest part that must show gets 1 to 2 units.diff --git a/plugins/build-minecraft-model-from-image/skills/build-minecraft-model-from-image/examples/hydrant.py b/plugins/build-minecraft-model-from-image/skills/build-minecraft-model-from-image/examples/hydrant.pyindex 101cfc7..08f2d99 100644--- a/plugins/build-minecraft-model-from-image/skills/build-minecraft-model-from-image/examples/hydrant.py+++ b/plugins/build-minecraft-model-from-image/skills/build-minecraft-model-from-image/examples/hydrant.py@@ -1,22 +1,27 @@-"""French fire hydrant painted pink, nearly front-on, in a garden. 30 units tall, about 15 wide (the photo is about half as wide as tall).-Visible: grey base with a raised front rib, pink column, front port, two side ports aimed out and forward, dark red recess with-a square nut in every port, flat grey cap, operating nut on top.+"""French fire hydrant painted pink, nearly front-on, in a garden. 34 units tall, about 16 wide at the ports (the photo is about+half as wide as tall).+Visible: grey base with a raised front rib, pink column, a front port, two side ports aimed out and forward, a flat grey cap+with an operating nut on top, a steel square nut in the middle of every port cap.Inferred: the column is turned, so the back repeats it with the rib; the side ports sit opposite each other; the back has no port.A dark band under the front port is that port's shadow in the photo, not a part.A blind reader took the first version for a pig: side ports read as ears and the front port as a snout. What made it a hydrant:level ports with a flanged collar, a bolted steel flange between base and column, and a real operating nut on top.-Second pass (reel fix): ports pulled in close to a tall 9 wide column (stems 3 long, collar 7 wide), base and cap mid grey like the photo."""+Reel fix (third pass): the column is taller so pink shows between the flange and the ports; every port is a round nozzle:+a short stem, a grey flange ring, then a pink cap with a shallow, pink-red recess (not dark red) that a bright steel nut fills;+the side ports are level (no pitch), set well out from the column on a visible stem, so they read as nozzles, not ears."""SOURCE = {"image": "source.jpg", "mask": "read/mask.png", "yaw": 0, "pitch": 4}BOLT = "#5d6265"+PORT_YAW = 40def build(kit):materials = {- "pink": kit.Material(["#f9a9b1", "#f29aa3", "#e98791"], noise=0.15, roughness=0.5),- "recess": kit.Material(["#c02c32", "#a32226", "#861c1e"], noise=0.15, rim=False, roughness=0.55),+ "pink": kit.Material(["#f08a92", "#e97d86", "#dc6d77"], noise=0.15, roughness=0.5),+ "recess": kit.Material(["#d4606c", "#c85763", "#b94c58"], noise=0.15, rim=False, roughness=0.55),"grey": kit.Material(["#aeb2b4", "#9ea3a5", "#8d9295"], noise=0.15, roughness=0.5, metallic=0.1),"cap": kit.Material(["#b9bdbf", "#a0a5a7", "#868b8e"], style="metal", noise=0.2, roughness=0.4, metallic=0.3),+ "steel": kit.Material(["#e6e9ea", "#cfd3d5", "#b4b9bb"], style="metal", noise=0.12, roughness=0.3, metallic=0.5),"rust": kit.Material(["#7a4a3a", "#5e3a30"], noise=0.3, rim=False),}model = kit.BlockModel(materials, seed=9)@@ -35,25 +40,29 @@ def build(kit):for face in ("front", "back", "left", "right"):part.paint(face, ["o.o.o.o.o"[:part.face_size(face)[0]]], {"o": BOLT}, at=(0, 0))- # Pink column, tall and straight.- model.round(center_x, center_z, 12, 14, 9, "pink", corner=2, name="column")+ # Pink column, tall and straight: 17 units, so it shows between the flange and the ports.+ model.round(center_x, center_z, 12, 17, 9, "pink", corner=2, name="column")# Cap, and the operating nut every hydrant has on top.- model.round(center_x, center_z, 26, 1, 9, "cap", corner=2, name="cap")- model.round(center_x, center_z, 27, 1, 7, "cap", corner=2, name="cap top")- model.box((7, 28, 7), (3, 2, 3), "cap", name="operating nut")+ model.round(center_x, center_z, 29, 1, 9, "cap", corner=2, name="cap")+ model.round(center_x, center_z, 30, 1, 7, "cap", corner=2, name="cap top")+ model.box((7, 31, 7), (3, 3, 3), "steel", name="operating nut")- # Front port: a short stem, then a flanged collar with a real dent and a square nut.- model.disc(center_x, 16.5, 10, 4, 5, "pink", corner=1, name="front port stem")- model.disc(center_x, 16.5, 14, 3, 7, "pink", corner=2, recess=2, core="recess", name="front port collar")- model.box((7.5, 15.5, 15), (2, 2, 1), "cap", name="front nut")+ # Front port: stem, grey flange ring, pink round cap with a shallow recess and a steel nut that fills it.+ port_y = 19.5+ model.disc(center_x, port_y, 10, 4, 7, "pink", corner=2, name="front port stem")+ model.disc(center_x, port_y, 14, 1, 9, "grey", corner=2, name="front port ring")+ model.disc(center_x, port_y, 15, 2, 7, "pink", corner=2, recess=1, core="recess", name="front port cap")+ model.box((7, port_y - 1.5, 16), (3, 3, 1), "steel", name="front nut")- # Side ports: short barrels close to the column, level with each other, aimed out and forward.+ # Side ports: level (no pitch), aimed out and forward, on a visible stem well out from the column.+ side_y = 25.5for side in (-1, 1):- rotation = (-4, side * 35, 0)- pivot = (center_x, 21.5, center_z)- model.disc(center_x, 21.5, center_z + 2, 3, 5, "pink", corner=1, rotation=rotation, pivot=pivot, name="side port stem")- model.disc(center_x, 21.5, center_z + 5, 3, 7, "pink", corner=2, recess=2, core="recess", rotation=rotation, pivot=pivot,- name="side port collar")- model.box((center_x - 1, 20.5, center_z + 6), (2, 2, 1), "cap", rotation=rotation, pivot=pivot, name="side nut")+ rotation = (0, side * PORT_YAW, 0)+ pivot = (center_x, side_y, center_z)+ model.disc(center_x, side_y, center_z + 2, 4, 5, "pink", corner=1, rotation=rotation, pivot=pivot, name="side port stem")+ model.disc(center_x, side_y, center_z + 6, 1, 9, "grey", corner=2, rotation=rotation, pivot=pivot, name="side port ring")+ model.disc(center_x, side_y, center_z + 7, 2, 7, "pink", corner=2, recess=1, core="recess", rotation=rotation, pivot=pivot,+ name="side port cap")+ model.box((center_x - 1.5, side_y - 1.5, center_z + 8), (3, 3, 1), "steel", rotation=rotation, pivot=pivot, name="side nut")return model