/** * CharacterHostFromComposition — derive a renderable CharacterHost from an authored * `.holo`/`.hsplus` character composition. The bridge that makes the native authored * structure library actually RENDER (composition → CharacterHost → renderCharacter). * * Pure-data + GPU-free + parser-decoupled: it takes a STRUCTURAL view of the parsed AST (the * minimal subset it reads), so it needs no cross-package type import and no runtime parser * dependency — the caller parses (`parseHolo`) and passes `.ast` in. It maps the cleanly * supported traits (@body, @face, @subsurface_scattering, @hair, @morph, @skeleton, @locomotion) * onto CharacterHost and returns an honest report of what is mapped vs stubbed. The native * morph channel is a bounded procedural-head FACS/viseme subset; unsupported target/style * names remain explicit instead of being silently accepted. * * @module character-render */ import { CharacterHost, type AgentAvatarSkinMaterialReceipt } from './CharacterHost'; import type { AgentAvatarAnatomyReceipt, AgentAvatarFacialDetailProfile, AgentAvatarFacialLandmarkReceipt, AgentAvatarFaceTopology, AgentAvatarHandSurfaceReceipt, AgentAvatarJointDeformationReceipt, AgentAvatarOrbitalGeometryReceipt, AgentAvatarOrbitalProfile } from './AgentAvatarMesh'; import type { GaitMode } from './gait'; import type { ClothSimulationConfig } from './AgentAvatarCloth'; import { type CharacterMicroMotionApplicationReceipt, type CharacterMicroMotionConfig, type CharacterMicroMotionSample } from './AgentAvatarMicroMotion'; import { type AgentAvatarGroomGeometryReceipt, type AgentAvatarOcularGeometryReceipt, type AgentAvatarOcularProfile } from './AgentAvatarHair'; import type { NativeMorphNormalPolicy, NativeMorphReceipt } from './AgentAvatarMorph'; import { type CharacterEnvironmentLightOptions, type CharacterEnvironmentLightReceipt } from './character-render'; import { type AgentAvatarGarmentGeometryReceipt } from './AgentAvatarGarment'; import { type SovereignMantleStyle } from './AgentAvatarMantleCatalog'; export interface CompTrait { name: string; config?: Record; } export interface CompObject { id?: string; name?: string; position?: { x?: number; y?: number; z?: number; }; template?: string; traits?: CompTrait[]; children?: CompObject[]; } export interface CompTemplate { name: string; traits?: CompTrait[]; } export interface ParsedComposition { name?: string; objects?: CompObject[]; templates?: CompTemplate[]; spatialGroups?: Array<{ objects?: CompObject[]; }>; } export interface CharacterHostFromCompositionOptions { /** Override the entity id (else: chosen object id → name → composition name → 'character'). */ entityId?: string; /** Pick a specific character node by id/name (else: first object with a body/skeleton trait). */ objectId?: string; /** Clamp bounds for derived scales (default 0.5..2.0). */ scaleBounds?: { min: number; max: number; }; /** Select one source-authored @lod level for the emitted native mesh (default 0). */ lodLevel?: number; } export interface CharacterLODTransitionReceipt { schemaVersion: 'holoscript.character-lod-transition.v1'; selectionMode: 'distance' | 'screen-size' | 'manual'; mode: 'instant' | 'crossfade' | 'dither'; durationSeconds: number; hysteresisBand: number; } export interface CharacterPoseReceipt { schemaVersion: 'holoscript.character-source-pose.v1'; name: string; space: 'local-bone'; quaternionOrder: 'xyzw'; boneCount: number; boneNames: readonly string[]; normalizedQuaternionCount: number; } export interface CharacterHostFromCompositionResult { ok: boolean; host?: CharacterHost; /** Gait descriptor for the caller's per-frame `host.applyLocomotion(mode, t, speed)`. */ gait?: { mode: GaitMode; speed: number; }; /** Packed 0xRRGGBB derived from @subsurface_scattering(color), if present. */ materialColor?: number; /** The operative authored LOD selection, when @lod is present. */ lod?: { level: number; distance: number; garmentSegments: number; hairGuides?: number; hairCardsPerGuide?: number; hairSegments?: number; /** Portrait-cranial-v3 longitude budget selected by this authored tier. */ faceRadialSegments?: number; /** Portrait-cranial-v3 latitude budget selected by this authored tier. */ faceVerticalSegments?: number; /** Source-authored switching semantics shared by every selected tier. */ transition?: CharacterLODTransitionReceipt; }; /** Operative deterministic cloth configuration, when @cloth_simulation is supported. */ cloth?: ClothSimulationConfig; /** Absolute-time presence channels and exact native blink/gaze/breath bindings. */ microMotion?: { config: CharacterMicroMotionConfig; sourceTimeSeconds: number; sample: CharacterMicroMotionSample; application: CharacterMicroMotionApplicationReceipt; bindings: { blink: 'native-procedural-head-morph'; gaze: 'native-ocular-globe-rotation'; breath: 'native-upper-chest-deformation'; cloth: 'sampled-channel-only'; }; }; /** Source-authored native facial topology selection. */ face?: { topology: AgentAvatarFaceTopology; radialSegments?: number; verticalSegments?: number; tearline?: boolean; orbitalProfile?: AgentAvatarOrbitalProfile; eyeRecess?: number; lidOpening?: number; canthalTilt?: number; facialDetailProfile?: AgentAvatarFacialDetailProfile; eyeScale?: number; eyeSpacing?: number; browHeight?: number; browThickness?: number; earScale?: number; mouthDepth?: number; noseBridgeWidth?: number; noseLength?: number; noseProjection?: number; mouthWidth?: number; upperLipFullness?: number; lowerLipFullness?: number; cheekboneScale?: number; chinProjection?: number; templeWidth?: number; facialPlaneStrength?: number; expressionNormalPolicy?: NativeMorphNormalPolicy; faceWidth?: number; faceLength?: number; jawTaper?: number; ocularProfile?: AgentAvatarOcularProfile; irisScale?: number; pupilScale?: number; irisColor?: number; scleraColor?: number; corneaIor?: number; }; /** Exact native face and upper-body proportions when source-authored controls are operative. */ anatomy?: AgentAvatarAnatomyReceipt; /** Exact native skin-surface response when a supported profile is source-authored. */ skin?: AgentAvatarSkinMaterialReceipt; /** Exact native civic facial landmark topology when source-authored. */ facialLandmarks?: AgentAvatarFacialLandmarkReceipt; /** Exact native orbital topology when a tearline/lid profile is source-authored. */ orbital?: AgentAvatarOrbitalGeometryReceipt; /** Exact native garment preset and topology when source-authored. */ garment?: AgentAvatarGarmentGeometryReceipt; /** Exact native ocular topology when a layered eye profile is source-authored. */ ocular?: AgentAvatarOcularGeometryReceipt; /** Derived native groom geometry evidence when hair is operative. */ groom?: AgentAvatarGroomGeometryReceipt; /** Native procedural-head deformation receipt, when supported @morph targets are authored. */ morph?: NativeMorphReceipt; /** First-class source expression receipt; shares the native FACS substrate with @morph. */ expression?: NativeMorphReceipt; /** Source-authored analytic environment and its exact renderer binding receipt. */ environmentLight?: { options: CharacterEnvironmentLightOptions; receipt: CharacterEnvironmentLightReceipt; }; /** Source-authored local-bone pose that was applied to the operative native host. */ pose?: CharacterPoseReceipt; /** Operative dual-influence deformation emitted by the selected native body profile. */ jointDeformation?: AgentAvatarJointDeformationReceipt; /** Operative V5 anatomical hand-surface topology emitted by the selected native body profile. */ handSurface?: AgentAvatarHandSurfaceReceipt; /** Detachable public/story mantle and source refs resolved by the host platform. */ mantle?: { style: SovereignMantleStyle; detachable: boolean; albedoMap?: string; normalMap?: string; roughnessMap?: string; }; report: { objectId?: string; resolvedVia: 'objectId' | 'body-trait-heuristic' | 'first-object' | 'none'; mapped: string[]; stubbed: Array<{ trait: string; reason: string; }>; warnings: string[]; }; } /** * Build a renderable CharacterHost from a parsed character composition. * The caller parses the source (e.g. `parseHolo(src).ast`) and passes it here. */ export declare function buildCharacterHostFromComposition(parsed: ParsedComposition, opts?: CharacterHostFromCompositionOptions): CharacterHostFromCompositionResult; //# sourceMappingURL=CharacterHostFromComposition.d.ts.map