@lovelace_lol/loom3 1.0.41 → 1.0.43
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.cjs +819 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +122 -1
- package/dist/index.d.ts +122 -1
- package/dist/index.js +809 -86
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -19,6 +19,8 @@ declare const VISEME_KEYS: string[];
|
|
|
19
19
|
* Used by snippetToClip when autoVisemeJaw is enabled.
|
|
20
20
|
*/
|
|
21
21
|
declare const VISEME_JAW_AMOUNTS: number[];
|
|
22
|
+
declare const CC4_VISEME_SYSTEM_ID = "cc4-arkit-15";
|
|
23
|
+
declare const CC4_VISEME_SLOTS: VisemeSlot[];
|
|
22
24
|
/** Check if an AU has both morphs and bones (can blend between them) */
|
|
23
25
|
declare const isMixedAU: (id: number) => boolean;
|
|
24
26
|
/** Check if an AU has separate left/right morphs */
|
|
@@ -83,6 +85,7 @@ declare const AU_MIX_DEFAULTS: Record<number, number>;
|
|
|
83
85
|
declare const CC4_MESHES: Record<string, MeshInfo>;
|
|
84
86
|
/** Which mesh each morph category applies to */
|
|
85
87
|
declare const MORPH_TO_MESH: Record<MorphCategory, string[]>;
|
|
88
|
+
declare const CC4_MAPPING_SECTIONS: MappingEditorSection[];
|
|
86
89
|
declare const CC4_PRESET: Profile;
|
|
87
90
|
|
|
88
91
|
/**
|
|
@@ -115,7 +118,11 @@ declare const BETTA_FISH_PRESET: {
|
|
|
115
118
|
rightMorphSuffixes?: string[];
|
|
116
119
|
morphToMesh: Record<string, string[]>;
|
|
117
120
|
auFacePartToMeshCategory?: Record<string, string>;
|
|
121
|
+
mappingSections?: MappingEditorSection[];
|
|
118
122
|
visemeKeys: MorphTargetRef[];
|
|
123
|
+
visemeSystemId?: string;
|
|
124
|
+
visemeSlots?: VisemeSlot[];
|
|
125
|
+
visemeBindings?: Record<string, VisemeBinding>;
|
|
119
126
|
visemeMeshCategory?: string;
|
|
120
127
|
visemeJawAmounts?: number[];
|
|
121
128
|
auMixDefaults?: Record<number, number>;
|
|
@@ -156,7 +163,11 @@ declare const AU_MAPPING_CONFIG: {
|
|
|
156
163
|
rightMorphSuffixes?: string[];
|
|
157
164
|
morphToMesh: Record<string, string[]>;
|
|
158
165
|
auFacePartToMeshCategory?: Record<string, string>;
|
|
166
|
+
mappingSections?: MappingEditorSection[];
|
|
159
167
|
visemeKeys: MorphTargetRef[];
|
|
168
|
+
visemeSystemId?: string;
|
|
169
|
+
visemeSlots?: VisemeSlot[];
|
|
170
|
+
visemeBindings?: Record<string, VisemeBinding>;
|
|
160
171
|
visemeMeshCategory?: string;
|
|
161
172
|
visemeJawAmounts?: number[];
|
|
162
173
|
auMixDefaults?: Record<number, number>;
|
|
@@ -197,7 +208,11 @@ declare const FISH_AU_MAPPING_CONFIG: {
|
|
|
197
208
|
rightMorphSuffixes?: string[];
|
|
198
209
|
morphToMesh: Record<string, string[]>;
|
|
199
210
|
auFacePartToMeshCategory?: Record<string, string>;
|
|
211
|
+
mappingSections?: MappingEditorSection[];
|
|
200
212
|
visemeKeys: MorphTargetRef[];
|
|
213
|
+
visemeSystemId?: string;
|
|
214
|
+
visemeSlots?: VisemeSlot[];
|
|
215
|
+
visemeBindings?: Record<string, VisemeBinding>;
|
|
201
216
|
visemeMeshCategory?: string;
|
|
202
217
|
visemeJawAmounts?: number[];
|
|
203
218
|
auMixDefaults?: Record<number, number>;
|
|
@@ -705,8 +720,16 @@ interface Profile {
|
|
|
705
720
|
* Example: { Eye: 'eye', Eyes: 'eye', Eyelids: 'eye', Tongue: 'tongue' }.
|
|
706
721
|
*/
|
|
707
722
|
auFacePartToMeshCategory?: Record<string, string>;
|
|
723
|
+
/** Optional ordered mapping sections for authoring UIs. Presets own this metadata, not consumers. */
|
|
724
|
+
mappingSections?: MappingEditorSection[];
|
|
708
725
|
/** Viseme targets in order (typically 15 phoneme positions) */
|
|
709
726
|
visemeKeys: MorphTargetRef[];
|
|
727
|
+
/** Optional id of the profile-defined viseme system (for example, 'cc4-arkit-15'). */
|
|
728
|
+
visemeSystemId?: string;
|
|
729
|
+
/** Optional profile-defined viseme slots used by editors and id-based runtime APIs. */
|
|
730
|
+
visemeSlots?: VisemeSlot[];
|
|
731
|
+
/** Optional authoring bindings keyed by viseme slot id. */
|
|
732
|
+
visemeBindings?: Record<string, VisemeBinding>;
|
|
710
733
|
/**
|
|
711
734
|
* Optional `morphToMesh` category to use for viseme morph routing.
|
|
712
735
|
* Falls back to `morphToMesh.viseme` (if present), then `morphToMesh.face`.
|
|
@@ -865,6 +888,72 @@ type MorphTargetIndex = number;
|
|
|
865
888
|
* Morph target reference (key or index).
|
|
866
889
|
*/
|
|
867
890
|
type MorphTargetRef = MorphTargetKey | MorphTargetIndex;
|
|
891
|
+
interface VisemeSlotFeatures {
|
|
892
|
+
jawOpen?: number;
|
|
893
|
+
lipClosed?: number;
|
|
894
|
+
lipRound?: number;
|
|
895
|
+
lipSpread?: number;
|
|
896
|
+
tongueTip?: number;
|
|
897
|
+
fricative?: number;
|
|
898
|
+
nasal?: number;
|
|
899
|
+
}
|
|
900
|
+
interface VisemeSlot {
|
|
901
|
+
/** Stable profile/runtime id, such as 'aa', 'bmp', or 'rest'. */
|
|
902
|
+
id: string;
|
|
903
|
+
/** Human-readable editor label. */
|
|
904
|
+
label: string;
|
|
905
|
+
/** Optional display/runtime order. Lower values render first. */
|
|
906
|
+
order?: number;
|
|
907
|
+
/** Provider-specific viseme ids that should map to this slot. */
|
|
908
|
+
providerIds?: Record<string, Array<string | number>>;
|
|
909
|
+
/** Phoneme hints that can map provider phonemes to this slot. */
|
|
910
|
+
phonemes?: string[];
|
|
911
|
+
/** Regex strings used to classify likely morph candidates for this slot. */
|
|
912
|
+
matchers?: string[];
|
|
913
|
+
/** Semantic hints for approximate provider or UI matching. */
|
|
914
|
+
features?: VisemeSlotFeatures;
|
|
915
|
+
/** Optional default jaw amount for this slot. */
|
|
916
|
+
defaultJawAmount?: number;
|
|
917
|
+
}
|
|
918
|
+
interface VisemeBindingTarget {
|
|
919
|
+
morph: MorphTargetRef;
|
|
920
|
+
weight?: number;
|
|
921
|
+
}
|
|
922
|
+
interface VisemeBinding {
|
|
923
|
+
targets?: VisemeBindingTarget[];
|
|
924
|
+
/** Legacy/simplified single-target binding used by existing LoomLarge profiles. */
|
|
925
|
+
morph?: MorphTargetRef;
|
|
926
|
+
jawAmount?: number;
|
|
927
|
+
note?: string;
|
|
928
|
+
sharedWith?: string[];
|
|
929
|
+
}
|
|
930
|
+
type MappingSectionKind = 'au' | 'viseme' | 'hair' | 'unmapped' | 'custom';
|
|
931
|
+
interface MappingEditorSection {
|
|
932
|
+
id: string;
|
|
933
|
+
label: string;
|
|
934
|
+
kind: MappingSectionKind;
|
|
935
|
+
order: number;
|
|
936
|
+
meshCategory?: string;
|
|
937
|
+
facePart?: string;
|
|
938
|
+
}
|
|
939
|
+
type MorphCandidateReason = 'explicit' | 'regex' | 'alias' | 'phoneme' | 'provider' | 'unmapped';
|
|
940
|
+
interface MorphCandidateMatch {
|
|
941
|
+
slotId: string;
|
|
942
|
+
label: string;
|
|
943
|
+
confidence: number;
|
|
944
|
+
reason: MorphCandidateReason;
|
|
945
|
+
pattern?: string;
|
|
946
|
+
}
|
|
947
|
+
interface MorphCandidate {
|
|
948
|
+
morph: string;
|
|
949
|
+
sectionId: string;
|
|
950
|
+
kind: 'explicit' | 'candidate' | 'conflict' | 'unmapped';
|
|
951
|
+
matches: MorphCandidateMatch[];
|
|
952
|
+
}
|
|
953
|
+
interface MappingEditorModel {
|
|
954
|
+
sections: MappingEditorSection[];
|
|
955
|
+
candidates: MorphCandidate[];
|
|
956
|
+
}
|
|
868
957
|
interface MorphTargetsBySide {
|
|
869
958
|
left: MorphTargetRef[];
|
|
870
959
|
right: MorphTargetRef[];
|
|
@@ -1015,6 +1104,14 @@ interface Animation {
|
|
|
1015
1104
|
* Transition viseme value smoothly
|
|
1016
1105
|
*/
|
|
1017
1106
|
transitionViseme(visemeIndex: number, to: number, durationMs?: number, jawScale?: number): TransitionHandle;
|
|
1107
|
+
/**
|
|
1108
|
+
* Set viseme value by profile-defined slot id.
|
|
1109
|
+
*/
|
|
1110
|
+
setVisemeById?(slotId: string, value: number, jawScale?: number): void;
|
|
1111
|
+
/**
|
|
1112
|
+
* Transition viseme value smoothly by profile-defined slot id.
|
|
1113
|
+
*/
|
|
1114
|
+
transitionVisemeById?(slotId: string, to: number, durationMs?: number, jawScale?: number): TransitionHandle;
|
|
1018
1115
|
/**
|
|
1019
1116
|
* Set mix weight for an AU (blend between morph and bone contribution)
|
|
1020
1117
|
*/
|
|
@@ -1542,6 +1639,8 @@ declare class Loom3 implements LoomLarge {
|
|
|
1542
1639
|
transitionMorphInfluence(index: number, to: number, durationMs?: number, meshNames?: string[]): TransitionHandle;
|
|
1543
1640
|
setViseme(visemeIndex: number, value: number, jawScale?: number): void;
|
|
1544
1641
|
transitionViseme(visemeIndex: number, to: number, durationMs?: number, jawScale?: number): TransitionHandle;
|
|
1642
|
+
setVisemeById(slotId: string, value: number, jawScale?: number): void;
|
|
1643
|
+
transitionVisemeById(slotId: string, to: number, durationMs?: number, jawScale?: number): TransitionHandle;
|
|
1545
1644
|
setAUMixWeight(id: number, weight: number): void;
|
|
1546
1645
|
getAUMixWeight(id: number): number;
|
|
1547
1646
|
/**
|
|
@@ -1556,6 +1655,7 @@ declare class Loom3 implements LoomLarge {
|
|
|
1556
1655
|
getActiveTransitionCount(): number;
|
|
1557
1656
|
resetToNeutral(): void;
|
|
1558
1657
|
private reinitializeRuntimeStateFromCurrentControls;
|
|
1658
|
+
private reapplyProceduralStateAfterBakedUpdate;
|
|
1559
1659
|
getMeshList(): MeshInfo[];
|
|
1560
1660
|
/** Get all morph targets grouped by mesh name */
|
|
1561
1661
|
getMorphTargets(): Record<string, string[]>;
|
|
@@ -1863,6 +1963,27 @@ interface HairPhysics$1 {
|
|
|
1863
1963
|
reset(): void;
|
|
1864
1964
|
}
|
|
1865
1965
|
|
|
1966
|
+
declare function getProfileVisemeSlots(profile: Profile): VisemeSlot[];
|
|
1967
|
+
declare function getVisemeSlotIndex(profile: Profile, slotId: string): number;
|
|
1968
|
+
declare function compileVisemeKeys(profile: Profile): MorphTargetRef[];
|
|
1969
|
+
declare function getVisemeJawAmounts(profile: Profile): number[] | undefined;
|
|
1970
|
+
declare function resolveVisemeMeshCategory(profile: Profile): string;
|
|
1971
|
+
declare function getMeshNamesForVisemeProfile(profile: Profile): string[];
|
|
1972
|
+
declare function getMeshNamesForAUProfile(profile: Profile, auId: number): string[];
|
|
1973
|
+
declare function buildMappingEditorModel(profile: Profile, morphNames?: string[]): MappingEditorModel;
|
|
1974
|
+
interface ProviderVisemeEvent {
|
|
1975
|
+
provider: string;
|
|
1976
|
+
id?: string | number;
|
|
1977
|
+
phoneme?: string;
|
|
1978
|
+
}
|
|
1979
|
+
interface ProviderVisemeMatch {
|
|
1980
|
+
slotId: string;
|
|
1981
|
+
index: number;
|
|
1982
|
+
confidence: number;
|
|
1983
|
+
reason: 'provider' | 'phoneme' | 'rest' | 'none';
|
|
1984
|
+
}
|
|
1985
|
+
declare function mapProviderVisemeToSlot(profile: Profile, event: ProviderVisemeEvent): ProviderVisemeMatch | null;
|
|
1986
|
+
|
|
1866
1987
|
/** Line stroke style */
|
|
1867
1988
|
type LineStyle = 'solid' | 'dashed' | 'dotted';
|
|
1868
1989
|
/** Line curve type */
|
|
@@ -2517,4 +2638,4 @@ declare function detectFacingDirection(model: THREE.Object3D, eyeBoneNames?: {
|
|
|
2517
2638
|
right: string[];
|
|
2518
2639
|
}): 'forward' | 'backward' | 'unknown';
|
|
2519
2640
|
|
|
2520
|
-
export { type AUInfo, type AUSelector, AU_INFO, AU_MAPPING_CONFIG, AU_MIX_DEFAULTS, AU_TO_MORPHS, type AddMorphTargetOptions, 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 CameraRelativeGazeOffset, type CameraRelativeGazeOptions, 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 MorphTargetAttributeData, type MorphTargetDelta, 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, computeCameraRelativeGazeOffset, 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 };
|
|
2641
|
+
export { type AUInfo, type AUSelector, AU_INFO, AU_MAPPING_CONFIG, AU_MIX_DEFAULTS, AU_TO_MORPHS, type AddMorphTargetOptions, 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_MAPPING_SECTIONS, CC4_MESHES, CC4_PRESET, CC4_SUFFIX_PATTERN, CC4_VISEME_SLOTS, CC4_VISEME_SYSTEM_ID, COMPOSITE_ROTATIONS, CONTINUUM_LABELS, CONTINUUM_PAIRS_MAP, type CameraRelativeGazeOffset, type CameraRelativeGazeOptions, 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 MappingEditorModel, type MappingEditorSection, type MappingIssue, type MarkerGroup, type MarkerStyle, type MarkerStyleOverrides, type MeshCategory, type MeshInfo, type MeshMaterialSettings, type MixerLoopMode, type ModelAnalysisReport, type ModelData, type ModelMeshInfo, type MorphCandidate, type MorphCandidateMatch, type MorphCandidateReason, type MorphCategory, type MorphInfo, type MorphTargetAttributeData, type MorphTargetDelta, type MorphTargetRef, type MorphTargetsBySide, type NamedDirection, type PresetType, type Profile, type ProviderVisemeEvent, type ProviderVisemeMatch, type ReadyPayload, type Region, type RotationAxis, type RotationsState, type Snippet, type TrackInfo, type TransitionHandle, VISEME_JAW_AMOUNTS, VISEME_KEYS, type ValidateMappingOptions, type ValidationResult, type VisemeBinding, type VisemeBindingTarget, type VisemeSlot, type VisemeSlotFeatures, analyzeModel, applyCharacterProfileToPreset, buildMappingEditorModel, collectMorphMeshes, compileVisemeKeys, computeCameraRelativeGazeOffset, detectFacingDirection, extendCharacterConfigWithPreset, extendPresetWithProfile, extractFromGLTF, extractModelData, extractProfileOverrides, findFaceCenter, fuzzyNameMatch, generateMappingCorrections, getMeshNamesForAUProfile, getMeshNamesForVisemeProfile, getModelForwardDirection, getPreset, getPresetWithProfile, getProfileVisemeSlots, getVisemeJawAmounts, getVisemeSlotIndex, hasLeftRightMorphs, isMixedAU, isPresetCompatible, mapProviderVisemeToSlot, mergeRegionsByName as mergeCharacterRegionsByName, resolveBoneName, resolveBoneNames, resolveFaceCenter, resolvePreset, resolvePresetWithOverrides, resolveVisemeMeshCategory, suggestBestPreset, validateMappingConfig, validateMappings };
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,8 @@ declare const VISEME_KEYS: string[];
|
|
|
19
19
|
* Used by snippetToClip when autoVisemeJaw is enabled.
|
|
20
20
|
*/
|
|
21
21
|
declare const VISEME_JAW_AMOUNTS: number[];
|
|
22
|
+
declare const CC4_VISEME_SYSTEM_ID = "cc4-arkit-15";
|
|
23
|
+
declare const CC4_VISEME_SLOTS: VisemeSlot[];
|
|
22
24
|
/** Check if an AU has both morphs and bones (can blend between them) */
|
|
23
25
|
declare const isMixedAU: (id: number) => boolean;
|
|
24
26
|
/** Check if an AU has separate left/right morphs */
|
|
@@ -83,6 +85,7 @@ declare const AU_MIX_DEFAULTS: Record<number, number>;
|
|
|
83
85
|
declare const CC4_MESHES: Record<string, MeshInfo>;
|
|
84
86
|
/** Which mesh each morph category applies to */
|
|
85
87
|
declare const MORPH_TO_MESH: Record<MorphCategory, string[]>;
|
|
88
|
+
declare const CC4_MAPPING_SECTIONS: MappingEditorSection[];
|
|
86
89
|
declare const CC4_PRESET: Profile;
|
|
87
90
|
|
|
88
91
|
/**
|
|
@@ -115,7 +118,11 @@ declare const BETTA_FISH_PRESET: {
|
|
|
115
118
|
rightMorphSuffixes?: string[];
|
|
116
119
|
morphToMesh: Record<string, string[]>;
|
|
117
120
|
auFacePartToMeshCategory?: Record<string, string>;
|
|
121
|
+
mappingSections?: MappingEditorSection[];
|
|
118
122
|
visemeKeys: MorphTargetRef[];
|
|
123
|
+
visemeSystemId?: string;
|
|
124
|
+
visemeSlots?: VisemeSlot[];
|
|
125
|
+
visemeBindings?: Record<string, VisemeBinding>;
|
|
119
126
|
visemeMeshCategory?: string;
|
|
120
127
|
visemeJawAmounts?: number[];
|
|
121
128
|
auMixDefaults?: Record<number, number>;
|
|
@@ -156,7 +163,11 @@ declare const AU_MAPPING_CONFIG: {
|
|
|
156
163
|
rightMorphSuffixes?: string[];
|
|
157
164
|
morphToMesh: Record<string, string[]>;
|
|
158
165
|
auFacePartToMeshCategory?: Record<string, string>;
|
|
166
|
+
mappingSections?: MappingEditorSection[];
|
|
159
167
|
visemeKeys: MorphTargetRef[];
|
|
168
|
+
visemeSystemId?: string;
|
|
169
|
+
visemeSlots?: VisemeSlot[];
|
|
170
|
+
visemeBindings?: Record<string, VisemeBinding>;
|
|
160
171
|
visemeMeshCategory?: string;
|
|
161
172
|
visemeJawAmounts?: number[];
|
|
162
173
|
auMixDefaults?: Record<number, number>;
|
|
@@ -197,7 +208,11 @@ declare const FISH_AU_MAPPING_CONFIG: {
|
|
|
197
208
|
rightMorphSuffixes?: string[];
|
|
198
209
|
morphToMesh: Record<string, string[]>;
|
|
199
210
|
auFacePartToMeshCategory?: Record<string, string>;
|
|
211
|
+
mappingSections?: MappingEditorSection[];
|
|
200
212
|
visemeKeys: MorphTargetRef[];
|
|
213
|
+
visemeSystemId?: string;
|
|
214
|
+
visemeSlots?: VisemeSlot[];
|
|
215
|
+
visemeBindings?: Record<string, VisemeBinding>;
|
|
201
216
|
visemeMeshCategory?: string;
|
|
202
217
|
visemeJawAmounts?: number[];
|
|
203
218
|
auMixDefaults?: Record<number, number>;
|
|
@@ -705,8 +720,16 @@ interface Profile {
|
|
|
705
720
|
* Example: { Eye: 'eye', Eyes: 'eye', Eyelids: 'eye', Tongue: 'tongue' }.
|
|
706
721
|
*/
|
|
707
722
|
auFacePartToMeshCategory?: Record<string, string>;
|
|
723
|
+
/** Optional ordered mapping sections for authoring UIs. Presets own this metadata, not consumers. */
|
|
724
|
+
mappingSections?: MappingEditorSection[];
|
|
708
725
|
/** Viseme targets in order (typically 15 phoneme positions) */
|
|
709
726
|
visemeKeys: MorphTargetRef[];
|
|
727
|
+
/** Optional id of the profile-defined viseme system (for example, 'cc4-arkit-15'). */
|
|
728
|
+
visemeSystemId?: string;
|
|
729
|
+
/** Optional profile-defined viseme slots used by editors and id-based runtime APIs. */
|
|
730
|
+
visemeSlots?: VisemeSlot[];
|
|
731
|
+
/** Optional authoring bindings keyed by viseme slot id. */
|
|
732
|
+
visemeBindings?: Record<string, VisemeBinding>;
|
|
710
733
|
/**
|
|
711
734
|
* Optional `morphToMesh` category to use for viseme morph routing.
|
|
712
735
|
* Falls back to `morphToMesh.viseme` (if present), then `morphToMesh.face`.
|
|
@@ -865,6 +888,72 @@ type MorphTargetIndex = number;
|
|
|
865
888
|
* Morph target reference (key or index).
|
|
866
889
|
*/
|
|
867
890
|
type MorphTargetRef = MorphTargetKey | MorphTargetIndex;
|
|
891
|
+
interface VisemeSlotFeatures {
|
|
892
|
+
jawOpen?: number;
|
|
893
|
+
lipClosed?: number;
|
|
894
|
+
lipRound?: number;
|
|
895
|
+
lipSpread?: number;
|
|
896
|
+
tongueTip?: number;
|
|
897
|
+
fricative?: number;
|
|
898
|
+
nasal?: number;
|
|
899
|
+
}
|
|
900
|
+
interface VisemeSlot {
|
|
901
|
+
/** Stable profile/runtime id, such as 'aa', 'bmp', or 'rest'. */
|
|
902
|
+
id: string;
|
|
903
|
+
/** Human-readable editor label. */
|
|
904
|
+
label: string;
|
|
905
|
+
/** Optional display/runtime order. Lower values render first. */
|
|
906
|
+
order?: number;
|
|
907
|
+
/** Provider-specific viseme ids that should map to this slot. */
|
|
908
|
+
providerIds?: Record<string, Array<string | number>>;
|
|
909
|
+
/** Phoneme hints that can map provider phonemes to this slot. */
|
|
910
|
+
phonemes?: string[];
|
|
911
|
+
/** Regex strings used to classify likely morph candidates for this slot. */
|
|
912
|
+
matchers?: string[];
|
|
913
|
+
/** Semantic hints for approximate provider or UI matching. */
|
|
914
|
+
features?: VisemeSlotFeatures;
|
|
915
|
+
/** Optional default jaw amount for this slot. */
|
|
916
|
+
defaultJawAmount?: number;
|
|
917
|
+
}
|
|
918
|
+
interface VisemeBindingTarget {
|
|
919
|
+
morph: MorphTargetRef;
|
|
920
|
+
weight?: number;
|
|
921
|
+
}
|
|
922
|
+
interface VisemeBinding {
|
|
923
|
+
targets?: VisemeBindingTarget[];
|
|
924
|
+
/** Legacy/simplified single-target binding used by existing LoomLarge profiles. */
|
|
925
|
+
morph?: MorphTargetRef;
|
|
926
|
+
jawAmount?: number;
|
|
927
|
+
note?: string;
|
|
928
|
+
sharedWith?: string[];
|
|
929
|
+
}
|
|
930
|
+
type MappingSectionKind = 'au' | 'viseme' | 'hair' | 'unmapped' | 'custom';
|
|
931
|
+
interface MappingEditorSection {
|
|
932
|
+
id: string;
|
|
933
|
+
label: string;
|
|
934
|
+
kind: MappingSectionKind;
|
|
935
|
+
order: number;
|
|
936
|
+
meshCategory?: string;
|
|
937
|
+
facePart?: string;
|
|
938
|
+
}
|
|
939
|
+
type MorphCandidateReason = 'explicit' | 'regex' | 'alias' | 'phoneme' | 'provider' | 'unmapped';
|
|
940
|
+
interface MorphCandidateMatch {
|
|
941
|
+
slotId: string;
|
|
942
|
+
label: string;
|
|
943
|
+
confidence: number;
|
|
944
|
+
reason: MorphCandidateReason;
|
|
945
|
+
pattern?: string;
|
|
946
|
+
}
|
|
947
|
+
interface MorphCandidate {
|
|
948
|
+
morph: string;
|
|
949
|
+
sectionId: string;
|
|
950
|
+
kind: 'explicit' | 'candidate' | 'conflict' | 'unmapped';
|
|
951
|
+
matches: MorphCandidateMatch[];
|
|
952
|
+
}
|
|
953
|
+
interface MappingEditorModel {
|
|
954
|
+
sections: MappingEditorSection[];
|
|
955
|
+
candidates: MorphCandidate[];
|
|
956
|
+
}
|
|
868
957
|
interface MorphTargetsBySide {
|
|
869
958
|
left: MorphTargetRef[];
|
|
870
959
|
right: MorphTargetRef[];
|
|
@@ -1015,6 +1104,14 @@ interface Animation {
|
|
|
1015
1104
|
* Transition viseme value smoothly
|
|
1016
1105
|
*/
|
|
1017
1106
|
transitionViseme(visemeIndex: number, to: number, durationMs?: number, jawScale?: number): TransitionHandle;
|
|
1107
|
+
/**
|
|
1108
|
+
* Set viseme value by profile-defined slot id.
|
|
1109
|
+
*/
|
|
1110
|
+
setVisemeById?(slotId: string, value: number, jawScale?: number): void;
|
|
1111
|
+
/**
|
|
1112
|
+
* Transition viseme value smoothly by profile-defined slot id.
|
|
1113
|
+
*/
|
|
1114
|
+
transitionVisemeById?(slotId: string, to: number, durationMs?: number, jawScale?: number): TransitionHandle;
|
|
1018
1115
|
/**
|
|
1019
1116
|
* Set mix weight for an AU (blend between morph and bone contribution)
|
|
1020
1117
|
*/
|
|
@@ -1542,6 +1639,8 @@ declare class Loom3 implements LoomLarge {
|
|
|
1542
1639
|
transitionMorphInfluence(index: number, to: number, durationMs?: number, meshNames?: string[]): TransitionHandle;
|
|
1543
1640
|
setViseme(visemeIndex: number, value: number, jawScale?: number): void;
|
|
1544
1641
|
transitionViseme(visemeIndex: number, to: number, durationMs?: number, jawScale?: number): TransitionHandle;
|
|
1642
|
+
setVisemeById(slotId: string, value: number, jawScale?: number): void;
|
|
1643
|
+
transitionVisemeById(slotId: string, to: number, durationMs?: number, jawScale?: number): TransitionHandle;
|
|
1545
1644
|
setAUMixWeight(id: number, weight: number): void;
|
|
1546
1645
|
getAUMixWeight(id: number): number;
|
|
1547
1646
|
/**
|
|
@@ -1556,6 +1655,7 @@ declare class Loom3 implements LoomLarge {
|
|
|
1556
1655
|
getActiveTransitionCount(): number;
|
|
1557
1656
|
resetToNeutral(): void;
|
|
1558
1657
|
private reinitializeRuntimeStateFromCurrentControls;
|
|
1658
|
+
private reapplyProceduralStateAfterBakedUpdate;
|
|
1559
1659
|
getMeshList(): MeshInfo[];
|
|
1560
1660
|
/** Get all morph targets grouped by mesh name */
|
|
1561
1661
|
getMorphTargets(): Record<string, string[]>;
|
|
@@ -1863,6 +1963,27 @@ interface HairPhysics$1 {
|
|
|
1863
1963
|
reset(): void;
|
|
1864
1964
|
}
|
|
1865
1965
|
|
|
1966
|
+
declare function getProfileVisemeSlots(profile: Profile): VisemeSlot[];
|
|
1967
|
+
declare function getVisemeSlotIndex(profile: Profile, slotId: string): number;
|
|
1968
|
+
declare function compileVisemeKeys(profile: Profile): MorphTargetRef[];
|
|
1969
|
+
declare function getVisemeJawAmounts(profile: Profile): number[] | undefined;
|
|
1970
|
+
declare function resolveVisemeMeshCategory(profile: Profile): string;
|
|
1971
|
+
declare function getMeshNamesForVisemeProfile(profile: Profile): string[];
|
|
1972
|
+
declare function getMeshNamesForAUProfile(profile: Profile, auId: number): string[];
|
|
1973
|
+
declare function buildMappingEditorModel(profile: Profile, morphNames?: string[]): MappingEditorModel;
|
|
1974
|
+
interface ProviderVisemeEvent {
|
|
1975
|
+
provider: string;
|
|
1976
|
+
id?: string | number;
|
|
1977
|
+
phoneme?: string;
|
|
1978
|
+
}
|
|
1979
|
+
interface ProviderVisemeMatch {
|
|
1980
|
+
slotId: string;
|
|
1981
|
+
index: number;
|
|
1982
|
+
confidence: number;
|
|
1983
|
+
reason: 'provider' | 'phoneme' | 'rest' | 'none';
|
|
1984
|
+
}
|
|
1985
|
+
declare function mapProviderVisemeToSlot(profile: Profile, event: ProviderVisemeEvent): ProviderVisemeMatch | null;
|
|
1986
|
+
|
|
1866
1987
|
/** Line stroke style */
|
|
1867
1988
|
type LineStyle = 'solid' | 'dashed' | 'dotted';
|
|
1868
1989
|
/** Line curve type */
|
|
@@ -2517,4 +2638,4 @@ declare function detectFacingDirection(model: THREE.Object3D, eyeBoneNames?: {
|
|
|
2517
2638
|
right: string[];
|
|
2518
2639
|
}): 'forward' | 'backward' | 'unknown';
|
|
2519
2640
|
|
|
2520
|
-
export { type AUInfo, type AUSelector, AU_INFO, AU_MAPPING_CONFIG, AU_MIX_DEFAULTS, AU_TO_MORPHS, type AddMorphTargetOptions, 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 CameraRelativeGazeOffset, type CameraRelativeGazeOptions, 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 MorphTargetAttributeData, type MorphTargetDelta, 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, computeCameraRelativeGazeOffset, 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 };
|
|
2641
|
+
export { type AUInfo, type AUSelector, AU_INFO, AU_MAPPING_CONFIG, AU_MIX_DEFAULTS, AU_TO_MORPHS, type AddMorphTargetOptions, 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_MAPPING_SECTIONS, CC4_MESHES, CC4_PRESET, CC4_SUFFIX_PATTERN, CC4_VISEME_SLOTS, CC4_VISEME_SYSTEM_ID, COMPOSITE_ROTATIONS, CONTINUUM_LABELS, CONTINUUM_PAIRS_MAP, type CameraRelativeGazeOffset, type CameraRelativeGazeOptions, 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 MappingEditorModel, type MappingEditorSection, type MappingIssue, type MarkerGroup, type MarkerStyle, type MarkerStyleOverrides, type MeshCategory, type MeshInfo, type MeshMaterialSettings, type MixerLoopMode, type ModelAnalysisReport, type ModelData, type ModelMeshInfo, type MorphCandidate, type MorphCandidateMatch, type MorphCandidateReason, type MorphCategory, type MorphInfo, type MorphTargetAttributeData, type MorphTargetDelta, type MorphTargetRef, type MorphTargetsBySide, type NamedDirection, type PresetType, type Profile, type ProviderVisemeEvent, type ProviderVisemeMatch, type ReadyPayload, type Region, type RotationAxis, type RotationsState, type Snippet, type TrackInfo, type TransitionHandle, VISEME_JAW_AMOUNTS, VISEME_KEYS, type ValidateMappingOptions, type ValidationResult, type VisemeBinding, type VisemeBindingTarget, type VisemeSlot, type VisemeSlotFeatures, analyzeModel, applyCharacterProfileToPreset, buildMappingEditorModel, collectMorphMeshes, compileVisemeKeys, computeCameraRelativeGazeOffset, detectFacingDirection, extendCharacterConfigWithPreset, extendPresetWithProfile, extractFromGLTF, extractModelData, extractProfileOverrides, findFaceCenter, fuzzyNameMatch, generateMappingCorrections, getMeshNamesForAUProfile, getMeshNamesForVisemeProfile, getModelForwardDirection, getPreset, getPresetWithProfile, getProfileVisemeSlots, getVisemeJawAmounts, getVisemeSlotIndex, hasLeftRightMorphs, isMixedAU, isPresetCompatible, mapProviderVisemeToSlot, mergeRegionsByName as mergeCharacterRegionsByName, resolveBoneName, resolveBoneNames, resolveFaceCenter, resolvePreset, resolvePresetWithOverrides, resolveVisemeMeshCategory, suggestBestPreset, validateMappingConfig, validateMappings };
|