/** * What a VRM face carries that `helix/avatar-face@1` cannot hold, as the additive `helixFaceExt` block. * * ── WHY A SECOND BLOCK ───────────────────────────────────────────────────────────────────────────────────────── * The face contract is strict by design: one morph per channel, a closed set of six expression ids, morph * targets only. A real VRM goes past all three. VRoid's `joy` drives a mouth shape AND an eye shape; a VRM 1.0 * file can declare custom expressions ("wink", "tongue"), mark an expression binary, and say that wearing it * suppresses blinking, gaze or lip-sync (`overrideBlink`, `overrideLookAt`, `overrideMouth`); and `lookAt` * says how far the eyes may turn and whether they are bones or morphs. None of that fits a contract whose * reader rejects any key it does not know, and widening the contract would break every runtime already * deployed, so this travels beside it, in its own extras key. A runtime that predates it ignores it and keeps * the one-morph-per-channel behaviour; a current one prefers it. * * Material colour and texture-transform binds (a blush that fades in, an eye highlight) are not carried: * they need the material layer, which belongs to the toon-material work. */ import type { GltfLike } from './vrmFace'; export declare const FACE_EXT_VERSION: 1; export type OverrideMode = 'block' | 'blend'; export interface FaceExtBind { morph: string; weight: number; } export interface FaceExtExpression { /** A face semantic (`vowel.aa`, `blink.left`, `gaze.up`), an expression id (`happy`) or `custom.`. */ name: string; binds: FaceExtBind[]; binary?: true; overrideBlink?: OverrideMode; overrideLookAt?: OverrideMode; overrideMouth?: OverrideMode; } export interface FaceExtLookAt { type: 'bone'; left?: string; right?: string; /** Degrees an eye turns at full gaze weight, per direction (VRM `outputScale` at `inputMaxValue`). */ degrees: { inner: number; outer: number; up: number; down: number; }; } export interface FaceExt { version: typeof FACE_EXT_VERSION; expressions: FaceExtExpression[]; lookAt?: FaceExtLookAt; } export declare const FACE_EXT_LIMITS: { readonly expressions: 64; readonly binds: 16; readonly nameLength: 96; }; export interface FaceExtResult { ext: FaceExt | null; /** What the one-morph contract can carry for gaze, when the file looks with morphs rather than bones. */ gazeScale: number | null; lookAtType: 'bone' | 'expression' | 'none'; warnings: string[]; } /** * Read everything the strict contract drops. * * `boneExists` maps a SOURCE node name to the name that node has on the converted rig, or undefined when the * converted rig has no such bone; eyes are only declared when they survived conversion as skinned joints. */ export declare function convertVrmFaceExt(gltf: GltfLike, boneExists?: (sourceNodeName: string) => string | undefined): FaceExtResult; /** Every morph name the ext binds, so the prune step keeps them. */ export declare function faceExtMorphNames(ext: FaceExt | null): string[];