import { type Document } from '@gltf-transform/core'; /** * REPAIR IN PLACE: gives an already-packaged character add-on the HOST's skeleton frame. * * Base Female hoists a `root_offset` wrapper (0, -0.0331, -0.0049) m above its skeleton root. The engine binds a * part with the HOST's bones and the PART's own inverse-bind matrices (attachSkinnedPart.ts), so a part whose * skeleton lacks that wrapper renders at `file + offset` — 33 mm low and 5 mm back of where its mesh was authored. * The conform now carries the wrapper (`extractCanonicalSkeleton({ hoistRootOffset })`); this stage repairs the * add-ons packaged before that, with no source: it re-creates the wrapper above each skin's skeleton root and * rewrites that skin's inverse-bind matrices as `inverse(offset x joint world)`. * * Only the node graph (one new wrapper per skeleton root) and the IBM accessors change; every vertex attribute, * mesh, material and texture is untouched. It proves the repair is a pure frame shift before touching anything: * every skin joint's host world must equal `offset x its current world` to `tolerance`, else it throws naming the * joint (a part on a different rest, scale or skeleton is not ours to re-frame). * * Refuses (throws) when the part's skins share a skeleton root across scenes (#219's shared-LOD form — run * `helix character repair-lod-skeletons` first), or when a joint is missing from the host. A host without a * wrapper (Base Male) yields `reframed: false` and changes nothing. */ export interface ReframeSkeletonResult { /** The host's wrapper world matrix, or null when the host hoists nothing. */ hostOffset: number[] | null; skins: number; skinsReframed: number; /** Skins whose root already sits under a matching `root_offset` (re-running is a no-op). */ skinsAlreadyFramed: number; /** Largest |host world - offset x part world| over every joint of every skin, metres / unit. */ maxJointDelta: number; reframed: boolean; } export declare function hostRootOffset(host: Document): number[] | null; export declare function reframeSkeletonToHost(part: Document, host: Document, options?: { tolerance?: number; }): ReframeSkeletonResult;