import type { Document } from '@gltf-transform/core'; export interface MergeSkinsReport { /** Skins folded into the first one. */ merged: number; /** Skins whose meshes were moved by a constant bind offset before the merge (their inverse bind matrices differed by one translation). */ rebased: number; /** Joints that were not in the first skin and were appended to it (with their own inverse bind matrix). */ appendedJoints: number; /** Skins left alone, each with the reason. */ skipped: { skin: string; reason: string; }[]; } /** * Fold every other skin into the first when they describe one skeleton: a joint both skins list must bind with the same * inverse bind matrix, and a joint only the later skin lists (a tail, an accessory chain, an extra spring bone) is * appended to the first with that skin's own matrix. Each primitive's JOINTS_n is rewritten to the merged index. * * `collapseIdenticalSkins` handles skins that are byte-for-byte the same list; this handles the next case up, which is * what a real VRM export looks like (SysMocap VAL has 9 skins, a tail mesh skinned to joints the body skin does not * list). `conformToHelixRest` reads `listSkins()[0]` and rebinds only its meshes; every other mesh kept its source * joints, which the LOD merge then refused ("skinned to joints outside that scene"). * * Two skins over the same joints can still bind differently by ONE constant offset (a mesh authored with an object * transform: SysMocap VAL's tail and ears, neon FAST_FOOD_MAX's cylinder). `inverse(A) * B` is then the same pure * translation T on every shared joint, so the mesh is rebased into the first skin's bind space (positions += T) and merged; * the pose is unchanged because `J * IBM_A * T == J * IBM_B`. * * A skin whose shared joints differ by anything but a constant translation, whose primitives share a JOINTS accessor with another skin's, or that * has no inverse bind matrices is left alone and reported: merging those changes the pose. */ export declare function mergeCompatibleSkins(document: Document): MergeSkinsReport;