import type { Document } from '@gltf-transform/core'; /** * REPAIR IN PLACE: gives every LOD scene of an already-packaged character GLB its own copy of a skeleton that * several scenes share — undoing helix-creator-cli #219's fold without the original source. * * #219 grouped a multi-LOD add-on's per-LOD skins by their ordered joint names, repointed every LOD's skinned * mesh at the first skin, rooted that one skeleton in every scene, and disposed the other copies. Those copies * were byte-for-byte duplicates — every LOD level was parsed from the same conformed bytes, so joint names, * order, local transforms and inverse bind matrices were identical — so nothing was lost that cannot be * rebuilt: for each scene after the first that roots a shared subtree, clone that subtree (names, TRS, * extras, the same mesh/skin references), give the scene's skinned meshes a new Skin over the cloned joints * with the SAME inverse-bind accessor, and swap the scene's root reference to the clone. The result is the * pre-#219 structure, which three.js loads (see `mergeLods`' header for why the shared form does not). * * Only the node/skin graph changes: every accessor (positions, weights, joints, IBMs), mesh, material and * texture is untouched and keeps its identity. The outcome is checked with `assertSelfContainedLodScenes`. * * Refuses (throws) rather than guesses when: * - a LOD scene has no skinned mesh left — #219's dispose would have deleted a mesh node parented UNDER a * duplicate bone, which no repair can recover (re-extract that item); * - a skin mixes joints from a shared subtree with joints owned by its own scene; * - a node to be cloned carries glTF extensions (never seen on a character skeleton; not silently dropped). */ export interface SplitSharedLodSkeletonsResult { scenes: number; /** Scenes that received their own copy of a shared subtree. */ scenesRepaired: number; nodesCloned: number; skinsCreated: number; } export declare function splitSharedLodSkeletons(document: Document): SplitSharedLodSkeletonsResult;