@lovelace_lol/loom3 1.0.35 → 1.0.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -236,10 +236,12 @@ type PresetType = 'cc4' | 'skeletal' | 'fish' | 'custom';
236
236
  * This allows frontend to pass a string instead of importing the full preset.
237
237
  */
238
238
  declare function getPreset(presetType: PresetType | string | undefined): Profile;
239
+ declare const resolvePreset: typeof getPreset;
239
240
  /**
240
241
  * Get a preset, then extend it with an optional profile.
241
242
  */
242
243
  declare function getPresetWithProfile(presetType: PresetType | string | undefined, profile?: Partial<Profile>): Profile;
244
+ declare const resolvePresetWithOverrides: typeof getPresetWithProfile;
243
245
 
244
246
  /**
245
247
  * Loom3 - Core Type Definitions
@@ -317,6 +319,19 @@ type RotationsState = Record<string, CompositeRotationState>;
317
319
  type AnimationSource = 'baked' | 'clip' | 'snippet';
318
320
  /** Shared blend-mode surface for downstream animation UIs. */
319
321
  type AnimationBlendMode = 'replace' | 'additive';
322
+ /** Runtime channel classes derived from one authored baked source clip. */
323
+ type BakedClipChannel = 'face' | 'body' | 'scene';
324
+ /** Metadata describing one derived baked runtime channel. */
325
+ interface BakedClipChannelInfo {
326
+ /** Logical channel key surfaced to downstream UIs. */
327
+ channel: BakedClipChannel;
328
+ /** Number of tracks routed into this channel. */
329
+ trackCount: number;
330
+ /** Whether Loom3 can play this channel directly. */
331
+ playable: boolean;
332
+ /** Effective/default blend mode for this channel when playable. */
333
+ blendMode?: AnimationBlendMode;
334
+ }
320
335
  /** Shared easing labels for downstream animation UIs. */
321
336
  type AnimationEasing = 'linear' | 'easeInOut' | 'easeInOutCubic' | 'easeIn' | 'easeOut';
322
337
  /**
@@ -366,6 +381,8 @@ interface AnimationClipInfo {
366
381
  trackCount: number;
367
382
  /** Source of the clip for downstream UI grouping */
368
383
  source?: AnimationSource;
384
+ /** Derived channel metadata for partitioned baked clips. */
385
+ channels?: BakedClipChannelInfo[];
369
386
  }
370
387
  /**
371
388
  * State of a currently playing animation.
@@ -395,8 +412,12 @@ interface AnimationState {
395
412
  weight: number;
396
413
  /** Shared balance metadata for downstream UIs */
397
414
  balance: number;
415
+ /** Requested source-level blend mode before per-channel routing. */
416
+ requestedBlendMode: AnimationBlendMode;
398
417
  /** Shared blend metadata for downstream UIs */
399
418
  blendMode: AnimationBlendMode;
419
+ /** Derived channel metadata for partitioned baked clips. */
420
+ channels?: BakedClipChannelInfo[];
400
421
  /** Shared easing metadata for downstream UIs */
401
422
  easing: AnimationEasing;
402
423
  /** Whether the animation is looping */
@@ -433,6 +454,34 @@ interface AnimationActionHandle {
433
454
  /** Promise that resolves when animation completes (only for non-looping) */
434
455
  finished: Promise<void>;
435
456
  }
457
+ type ClipEvent = {
458
+ type: 'keyframe';
459
+ clipName: string;
460
+ keyframeIndex: number;
461
+ totalKeyframes: number;
462
+ currentTime: number;
463
+ duration: number;
464
+ iteration: number;
465
+ } | {
466
+ type: 'loop';
467
+ clipName: string;
468
+ iteration: number;
469
+ currentTime: number;
470
+ duration: number;
471
+ } | {
472
+ type: 'seek';
473
+ clipName: string;
474
+ currentTime: number;
475
+ duration: number;
476
+ iteration: number;
477
+ } | {
478
+ type: 'completed';
479
+ clipName: string;
480
+ currentTime: number;
481
+ duration: number;
482
+ iteration: number;
483
+ };
484
+ type ClipEventListener = (event: ClipEvent) => void;
436
485
  /**
437
486
  * A single keyframe point in an animation curve.
438
487
  */
@@ -532,6 +581,8 @@ interface ClipHandle {
532
581
  getTime: () => number;
533
582
  /** Get total clip duration in seconds */
534
583
  getDuration: () => number;
584
+ /** Subscribe to clip lifecycle events emitted by the runtime update loop */
585
+ subscribe?: (listener: ClipEventListener) => () => void;
535
586
  /** Promise that resolves when clip finishes (non-looping only) */
536
587
  finished: Promise<void>;
537
588
  }
@@ -2395,4 +2446,4 @@ declare function detectFacingDirection(model: THREE.Object3D, eyeBoneNames?: {
2395
2446
  right: string[];
2396
2447
  }): 'forward' | 'backward' | 'unknown';
2397
2448
 
2398
- export { type AUInfo, type AUSelector, AU_INFO, AU_MAPPING_CONFIG, AU_MIX_DEFAULTS, AU_TO_MORPHS, type AnalyzeModelOptions, type Animation, type AnimationActionHandle, type AnimationAnalysis, type AnimationBlendMode, type AnimationClipInfo, type AnimationEasing, type AnimationInfo, type AnimationPlayOptions, type AnimationSource, type AnimationState, AnimationThree, BETTA_FISH_PRESET, BLENDING_MODES, BONE_AU_TO_BINDINGS, type BlendingMode, type BoneBinding, type BoneInfo, type BoneKey, CC4_BONE_NODES, CC4_BONE_PREFIX, CC4_EYE_MESH_NODES, CC4_MESHES, CC4_PRESET, CC4_SUFFIX_PATTERN, COMPOSITE_ROTATIONS, CONTINUUM_LABELS, CONTINUUM_PAIRS_MAP, type CharacterConfig, type CharacterRegistry, type ClipHandle, type ClipOptions, type CompositeRotation, type CompositeRotationState, type CurvePoint, type CurvesMap, DEFAULT_HAIR_PHYSICS_CONFIG, type ExpandAnimation, type ExpandedRegionState, FISH_AU_MAPPING_CONFIG, type FaceCenterResult, type FallbackConfig, type FindFaceCenterOptions, type Hair, type HairMorphAxis, type HairMorphOutput$1 as HairMorphOutput, type HairMorphTargetMapping, type HairMorphTargetValueMapping, type HairMorphTargetsConfig, type HairObjectRef, type HairObjectState, HairPhysics, type HairPhysicsConfig$1 as HairPhysicsConfig, type HairPhysicsDirectionConfig, type HairPhysics$1 as HairPhysicsInterface, type HairMorphOutput as HairPhysicsMorphOutput, type HairPhysicsProfileConfig, type HairPhysicsRuntimeConfig, type HairPhysicsRuntimeConfigUpdate, type HairPhysicsState, type HairState, type HairStrand, type HeadState$1 as HeadState, type LineConfig, type LineCurve, type LineStyle, Loom3, type Loom3Config, Loom3 as Loom3Three, type LoomLarge, type LoomLargeConfig, Loom3 as LoomLargeThree, MORPH_TO_MESH, type MappingConsistencyResult, type MappingCorrection, type MappingCorrectionOptions, type MappingCorrectionResult, type MappingIssue, type MarkerGroup, type MarkerStyle, type MarkerStyleOverrides, type MeshCategory, type MeshInfo, type MeshMaterialSettings, type MixerLoopMode, type ModelAnalysisReport, type ModelData, type ModelMeshInfo, type MorphCategory, type MorphInfo, type MorphTargetRef, type MorphTargetsBySide, type NamedDirection, type PresetType, type Profile, type ReadyPayload, type Region, type RotationAxis, type RotationsState, type Snippet, type TrackInfo, type TransitionHandle, VISEME_JAW_AMOUNTS, VISEME_KEYS, type ValidateMappingOptions, type ValidationResult, analyzeModel, applyCharacterProfileToPreset, collectMorphMeshes, detectFacingDirection, extendCharacterConfigWithPreset, extendPresetWithProfile, extractFromGLTF, extractModelData, extractProfileOverrides, findFaceCenter, fuzzyNameMatch, generateMappingCorrections, getModelForwardDirection, getPreset, getPresetWithProfile, hasLeftRightMorphs, isMixedAU, isPresetCompatible, mergeRegionsByName as mergeCharacterRegionsByName, resolveBoneName, resolveBoneNames, resolveFaceCenter, suggestBestPreset, validateMappingConfig, validateMappings };
2449
+ export { type AUInfo, type AUSelector, AU_INFO, AU_MAPPING_CONFIG, AU_MIX_DEFAULTS, AU_TO_MORPHS, type AnalyzeModelOptions, type Animation, type AnimationActionHandle, type AnimationAnalysis, type AnimationBlendMode, type AnimationClipInfo, type AnimationEasing, type AnimationInfo, type AnimationPlayOptions, type AnimationSource, type AnimationState, AnimationThree, BETTA_FISH_PRESET, BLENDING_MODES, BONE_AU_TO_BINDINGS, type BlendingMode, type BoneBinding, type BoneInfo, type BoneKey, CC4_BONE_NODES, CC4_BONE_PREFIX, CC4_EYE_MESH_NODES, CC4_MESHES, CC4_PRESET, CC4_SUFFIX_PATTERN, COMPOSITE_ROTATIONS, CONTINUUM_LABELS, CONTINUUM_PAIRS_MAP, type CharacterConfig, type CharacterRegistry, type ClipEvent, type ClipEventListener, type ClipHandle, type ClipOptions, type CompositeRotation, type CompositeRotationState, type CurvePoint, type CurvesMap, DEFAULT_HAIR_PHYSICS_CONFIG, type ExpandAnimation, type ExpandedRegionState, FISH_AU_MAPPING_CONFIG, type FaceCenterResult, type FallbackConfig, type FindFaceCenterOptions, type Hair, type HairMorphAxis, type HairMorphOutput$1 as HairMorphOutput, type HairMorphTargetMapping, type HairMorphTargetValueMapping, type HairMorphTargetsConfig, type HairObjectRef, type HairObjectState, HairPhysics, type HairPhysicsConfig$1 as HairPhysicsConfig, type HairPhysicsDirectionConfig, type HairPhysics$1 as HairPhysicsInterface, type HairMorphOutput as HairPhysicsMorphOutput, type HairPhysicsProfileConfig, type HairPhysicsRuntimeConfig, type HairPhysicsRuntimeConfigUpdate, type HairPhysicsState, type HairState, type HairStrand, type HeadState$1 as HeadState, type LineConfig, type LineCurve, type LineStyle, Loom3, type Loom3Config, Loom3 as Loom3Three, type LoomLarge, type LoomLargeConfig, Loom3 as LoomLargeThree, MORPH_TO_MESH, type MappingConsistencyResult, type MappingCorrection, type MappingCorrectionOptions, type MappingCorrectionResult, type MappingIssue, type MarkerGroup, type MarkerStyle, type MarkerStyleOverrides, type MeshCategory, type MeshInfo, type MeshMaterialSettings, type MixerLoopMode, type ModelAnalysisReport, type ModelData, type ModelMeshInfo, type MorphCategory, type MorphInfo, type MorphTargetRef, type MorphTargetsBySide, type NamedDirection, type PresetType, type Profile, type ReadyPayload, type Region, type RotationAxis, type RotationsState, type Snippet, type TrackInfo, type TransitionHandle, VISEME_JAW_AMOUNTS, VISEME_KEYS, type ValidateMappingOptions, type ValidationResult, analyzeModel, applyCharacterProfileToPreset, collectMorphMeshes, detectFacingDirection, extendCharacterConfigWithPreset, extendPresetWithProfile, extractFromGLTF, extractModelData, extractProfileOverrides, findFaceCenter, fuzzyNameMatch, generateMappingCorrections, getModelForwardDirection, getPreset, getPresetWithProfile, hasLeftRightMorphs, isMixedAU, isPresetCompatible, mergeRegionsByName as mergeCharacterRegionsByName, resolveBoneName, resolveBoneNames, resolveFaceCenter, resolvePreset, resolvePresetWithOverrides, suggestBestPreset, validateMappingConfig, validateMappings };
package/dist/index.d.ts CHANGED
@@ -236,10 +236,12 @@ type PresetType = 'cc4' | 'skeletal' | 'fish' | 'custom';
236
236
  * This allows frontend to pass a string instead of importing the full preset.
237
237
  */
238
238
  declare function getPreset(presetType: PresetType | string | undefined): Profile;
239
+ declare const resolvePreset: typeof getPreset;
239
240
  /**
240
241
  * Get a preset, then extend it with an optional profile.
241
242
  */
242
243
  declare function getPresetWithProfile(presetType: PresetType | string | undefined, profile?: Partial<Profile>): Profile;
244
+ declare const resolvePresetWithOverrides: typeof getPresetWithProfile;
243
245
 
244
246
  /**
245
247
  * Loom3 - Core Type Definitions
@@ -317,6 +319,19 @@ type RotationsState = Record<string, CompositeRotationState>;
317
319
  type AnimationSource = 'baked' | 'clip' | 'snippet';
318
320
  /** Shared blend-mode surface for downstream animation UIs. */
319
321
  type AnimationBlendMode = 'replace' | 'additive';
322
+ /** Runtime channel classes derived from one authored baked source clip. */
323
+ type BakedClipChannel = 'face' | 'body' | 'scene';
324
+ /** Metadata describing one derived baked runtime channel. */
325
+ interface BakedClipChannelInfo {
326
+ /** Logical channel key surfaced to downstream UIs. */
327
+ channel: BakedClipChannel;
328
+ /** Number of tracks routed into this channel. */
329
+ trackCount: number;
330
+ /** Whether Loom3 can play this channel directly. */
331
+ playable: boolean;
332
+ /** Effective/default blend mode for this channel when playable. */
333
+ blendMode?: AnimationBlendMode;
334
+ }
320
335
  /** Shared easing labels for downstream animation UIs. */
321
336
  type AnimationEasing = 'linear' | 'easeInOut' | 'easeInOutCubic' | 'easeIn' | 'easeOut';
322
337
  /**
@@ -366,6 +381,8 @@ interface AnimationClipInfo {
366
381
  trackCount: number;
367
382
  /** Source of the clip for downstream UI grouping */
368
383
  source?: AnimationSource;
384
+ /** Derived channel metadata for partitioned baked clips. */
385
+ channels?: BakedClipChannelInfo[];
369
386
  }
370
387
  /**
371
388
  * State of a currently playing animation.
@@ -395,8 +412,12 @@ interface AnimationState {
395
412
  weight: number;
396
413
  /** Shared balance metadata for downstream UIs */
397
414
  balance: number;
415
+ /** Requested source-level blend mode before per-channel routing. */
416
+ requestedBlendMode: AnimationBlendMode;
398
417
  /** Shared blend metadata for downstream UIs */
399
418
  blendMode: AnimationBlendMode;
419
+ /** Derived channel metadata for partitioned baked clips. */
420
+ channels?: BakedClipChannelInfo[];
400
421
  /** Shared easing metadata for downstream UIs */
401
422
  easing: AnimationEasing;
402
423
  /** Whether the animation is looping */
@@ -433,6 +454,34 @@ interface AnimationActionHandle {
433
454
  /** Promise that resolves when animation completes (only for non-looping) */
434
455
  finished: Promise<void>;
435
456
  }
457
+ type ClipEvent = {
458
+ type: 'keyframe';
459
+ clipName: string;
460
+ keyframeIndex: number;
461
+ totalKeyframes: number;
462
+ currentTime: number;
463
+ duration: number;
464
+ iteration: number;
465
+ } | {
466
+ type: 'loop';
467
+ clipName: string;
468
+ iteration: number;
469
+ currentTime: number;
470
+ duration: number;
471
+ } | {
472
+ type: 'seek';
473
+ clipName: string;
474
+ currentTime: number;
475
+ duration: number;
476
+ iteration: number;
477
+ } | {
478
+ type: 'completed';
479
+ clipName: string;
480
+ currentTime: number;
481
+ duration: number;
482
+ iteration: number;
483
+ };
484
+ type ClipEventListener = (event: ClipEvent) => void;
436
485
  /**
437
486
  * A single keyframe point in an animation curve.
438
487
  */
@@ -532,6 +581,8 @@ interface ClipHandle {
532
581
  getTime: () => number;
533
582
  /** Get total clip duration in seconds */
534
583
  getDuration: () => number;
584
+ /** Subscribe to clip lifecycle events emitted by the runtime update loop */
585
+ subscribe?: (listener: ClipEventListener) => () => void;
535
586
  /** Promise that resolves when clip finishes (non-looping only) */
536
587
  finished: Promise<void>;
537
588
  }
@@ -2395,4 +2446,4 @@ declare function detectFacingDirection(model: THREE.Object3D, eyeBoneNames?: {
2395
2446
  right: string[];
2396
2447
  }): 'forward' | 'backward' | 'unknown';
2397
2448
 
2398
- export { type AUInfo, type AUSelector, AU_INFO, AU_MAPPING_CONFIG, AU_MIX_DEFAULTS, AU_TO_MORPHS, type AnalyzeModelOptions, type Animation, type AnimationActionHandle, type AnimationAnalysis, type AnimationBlendMode, type AnimationClipInfo, type AnimationEasing, type AnimationInfo, type AnimationPlayOptions, type AnimationSource, type AnimationState, AnimationThree, BETTA_FISH_PRESET, BLENDING_MODES, BONE_AU_TO_BINDINGS, type BlendingMode, type BoneBinding, type BoneInfo, type BoneKey, CC4_BONE_NODES, CC4_BONE_PREFIX, CC4_EYE_MESH_NODES, CC4_MESHES, CC4_PRESET, CC4_SUFFIX_PATTERN, COMPOSITE_ROTATIONS, CONTINUUM_LABELS, CONTINUUM_PAIRS_MAP, type CharacterConfig, type CharacterRegistry, type ClipHandle, type ClipOptions, type CompositeRotation, type CompositeRotationState, type CurvePoint, type CurvesMap, DEFAULT_HAIR_PHYSICS_CONFIG, type ExpandAnimation, type ExpandedRegionState, FISH_AU_MAPPING_CONFIG, type FaceCenterResult, type FallbackConfig, type FindFaceCenterOptions, type Hair, type HairMorphAxis, type HairMorphOutput$1 as HairMorphOutput, type HairMorphTargetMapping, type HairMorphTargetValueMapping, type HairMorphTargetsConfig, type HairObjectRef, type HairObjectState, HairPhysics, type HairPhysicsConfig$1 as HairPhysicsConfig, type HairPhysicsDirectionConfig, type HairPhysics$1 as HairPhysicsInterface, type HairMorphOutput as HairPhysicsMorphOutput, type HairPhysicsProfileConfig, type HairPhysicsRuntimeConfig, type HairPhysicsRuntimeConfigUpdate, type HairPhysicsState, type HairState, type HairStrand, type HeadState$1 as HeadState, type LineConfig, type LineCurve, type LineStyle, Loom3, type Loom3Config, Loom3 as Loom3Three, type LoomLarge, type LoomLargeConfig, Loom3 as LoomLargeThree, MORPH_TO_MESH, type MappingConsistencyResult, type MappingCorrection, type MappingCorrectionOptions, type MappingCorrectionResult, type MappingIssue, type MarkerGroup, type MarkerStyle, type MarkerStyleOverrides, type MeshCategory, type MeshInfo, type MeshMaterialSettings, type MixerLoopMode, type ModelAnalysisReport, type ModelData, type ModelMeshInfo, type MorphCategory, type MorphInfo, type MorphTargetRef, type MorphTargetsBySide, type NamedDirection, type PresetType, type Profile, type ReadyPayload, type Region, type RotationAxis, type RotationsState, type Snippet, type TrackInfo, type TransitionHandle, VISEME_JAW_AMOUNTS, VISEME_KEYS, type ValidateMappingOptions, type ValidationResult, analyzeModel, applyCharacterProfileToPreset, collectMorphMeshes, detectFacingDirection, extendCharacterConfigWithPreset, extendPresetWithProfile, extractFromGLTF, extractModelData, extractProfileOverrides, findFaceCenter, fuzzyNameMatch, generateMappingCorrections, getModelForwardDirection, getPreset, getPresetWithProfile, hasLeftRightMorphs, isMixedAU, isPresetCompatible, mergeRegionsByName as mergeCharacterRegionsByName, resolveBoneName, resolveBoneNames, resolveFaceCenter, suggestBestPreset, validateMappingConfig, validateMappings };
2449
+ export { type AUInfo, type AUSelector, AU_INFO, AU_MAPPING_CONFIG, AU_MIX_DEFAULTS, AU_TO_MORPHS, type AnalyzeModelOptions, type Animation, type AnimationActionHandle, type AnimationAnalysis, type AnimationBlendMode, type AnimationClipInfo, type AnimationEasing, type AnimationInfo, type AnimationPlayOptions, type AnimationSource, type AnimationState, AnimationThree, BETTA_FISH_PRESET, BLENDING_MODES, BONE_AU_TO_BINDINGS, type BlendingMode, type BoneBinding, type BoneInfo, type BoneKey, CC4_BONE_NODES, CC4_BONE_PREFIX, CC4_EYE_MESH_NODES, CC4_MESHES, CC4_PRESET, CC4_SUFFIX_PATTERN, COMPOSITE_ROTATIONS, CONTINUUM_LABELS, CONTINUUM_PAIRS_MAP, type CharacterConfig, type CharacterRegistry, type ClipEvent, type ClipEventListener, type ClipHandle, type ClipOptions, type CompositeRotation, type CompositeRotationState, type CurvePoint, type CurvesMap, DEFAULT_HAIR_PHYSICS_CONFIG, type ExpandAnimation, type ExpandedRegionState, FISH_AU_MAPPING_CONFIG, type FaceCenterResult, type FallbackConfig, type FindFaceCenterOptions, type Hair, type HairMorphAxis, type HairMorphOutput$1 as HairMorphOutput, type HairMorphTargetMapping, type HairMorphTargetValueMapping, type HairMorphTargetsConfig, type HairObjectRef, type HairObjectState, HairPhysics, type HairPhysicsConfig$1 as HairPhysicsConfig, type HairPhysicsDirectionConfig, type HairPhysics$1 as HairPhysicsInterface, type HairMorphOutput as HairPhysicsMorphOutput, type HairPhysicsProfileConfig, type HairPhysicsRuntimeConfig, type HairPhysicsRuntimeConfigUpdate, type HairPhysicsState, type HairState, type HairStrand, type HeadState$1 as HeadState, type LineConfig, type LineCurve, type LineStyle, Loom3, type Loom3Config, Loom3 as Loom3Three, type LoomLarge, type LoomLargeConfig, Loom3 as LoomLargeThree, MORPH_TO_MESH, type MappingConsistencyResult, type MappingCorrection, type MappingCorrectionOptions, type MappingCorrectionResult, type MappingIssue, type MarkerGroup, type MarkerStyle, type MarkerStyleOverrides, type MeshCategory, type MeshInfo, type MeshMaterialSettings, type MixerLoopMode, type ModelAnalysisReport, type ModelData, type ModelMeshInfo, type MorphCategory, type MorphInfo, type MorphTargetRef, type MorphTargetsBySide, type NamedDirection, type PresetType, type Profile, type ReadyPayload, type Region, type RotationAxis, type RotationsState, type Snippet, type TrackInfo, type TransitionHandle, VISEME_JAW_AMOUNTS, VISEME_KEYS, type ValidateMappingOptions, type ValidationResult, analyzeModel, applyCharacterProfileToPreset, collectMorphMeshes, detectFacingDirection, extendCharacterConfigWithPreset, extendPresetWithProfile, extractFromGLTF, extractModelData, extractProfileOverrides, findFaceCenter, fuzzyNameMatch, generateMappingCorrections, getModelForwardDirection, getPreset, getPresetWithProfile, hasLeftRightMorphs, isMixedAU, isPresetCompatible, mergeRegionsByName as mergeCharacterRegionsByName, resolveBoneName, resolveBoneNames, resolveFaceCenter, resolvePreset, resolvePresetWithOverrides, suggestBestPreset, validateMappingConfig, validateMappings };