Skip to content
Shapemetry

@huukhanhnguyen/model / lanes/materials/nodes

lanes/materials/nodes

evaluateMaterials()

evaluateMaterials(model): Resolved<MaterialData[]>

materials[] pull — dirty-gated SnapshotLaneNode. Texture edges + consumers (views/sheets/placePart) cascade from here.

Parameters

model

Model

Returns

Resolved<MaterialData[]>


materialsNodeOf()

materialsNodeOf(model): SnapshotLaneNode<(Operation | Group)[], MaterialData[]>

Parameters

model

Model

Returns

SnapshotLaneNode<(Operation | Group)[], MaterialData[]>


materialsValueOf()

materialsValueOf(model): MaterialData[]

Unwrapped materials for internal consumers (render/export/part meta).

Parameters

model

Model

Returns

MaterialData[]


resolveProcessorTextures()

resolveProcessorTextures(model): void

Resolve texture-chain references onto _materialRecords — the live cache every collectMaterials() pass spread-copies from, so later render syncs (which re-collect fresh copies) keep the pixels. Each key routes through the SAME persistent TextureNode sampleTexture and evaluateTexture use (textureNodeOf) — a no-op re-evaluate hits its cache instead of re-rasterizing (replacing the old _texturesSignature/_textureCache whole-lane hash). _textureDataCache keeps the WRAPPED TextureData object reference-stable across calls too (toTextureData() itself isn't memoized by TextureNode — only its raw ImageBuffer input is): re-wrapping the SAME cached ImageBuffer on every evaluate() would otherwise hand back a fresh TextureData object each time even when nothing changed, breaking a consumer that compares by reference (a model.evaluate({unrelatedParam: x}) must NOT visibly re-rasterize a chain that's isolated from model params).

Parameters

model

Model

Returns

void

Last updated: 📖 1 min readEdit on GitHub