import type { Object3D } from 'three'; export interface DroppedFbxTextureBinding { material: string; slot: string; texture: string; } export interface NormalizedFbxMorphTargets { mesh: string; before: number; after: number; repetitions: number; } export interface NormalizedFbxHumanoidSpace { sourceUpAxis: 'x' | 'y' | 'z'; rotationXDegrees: 0 | -90; unitScale: 1 | 0.01; referenceSpan: number; } /** * FBXLoader decodes embedded images with `window.URL.createObjectURL` and `ImageLoader`'s * `document.createElementNS('img')`, neither of which exists in Node, so any FBX that embeds a texture * (Meshy text-to-motion clips ship a textured preview body) died with "window is not defined" before * a single bone was read. Texture pixels are never part of the retarget input, so provide inert * stand-ins for the duration of the parse: the images never load, and sanitizeInvalidMaterialTextures * then drops every texture slot that has no exportable image. */ export declare function withInertDomForFbxParse(run: () => T): T; /** * FBXLoader preserves Unreal's Z-up centimeter scene coordinates, while glTF * consumers require Y-up meters. Infer the conversion only from a recognized * humanoid chain so ordinary Y-up FBX characters remain unchanged. The * transform is kept on the exported scene root; conformToHelixRest bakes each * skinned mesh's world transform before replacing the source rig. */ export declare function normalizeFbxHumanoidSpace(root: Object3D): NormalizedFbxHumanoidSpace; /** * FBXLoader can attach the same named blend shapes repeatedly when one Unreal * skeletal mesh contains several material sections. Collapse only proven, * byte-identical repetitions; ambiguous FBX morph data is rejected intact. */ export declare function normalizeRepeatedMorphTargets(root: Object3D): NormalizedFbxMorphTargets[]; export interface FbxUvConventionResult { /** Distinct geometries whose uv/uv1..uvN attributes were converted. */ geometries: number; /** Distinct UV attributes converted (a geometry with uv + uv1 counts twice). */ attributes: number; /** Exportable textures whose flipY was inverted to keep sampling identical. */ textures: number; } /** * Converts FBXLoader's texture coordinates to glTF's convention. * * FBX (like OpenGL) puts the UV origin at the bottom-left, and FBXLoader passes those values through * untouched, relying on Three's `texture.flipY` to sample images correctly. glTF puts the origin at the * top-left and has no flipY: GLTFExporter compensates by writing a vertically flipped copy of every * flipY image, which is only correct for the images it exports itself. Images bound later — the Unreal * material sidecar's top-down PNGs, or anything a later stage attaches — would sample a vertically * mirrored spot, so a cap's crown panels land on the brim's gutter. Converting the coordinates here * (v' = 1 - v) makes the converted GLB a normal glTF; inverting flipY on the textures GLTFExporter still * exports keeps their sampling byte-for-byte what it was. */ export declare function convertFbxUvsToGltf(root: Object3D): FbxUvConventionResult; /** Removes only texture slots that Three's GLTFExporter cannot encode. */ export declare function sanitizeInvalidMaterialTextures(root: Object3D): DroppedFbxTextureBinding[]; /** * Deterministically converts an FBX into the same binary glTF input consumed by * the character retarget stages. Keeping this inside the published CLI closes * the previous hidden dependency on a DCC export before `character import`. */ export declare function convertFbxToGlb(path: string): Promise;