# Export D5

> Prepare the Rhino model for D5 Render — optionally strip block/point/curve/hatch/dim, and give every un-mapped object a texture mapping (copy from an already-mapped object, or a box 1000×1000×1000 mapping on a shared origin) so materials render consistently. D5's actual push is a manual click in the D5 panel (no scriptable command). Asks whether to work on a copy, dry-runs first, then applies. Trigger when the user wants to export/prep/hand off to D5 / D5 Render / D5 Sync / LiveSync, or "match mapping" for render. Fire on Korean or English requests, e.g. "d5로 내보내기", "d5 렌더 준비", "매핑 맞춰줘", "박스 매핑", "match mapping", "export to d5", "prep for d5 render".

- Skill: `hongikarchi/export-d5` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add hongikarchi/export-d5`
- Raw SKILL.md: https://api.skillmd.com/api/skills/hongikarchi/export-d5/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: hongikarchi (https://skillmd.com/u/hongikarchi)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/hongikarchi/export-d5

---


# export-d5

Prep the model for D5 Render. Scripts: shared `export-common/strip_prep.py` (strip by type) and
`exportd5_prep.py` next to this file (match mapping, `D5_APPLY=True` to apply). **The D5 transfer
itself is manual** — D5's Rhino plugin (D5 Sync / LiveSync) exposes only panel buttons, no scriptable
command, so this skill does the Rhino-side prep and then hands off.

## Steps
1. **Model safety — ask each run**: SaveAs copy vs current doc (prep is destructive: strip + mapping).
2. **Strip — ask which types** (spec "옵션으로 물어보기"). Glob `**/export-common/strip_prep.py`,
   dry-run counts, confirm, apply the chosen types (usually strip point/curve/hatch/dim, KEEP blocks
   and solids). Same as export-sketchup step 2.
3. **Match mapping.** Select the objects, then:
   ```python
   exec(open(r"<ABS>\exportd5_prep.py").read())                    # dry-run: mapped vs unmapped counts
   # primary: copy an existing mapped object's mapping onto the unmapped ones
   EXEMPLAR_ID="<guid-of-a-mapped-object>"; D5_APPLY=True; exec(open(r"<ABS>\exportd5_prep.py").read())
   # or fallback (no exemplar): box 1000^3 mapping on the world origin
   D5_APPLY=True; exec(open(r"<ABS>\exportd5_prep.py").read())
   ```
   Unmapped = `RhinoObject.GetTextureChannels()` empty. Primary path copies `GetTextureMapping(ch)` from
   the exemplar; fallback builds a `CreateBoxMapping(WorldXY, ±500³, capped)` (size = `BOX_SIZE`,
   default 1000) — all objects share one `Plane` so "원점이 동일하게" holds.
4. **Hand off.** Tell the user to click **Sync / LiveSync** in the D5 panel. This cannot be scripted.

## Gotchas (verified where noted)
- **D5 is not scriptable.** No `_D5*` command / dash macro; `.d5a` file export is also plugin-driven.
  The skill stops at prep + a manual "click Sync" instruction.
- **Mapping API verified** live: `GetTextureChannels()` empty → no mapping; `CreateBoxMapping` +
  `SetTextureMapping(1, tm)` (returns the channel ≥0) + `CommitChanges()` → channel appears;
  `GetTextureMapping(1)` reads it back (used for the exemplar-copy path). Net-zero on the test object.
- **Namespace is `Rhino.Render.TextureMapping`**, not `Rhino.Geometry`.
- **PBR BaseColor** from `clean-rhino`'s material step maps most predictably to D5's albedo — run
  `clean-rhino` (material stage) before D5 for white-plaster defaults.
- **Prep is destructive** (strip deletes; mapping writes) → copy-vs-current prompt in step 1.
- `_MatchMapping` command needs interactive picks, so the skill replicates it via
  `GetTextureMapping`→`SetTextureMapping` instead.

## Not yet implemented
- Any automated D5 push (blocked — no D5 command surface).
- Auto-choosing the best exemplar (the caller passes `EXEMPLAR_ID`, or the box fallback is used).

## Reference
Built 2026-07-01 (task 4 of the 6-task suite). Mapping + strip APIs verified live on
`260629 main ms.3dm`. See memory `rhino-export-mechanics` and the plan.

