# `materialSpecFromNode`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

Function · `import { materialSpecFromNode } from '@holostep-configurators/runtime-client';` · stable · since 2.0.0 · section 22. Pure helpers (root of the package; run in Node and the fake)

Stored MaterialNode → partial MaterialSpec. Lossless on stored fields; keeps `enabled: false` maps and `optimizedUrl`. Adds the scalar each active stored map implies (section 8.2, rule 1: white `baseColor`, `metallic` 1, `roughness` 1, white `emissive` unless `emissiveColor` is stored, clearcoat 1, and `alphaMode` 'blend' with an alpha map whose `alphaMapTextureEnabled` is true), so the GLB's own factors never mute a stored map. Applies 1.x's specular and sheen gates (rule 8): with a gate true, the group's absent scalars take 1.x's defaults (`ior` 1.5 included), never the GLB's; with it false, or absent beside a stored field or map of the group, the group converts with `enabled: false` and `ior` is left out. Sync, pure.

## Declaration

```ts
export declare function materialSpecFromNode(node: IMaterialNode): MaterialSpec;
```

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `materialSpecFromNode` names no product |
| 2. A precedent | not recorded: no ledger row (coverage.json) names this member or its owner |
| 3. Two apps, or labs | not recorded: no ledger row names this member or its owner |
| 4. The cheaper fix first | not recorded per member (Appendix B decides it per need) |
