import { type ConformResult } from './stages/conform'; import { type Ktx2Mode, type Ktx2Result } from './stages/ktx2'; import { type CharacterSourceProvenance } from './importTrust'; export declare const CANONICAL_BODY_FILENAME = "body-m-default.web.glb"; export interface ImportCharacterOptions { /** Source biped character GLB (skinned body, Meshy/Mixamo-style rig). */ body: string; /** Bone map JSON path ({ map: { src: helix }, drop: [...] }). Default: the bundled Meshy->helix map. */ map?: string; /** Canonical helix body GLB. Default: body-m-default.web.glb from the world's installed humanoid-character * pack when present, else the embedded helix-humanoid@1 skeleton snapshot (fully standalone). */ canonical?: string; /** Optional animation GLB (same source rig) to retarget onto the canonical skeleton -> /anims/.glb. */ anim?: string; /** Clip name for --anim (mirrors the engine retarget-clip-cli default). */ clipName?: string; /** Output directory (default ./character-out). */ output?: string; /** Output basename (default: derived from the body file name) -> .web.glb. */ name?: string; /** Triangle target per LOD level, high->low (default [10000, 5000, 1500]). */ lodTris?: number[]; /** Texture longest-edge cap (default 1024); the bake route halves it per LOD level like a mip chain. */ texSize?: number; /** KTX2 codec per LOD level (a shorter list repeats its last entry; a single value = all levels). * Default ['uastc', 'etc1s']: UASTC where the camera gets close, ETC1S (~5x smaller) for the far * levels where its block artifacts are invisible. */ ktxModes?: Ktx2Mode[]; ktxQuality?: number; /** Encode textures to KTX2/Basis (default true). Disable to keep the source PNG/JPEG textures — * for pipelines that must scan or re-encode the images downstream (e.g. a moderation gate that * can only decode png/jpeg, followed by a server-side KTX2 optimize pass). */ ktx2?: boolean; /** Meshopt error budget (default 0.02 — imports resist collapse). */ simplifyError?: number; /** Preserve UV-seam/material-boundary verts during decimation (default false for imports). */ lockBorder?: boolean; /** Force (true) or disable (false) the weld+unwrap+rebake path; undefined = auto-detect micro-chart atlases. */ bake?: boolean; /** 'source' preserves the model's rest shape; 'canonical' aligns it to the pinned HELIX rest * joint positions. This proves skeleton/animation compatibility, not garment-envelope fit. */ fit?: 'source' | 'canonical'; /** Seam-weld fallback for floored far LODs on the non-bake path (default true; LOD0 never welds there). */ weld?: boolean; /** Slice head-weighted triangles into a separate 'FaceMesh' node per LOD (default true), so the * runtime's first-person mode can hide the head like the stock character's face part. */ splitFace?: boolean; /** Directory whose installed packs are searched for the canonical body (default process.cwd()). */ cwd?: string; /** Progress sink (default console.log). */ onProgress?: (message: string) => void; /** Optional source/license record. When present it is validated and embedded in the import receipt. */ provenance?: CharacterSourceProvenance; } export interface ImportCharacterClipResult { name: string; path: string; metaPath: string; frames: number; duration: number; animatedBones: string[]; } export interface ImportCharacterResult { /** The packaged multi-LOD body: /.web.glb. */ bodyPath: string; /** Final triangle count per LOD level (scene order = level order). */ lodTris: number[]; /** Texture size per LOD level on the bake route; a single capped size otherwise. */ textureSizes: number[]; retarget: { renamed: number; unmapped: string[]; dropped: string[]; }; conform: Pick; /** Aggregated over the per-level encodes (each LOD may use a different codec). * With `ktx2: false` the encoder is 'skipped', modes is empty and before/after are 0. */ ktx2: { encoder: Ktx2Result['encoder'] | 'skipped'; modes: Ktx2Mode[]; before: number; after: number; }; clip: ImportCharacterClipResult | null; /** Machine-readable source, transform and output receipt written beside the packaged GLB. */ receiptPath: string; } export interface RetargetAnimationOptions { /** Raw Mixamo/Meshy animation FBX or GLB. */ animation: string; map?: string; canonical?: string; clipName?: string; /** Whether consumers should loop the clip. Defaults false for one-shot imports. */ loop?: boolean; /** Output GLB path. Default: ./character-out/anims/.glb. */ output?: string; cwd?: string; onProgress?: (message: string) => void; } /** * Finds the canonical helix body GLB inside the world's installed packs. First-party installs copy * whole bundles (code AND assets) into /helix_modules//; consumer installs are code-only * under /public/helix_modules/ (assets stream from the CDN), so only a first-party install of * the humanoid-character pack can satisfy the default — otherwise the caller must pass --canonical. */ export declare function findCanonicalBody(cwd: string): string | null; /** * Retargets one raw FBX/GLB directly to the platform clip format without * requiring a separate body-conversion run. */ export declare function retargetAnimation(opts: RetargetAnimationOptions): Promise; /** * Converts an external biped character GLB into a helix-humanoid@1 drop-in, chaining the engine * pipeline's stages: rename the rig (retargetSkeleton) -> embed the canonical skeleton at the source's * proportions (conformToHelixRest) -> LODs (rebake route for micro-chart atlases) -> merge -> resize -> * KTX2 -> /.web.glb. With `anim`, also retargets the clip -> /anims/.glb. */ export declare function importCharacter(opts: ImportCharacterOptions): Promise;