CommunityImagegithub.com

blender-product-render

Studio-quality product renders and product animations in Blender (Cycles) for electronics — PCB shading (solder mask, copper/ENIG, silkscreen, solder fillets, FR4), enclosure shading (injection-moulded VDI textures, FDM prints, anodised/brushed metal, translucent light pipes), studio lighting rigs, product cameras and animation (turntable, orbit, push-in, exploded view, float, light sweep). Use whenever the user wants to render, light, shade, stage, photograph or animate a product, PCB, board, case, enclosure or device in Blender — including fixing an imported OBJ/STEP/KiCad/Altium/Fusion model (wrong scale, messy object names, black z-fighting lines, missing solder), even if they only say "make this look real", "studio shot", "product shot" or "hero image", or hand over a reference picture to match.

What is blender-product-render?

blender-product-render is a Claude Code agent skill that studio-quality product renders and product animations in Blender (Cycles) for electronics — PCB shading (solder mask, copper/ENIG, silkscreen, solder fillets, FR4), enclosure shading (injection-moulded VDI textures, FDM prints, anodised/brushed metal, translucent light pipes), studio lighting rigs, product cameras and animation (turntable, orbit, push-in, exploded view, float, light sweep). Use whenever the user wants to render, light, shade, stage, photograph or animate a product, PCB, board, case, enclosure or device in Blender — including fixing an imported OBJ/STEP/KiCad/Altium/Fusion model (wrong scale, messy object names, black z-fighting lines, missing solder), even if they only say "make this look real", "studio shot", "product shot" or "hero image", or hand over a reference picture to match.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/alexbatista/blender-product-render/tree/HEAD

Installed? Explore more Image skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Blender product render

Turn a CAD/EDA export into a studio product image or film that looks photographed, using tested bpy modules in scripts/ driven through the Blender MCP (or any Python access to Blender). The default look is Alex's reference style (see references/visual-language.md): bright seamless studio, monochrome/tone-on-tone backdrops, large soft sources, long lenses, macro detail crops, floating and exploded compositions.

Execution model — read first

Where the scripts run. All modules are plain bpy and import each other, so put the scripts/ folder on sys.path inside Blender and call functions:

import sys, importlib; sys.path.insert(0, r"<scripts dir on the Blender machine>")
import bpr_inspect; importlib.reload(bpr_inspect); result = bpr_inspect.run()
  • Alex's workstation (redribbon): the full skill folder is installed at C:\Users\alex_\OneDrive\Renders\BLENDER\Referencias para Skill\blender-product-render\ — put its scripts subfolder on sys.path from execute_blender_code; read the reference docs there (stage them in Cowork, or Read them directly in Claude Code). If this copy of SKILL.md is the only file you have, that folder is where everything else lives.
  • The canonical, always-current copy is the GitHub repo https://github.com/alexbatista/blender-product-render (the folder above is its clone). If the scripts bundled with this skill lack a module this file mentions (e.g. bpr_mesh, bpr_normals, bpr_reference, bpr_zfight, bpr_parts, bpr_scene), use the workstation folder or the repo.
  • Skill folder on the same machine as Blender (Claude Code locally): use the skill's own path.
  • Skill in a cloud session, Blender on the user's computer (Cowork): zip scripts/ and assets/, send it with SendUserFile, write it to a folder on the device with device_commit_files, extract it there with zipfile from execute_blender_code, then use that folder (the material library installs from its assets/). Do this once per session and again after you edit a script. Never extract over a folder someone else may be editing: compare first, write only the files you changed.
  • No Blender reachable (or for evals): pip install bpy==<user's version> in a venv and run the same modules headless (CPU only, keep previews small).

Protect the user's session. Inspect first (read-only). Before the first destructive step (normalise/classify/join) check bpy.data.is_dirty/filepath: if the work is unsaved, ask to save or work on a copy. For long jobs (renders, joins of thousands of objects) use the background pattern: bpr_render.background() saves a copy and renders with bpy.app.binary_path --background in a separate process, so the MCP call returns at once and the UI never freezes. Poll with bpr_render.job_status(). The same subprocess trick works for any test you want to run on a copy.

Previews are not finals. bpr_camera.create() keeps the current resolution %, so set a low percentage for look-dev and raise it only for finals. Micro textures (VDI grain, FDM layers) only resolve at full resolution in macro shots — judge them there, not in small previews.

MCP limits. One call ≈ 45 s max. Return small JSON (result = {...}); every bpr function already returns a compact report. Read images by rendering to a file in a connected folder, staging it, and viewing it — do look at your previews, numbers don't show glare or z-fighting.

Pipeline

Work stage by stage; after each visual stage render a small preview and check it against the checklist at the end. Ask the user only what the scene can't tell you (marked ASK).

#StageCallDetails
0Inspectbpr_inspect.run() + bpr_library.status()source exporter guess, units, thin axis, layer heights, materials; material library installed and up to date (ensure_installed() if not)
1Import (if needed)bpr_import.import_file(path, split="loose")OBJ/FBX/GLB/STL/STEP/pcb3d; splits merged CAD bodies
2Normalisebpr_normalize.run(kind="pcb"|"product", front="-Y")metres, Z-up, grounded, origins centred, PRODUCT_ROOT
2bMesh checkbpr_mesh.analyze(target)read-only: slivers, unwelded seams, degenerate/loose geometry, non-manifold, ngons + a per-object smoothing plan; tell the user what was found; references/mesh.md
2cMesh repairbpr_mesh.repair(target)weld 1 µm seams, remove degenerate faces and loose bits
2dFix normalsbpr_normals.fix_normals(target) (dry run: report_normals())after repair; PCBs: after bpr_pcb.classify(). Ray-parity orientation on a welded copy (works on unwelded Altium/STEP bodies), plates by side tag; built-in audit (audit_normals(), 6-direction ray grid) re-runs bad objects — report audit.share (expect < 0.5 %)
2eSurface smoothingbpr_mesh.smooth(target, plan=…) → fix_shading(r["audit"]["failing"]) → shading_diagnostic(path)modifier stack per object (all BPR_*); CAD-triangulated meshes are dissolved (0.5°) before any Bevel and every Bevel is extent-guarded; then measure, don't assume: shading_audit finds flat faces bent by interpolated normals (> 8°) and exploding modifiers, fix_shading escalates only the failing objects (Weighted Normal → sharp borders → dissolve → Bevel; never Remesh); look at the MatCap diagnostic of anything still failing
3Identify frontbpr_camera.orientation_sheet(path) → look → bpr_camera.set_front("+Y")ASK if ambiguous
4aPCBbpr_pcb.classify() → bpr_mesh.repair() → bpr_normals.fix_normals() → 4a′ → bpr_mesh.smooth() → assign_materials() → fix_layer_stack() → add_solder() → organize() → 4c → 4dadd_solder() makes smooth mounds with a Subdivision modifier (look at one joint in a macro preview); references/pcb.md
4a′Merged partsbpr_parts.find_merged() → preview(obj, path) per candidate → split_metal(obj, hint=…, finish=…) / split_all(exclude=[…])connectors exported as one mesh/one colour (pins, SMD feet, hold-down tabs, shells fused into the housing): split by shape into <name>_METAL (contacts, finish) and <name>_TABS (stamped sheet: hold-down tabs, side brackets, tin); run after repair + normals; the halves are re-audited for normals after the split; look at the red/grey previews from both sides (preview(..., view=…): pins usually exit on one side), use the user's context ("H2 é pin header", "contatos estanhados") for hint/finish, ASK when a part is ambiguous; references/pcb.md
4bEnclosurebpr_import.name_parts() → 4b′ → separate_coplanar() → bpr_materials.assign_from_source_names(objs, process=…) → 4c → 4dreferences/materials.md; ASK moulded vs printed, colours/finishes; show the part-name table and rename what the heuristics got wrong
4b′Inlaysbpr_inlay.find_inlays() → fix_inlays() → inlay_report()glyph bodies (logo, text) seated in a host pocket — multi-colour prints, INLAY_* parts: after repair/normals, before any coplanar fix; seats every glyph front 10 µm in front of the host face, grows it over the pocket's chords, rebuilds its walls, strips its bevel and keeps the host's bevel off the pocket rims; tagged glyphs are skipped by separate_coplanar/bpr_zfight; report inlay_report()["ok"] and look at a macro render; references/pcb.md (Inlays)
4cCoplanar validationloop r = bpr_zfight.resolve() until r["clean"] or not r["more"], then bpr_zfight.scan()mandatory after any layer/coplanar fix: exact scan for visible overlaps that remain (silk corners, shared outline edges, pad vs pour, sub-bodies) + automatic stagger/shrink + targeted pass; report the final scan; survivors → check_camera(at_mm) + macro preview + manual fix; references/pcb.md
4dShade Smooth passbpr_mesh.ensure_smooth()mandatory after 4c and again after any later geometry edit (split_metal, re-add_solder, imported parts): every mesh body gets smooth shading with sharp edges by angle (40°), Subdivision cages fully smooth, CAD parts a BPR_WeightedNormal, then the same audit + fix loop as 2e (report smoothed and shading.failing_after); skips STUDIO_*/CAM_* and objects tagged bpr_keep_flat; references/mesh.md
5Camerabpr_camera.create("hero_34", aspect="4:5", projection="perspective")main scene's shot; perspective is the default (it is what real cameras do); ASK/offer projection="orthographic" for technical, spec-sheet or exploded-diagram output ("iso" shot = true isometric); references/camera.md
6Studiobpr_studio.build("soft_highkey")after the camera (lights are placed camera-relative; size-aware glare guard); every rim gets an ortho and a perspective variant switched by drivers on scene.camera.data.type (the perspective one skips the solder-mask plates; refine_persp_rim gives parts that still clip their own orbited rim); "make it perspective/ortho" = change cam.data.type only; references/lighting.md
6bMore shotsbpr_scene.new_shot(name, source=…)every additional view — preset, reference image, the user's current viewport, an existing camera, a screenshot — becomes its own scene SHOT_<name> with the full standard setup (shared product, own camera/rig/backdrop/world, preview render settings); never re-aim an existing shot; see Shot scenes below
7Look-dev loopbpr_render.exposure_check(path, scene=sc) + bpr_studio.veil_check(r["view"], scene=sc)per scene (any scene, not just the window one): bands are read from the False Color image Blender wrote, per region (product silhouette from a mask render, its left/centre/right thirds, background); red/white on the product = glare, black/blue = crushed; on glossy PCBs in perspective also compare veil_check before/after a lighting change (the veil stays lime/yellow); tweak with scale_lights(f, role), exposure, materials; references/lighting.md
8Animationbpr_anim.*references/animation.md
9FinalASK first → bpr_render.render_shots(dir, confirmed=True) / background(out, confirmed=True)the final render never starts on its own: when the setup is done, summarise the scenes and ask whether to render now (all shots / some / not now). Without a yes, save the .blend and stop; background()/render_shots() refuse to run without confirmed=True; references/render.md

Order inside 4a matters: materials are assigned per object before joining (joins keep per-face materials) and solder is built from individual pads. Re-running a stage on an already processed scene is not supported for normalize/organize — re-import instead.

Material library (PCB Materials) — primary source for shading

The skill ships a Blender asset library (assets/PCB Materials/, 158 materials: masks, finishes, silk, substrates, component bodies/metals, enclosure plastics, FDM/SLA, clear and frosted, elastomers, metals, inks). It is the first source of every material, so all renders share one look; a material is built from scratch only when no library material is adequate.

  • Install / first run: bpr_library.ensure_installed() copies it to <Documents>/Blender/Asset Libraries/PCB Materials/ and registers it in Preferences > File Paths > Asset Libraries (Preferences saved). It also runs by itself the first time a material is requested in a session, and updates an older installed copy (backup in Asset Library Backups/, outside the library so the Asset Browser never lists a material twice). Run bpr_library.status() in stage 0 and tell the user if it was installed or updated.
  • PCB and components: bpr_pcb.*_material() and bpr_materials.component_material() fetch the library material with the same key (pcb_mask:green:glossy, cmp:metal_tin, ...).
  • Enclosures and colour-dependent parts: assign_from_source_names / material_for_source decide the kind (injection + VDI, FDM, SLA, translucent, clear, rubber, metal + finish) and take the closest library material of that kind whose colour is within ΔE 6 (CIE76; whites and blacks compared on hue first) and whose VDI is within ±6; otherwise they build one. The returned table says library <key> (ΔE …) or built per material — show it to the user.
  • FDM layers along an axis other than Z, unusual colours and custom finishes are built.
  • Pick by hand: bpr_library.get("enc:abs_white_vdi30"), browse bpr_library.list_keys("enc:").
  • No duplicates: get() reuses an existing copy (tagged, same name, project original, or linked) instead of appending again; identical library materials are one material with alias keys. Local copies never update themselves: after a library update run bpr_library.consolidate(refresh=True, keys=[changed keys]) on the scene — it also merges repeated copies and repeated links to the library file.
  • Keys, catalogues, adequacy rules, rebuilding and re-bundling: references/material-library.md.

Shot scenes (every new view = a new scene)

Whenever the user asks for another view — "faz uma vista isométrica", a reference image, a screenshot of their viewport, "usa a posição atual da câmera" — create it with bpr_scene.new_shot(name, source=...); do not move the camera of an existing scene:

InputCall
a preset anglenew_shot("iso", shot="iso", projection="orthographic")
a reference imagenew_shot("ref1", source="reference", reference=path) (camera + studio from the picture)
"this view" / current viewport (Blender UI open)new_shot("view1", source="view") (position, rotation, lens/ortho scale)
an existing cameranew_shot("cam2", source="camera", camera="CAM_hero_34")
a viewport screenshot onlysource="reference" with the screenshot (no numbers in a picture), or ask the user to keep that view open and use "view"

The new scene links the product collections only (camera, rig, backdrop and parked-light collections of the source are recognised by bpr_role tag, name or content and left out), copies the source's view-layer states (an excluded back cover stays excluded), refuses an implausible product size before placing anything, and measures the source in its own depsgraph (the window scene does not matter). It gets its own camera, light rig (STUDIO_RIG_<name>), backdrop and world, copies units, resolution and frame range, uses the source scene's studio preset unless told otherwise, and is set to preview quality. Then run exposure_check(path, scene=sc) on it. bpr_scene.list_shots() / activate(name) list and switch scenes. Presets with float move the shared PRODUCT_ROOT.

Choosing the look

Map the user's words (or their reference images) to a preset + shot; bpr_studio.list_presets() and bpr_camera.list_shots() print them. Defaults when the user gives no direction: enclosure → soft_highkey + hero_34; PCB → pcb_hero + high_34 (and offer pcb_clean). If the user supplies new references, analyse them the way references/visual-language.md does (background tone, source size/direction, contrast, lens, angle, crop) and pick or extend a preset.

Reference-image mode (the user hands you a picture)

When the user gives a reference image ("quero algo assim", a Pinterest pin, a competitor photo), treat it as the spec:

  1. Look at it and write down what the numbers can't give: camera angle and height, lens feel (perspective, compression), crop, material and finish, mood, props.
  2. Measure it: bpr_reference.analyze(path) → backdrop colour/gradient/vignette, how much of the frame the product fills and where it sits, tonal contrast inside the product, which side the key is on, contact shadow vs floating, plus a recipe (preset, bg, aspect, margin, lens shift, mirror_lights, look, fill_scale).
  3. Apply: bpr_reference.apply_recipe(rec, shot=..., az=..., el=..., lens=...) — pass the angle/lens you judged by eye as camera overrides. Use levitate if floating is true, a macro shot if the product bleeds off the frame.
  4. Iterate: render a preview, then bpr_reference.compare(ref, render, sheet) → side-by-side sheet + deltas + hints (flatter/harsher, backdrop brighter/darker, product too small, key on the wrong side). Look at the sheet; stop when both read alike as thumbnails.
  5. Say which aspects you matched and which you deliberately didn't (e.g. a lifestyle prop).

Several references → find what they share (that is the brief) and note where they disagree. Never copy a reference's logo, text or a recognisable branded product into the render.

Alex's taste (review feedback)

High-key must not look washed out: keep a clear light/shadow side and a backdrop that falls off toward the corners — reduce fill before raising exposure. Plastic texture should read. Logo letters/icons (INLAY_*) get dark ink by default (inlay="source" keeps the CAD metal). Florence enclosures default to injection-moulded VDI 30; use FDM when asked.

Things that silently ruin product renders (and the fix built into the scripts)

  • Wrong scale → DOF, SSS, texture grain and light falloff all wrong. Normalise to metres.
  • Bad tessellation (CAD sliver triangles, split seams, degenerate faces) → streaks and pinched highlights under smooth shading. bpr_mesh.repair + smooth (Weighted Normal, Bevel modifier, Subdivision/Remesh where appropriate) — verify with the MatCap shading_diagnostic.
  • Smooth shading on CAD triangulation → dark gradients and streaks on flat faces (the corner normals of a big face lean toward the slivers and fillet strips around it), and a Bevel modifier whose arc miters solve sliver pairs can throw vertices ~1e15 m away (seen on Blender 5.2 for Windows; off-screen, so previews look fine while every bbox breaks). smooth() dissolves first and guards the extent; shading_audit/fix_shading measure and repair per object; bpr_util bounding boxes ignore non-finite or > 1 km corners.
  • Flat-shaded bodies (imports and every separate/split come in flat) → cylinders, pins, bends and fillets show bands of flat facets. bpr_mesh.ensure_smooth() (stage 4d) shades every body smooth with sharp edges by angle (40°: 12-segment curves at 30° blend, 45° chamfers and 90° edges stay crisp). Polygonal silhouettes (a 12-gon hole outline) are geometry and stay visible.
  • Inverted / mixed normals (whole bodies inside-out, random triangle winding — Altium OBJ flips about half of each body's faces —, mirrored parts) → Cycles still draws them, but Fresnel, coat, transmission, SSS, bevel and bump all invert: white plastic goes grey, glass and the translucent mask misbehave. bpr_normals.fix_normals orients every body by ray parity on a welded copy (unwelded faces are the norm in EDA exports; signed volume alone leaves them inverted), falls back to the side tag for single-sided plates, clears stale custom normals and audits the result; bpr_normalize already re-winds objects baked with a mirroring transform.
  • Coplanar faces (EDA mask plane vs component bottoms/silk; logo letters, icons, LED diffusers flush with a housing face) → black stripes that change per sample. bpr_pcb.fix_layer_stack and bpr_import.separate_coplanar lift by µm along the face normal; overlaps inside a layer (silk segments crossing at outline corners, two outlines sharing an edge, pad vs pour) survive that and show as black dots/lines — bpr_zfight finds them exactly, fixes them and re-validates. Never declare the model clean without a clean scan().
  • Inlays treated as coplanar conflicts (logo/text bodies filling a host pocket) → black wedges, a dark ragged outline, glyphs at different heights. A host-sized bevel folds a 0.2 mm glyph (smooth() now caps every bevel at 25 % of the part's thinnest wall), the two outlines are tessellated independently, the host bevel rounds the pocket rim, and depth translations separate the glyphs. bpr_inlay.fix_inlays handles all four; bpr_zfight leaves seated glyphs alone.
  • Merged component bodies (pins, feet and tabs fused into a connector housing with one colour) → black or white "plastic" pins. bpr_parts finds them by shape (bars incl. bent L-leads, bent sheet, repeated blades, loose pin shells), previews the split, moves contacts into <name>_METAL (gold/tin) and tabs into <name>_TABS (tin), and re-checks normals.
  • Blocky solder → pointed tents on every lead. add_solder() builds tangent mounds with elliptical contours and a Subdivision modifier; fillet height follows the pad width.
  • Light in the camera's mirror direction → white sheet of glare over glossy flat tops. build(glare_guard=True) swings such lights away (keeping the light's edge, not just its centre, outside the reflection; lifting it if swinging is not enough) and reports it. High iso/top views of PCBs are the typical case: confirm with exposure_check() — red/white on the board in False Color means a reflection still hits the camera.
  • A rim that is safe in ortho glares in perspective → perspective rays fan out (±10° at 100 mm) and, near a frame corner, the glossy mask's mirror cone reaches the strip's edge: a washed, desaturated veil that never turns red in False Color. The perspective rim variant excludes the mask plates; veil_check measures it.
  • Light linking with collection instances → an instancer inside any receiver set overrides per-object membership of what it instances; product-only lights use an EXCLUDE{backdrop} set, never INCLUDE{instancer} (bpr_studio.link_set).
  • Judging exposure by eye on a preview → glare and crushed shadows hide in small PNGs. bpr_render.exposure_check() renders the False Color view (Color Management → View → False Color) and measures the bands per region; use it on every scene during look-dev, never for finals (it restores the view transform).
  • Area-light Spread concentrates power in Cycles (75° ≈ 4×, 45° ≈ 6.6× on-axis). The rig compensates (SPREAD_GAIN); remember it when adding lights by hand.
  • Lights left over from the import at the old scale swamp the rig; build() parks them.
  • Razor CAD edges → render looks like CAD. Library shaders include a Bevel node (0.2–0.5 mm).
  • matrix_world is stale after Python edits → wrong bboxes. Call bpr_util.refresh().
  • Blender 5.x API changes (slotted actions, use_nodes, AgX look names): see references/blender5-notes.md.

Verification checklist (look at every preview)

  1. Exposure (exposure_check() per scene): no red/white on the product except tiny specular points, no black/blue shadow areas; white parts just below clipping with visible shading; backdrop separates from the product (high-key backdrop yellow/orange in False Color, ~#E0–E8; dark presets ≤ #1A).
  2. No glare sheets on flat glossy surfaces; no black/stripy lines or corner dots (z-fighting — bpr_zfight.scan() reports clean: True); no fireflies.
  3. Materials come from the library where one is adequate (the assignment table says so) and read correctly at delivery size: mask green (not white), traces faintly lighter, gold pads, solder bright and smooth (no ridges or points), no flat facet bands on curved bodies, connector pins/feet/tabs metallic (not housing-coloured), plastic texture visible only up close.
  4. Framing: product fills ~60–75 % of the frame (hero) with breathing room; focus where intended.
  5. Matches the chosen reference category (compare side by side if the user gave references).

Report what you changed and show the preview. At the end, list the scenes and ask whether to render now — never start the final render without that answer. Keep the user's scene organised: everything the skill creates is prefixed (STUDIO_, CAM_, PCB_, CMP_, SRC_) and grouped in collections.

Tests

tests/run_tests.py — synthetic regression tests (bevel guard, shading audit/fix, False Color bands vs pixels, product mask/region, new_shot copy, rim variants and instance light linking, inlay seating and the bevel thickness guard, library duplicates). Run blender -b --factory-startup --python tests/run_tests.py after changing a module.

Reference files

  • scripts/bpr_reference.py — reference-image analysis, recipe and compare sheet (see above).
  • scripts/bpr_zfight.py — coplanar-overlap scan, automatic repair loop, conflict camera.
  • scripts/bpr_parts.py — split merged component bodies into plastic and metal parts.
  • scripts/bpr_inlay.py — inlay detection, seating and verification (also bpr_parts.find_inlays/fix_inlays).
  • scripts/bpr_scene.py — shot scenes: one scene per view with the standard setup.
  • references/visual-language.md — Alex's 200-image reference library distilled: categories, lighting/camera/CMF patterns, which preset reproduces which images (IDs).
  • references/mesh.md — mesh-quality checks, repair, modifier toolbox (Bevel, Weighted Normal, Subdivision, Remesh, Corrective Smooth) with pros/cons and tuning.
  • references/pcb.md — board layer model, exporter quirks (Altium OBJ, KiCad/pcb2blender), mask physics, finishes, solder, z-fight rules, troubleshooting.
  • references/materials.md — enclosure/component material library, VDI table, FDM, metals, CAD-appearance mapping, CMF tips.
  • references/lighting.md — product lighting principles, preset anatomy, tuning recipes.
  • references/camera.md — lenses, shot list, DOF, composition, aspect ratios.
  • references/animation.md — shot grammar, timing/easing, recipes for every bpr_anim function, video references.
  • references/render.md — Cycles settings, AgX looks, denoise, output formats, background jobs.
  • references/blender5-notes.md — API gotchas verified on 5.2 LTS.
  • references/material-library.md — the bundled PCB Materials library: install, keys, catalogues, adequacy rules, rebuild and re-bundle

Related Skills