@lovelace_lol/loom3 1.0.32 → 1.0.34
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/README.md +14 -14
- package/dist/index.cjs +80 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -24
- package/dist/index.d.ts +20 -24
- package/dist/index.js +78 -50
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -86,21 +86,15 @@ declare const MORPH_TO_MESH: Record<MorphCategory, string[]>;
|
|
|
86
86
|
declare const CC4_PRESET: Profile;
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
89
|
+
* Extend a base preset with a profile extension.
|
|
90
90
|
*
|
|
91
91
|
* Rules:
|
|
92
|
-
* - Scalars:
|
|
93
|
-
* - Maps: shallow-merged by key
|
|
94
|
-
* - Arrays: replaced when
|
|
95
|
-
* - annotationRegions: merged by region name, shallow field merge (
|
|
92
|
+
* - Scalars: extension wins when provided.
|
|
93
|
+
* - Maps: shallow-merged by key, values cloned.
|
|
94
|
+
* - Arrays: replaced when the extension provides them (except annotationRegions).
|
|
95
|
+
* - annotationRegions: merged by region name, shallow field merge (extension wins).
|
|
96
96
|
*/
|
|
97
|
-
declare function
|
|
98
|
-
/**
|
|
99
|
-
* Explicit helper for the common operation: start with a preset, then apply a
|
|
100
|
-
* profile override on top. This is the preferred name at call sites where the
|
|
101
|
-
* distinction between preset and profile should stay obvious.
|
|
102
|
-
*/
|
|
103
|
-
declare function applyProfileToPreset(base: Profile, override?: Partial<Profile>): Profile;
|
|
97
|
+
declare function extendPresetWithProfile(base: Profile, extension?: Partial<Profile>): Profile;
|
|
104
98
|
|
|
105
99
|
declare const BETTA_FISH_PRESET: {
|
|
106
100
|
bones: readonly ["Armature_rootJoint", "Bone_Armature", "Bone.001_Armature", "Bone.009_Armature", "Bone.027_Armature", "Bone.029_Armature", "Bone.031_Armature", "Bone.028_Armature", "Bone.030_Armature", "Bone.032_Armature", "Bone.010_Armature", "Bone.012_Armature", "Bone.014_Armature", "Bone.016_Armature", "Bone.011_Armature", "Bone.013_Armature", "Bone.015_Armature", "Bone.017_Armature", "Bone.002_Armature", "Bone.003_Armature", "Bone.004_Armature", "Bone.005_Armature", "Bone.020_Armature", "Bone.025_Armature", "Bone.026_Armature", "Bone.039_Armature", "Bone.040_Armature", "Bone.041_Armature", "Bone.042_Armature", "Bone.043_Armature", "Bone.044_Armature", "Bone.045_Armature", "Bone.019_Armature", "Bone.023_Armature", "Bone.024_Armature", "Bone.034_Armature", "Bone.036_Armature", "Bone.038_Armature", "Bone.018_Armature", "Bone.021_Armature", "Bone.022_Armature", "Bone.033_Armature", "Bone.035_Armature", "Bone.037_Armature", "Bone.046_Armature", "Bone.048_Armature", "Bone.050_Armature", "Bone.047_Armature", "Bone.049_Armature", "Bone.051_Armature", "Bone.006_Armature", "Bone.007_Armature", "Bone.008_Armature"];
|
|
@@ -140,6 +134,7 @@ declare const BETTA_FISH_PRESET: {
|
|
|
140
134
|
}>;
|
|
141
135
|
continuumLabels?: Record<string, string>;
|
|
142
136
|
annotationRegions?: AnnotationRegion[];
|
|
137
|
+
disabledRegions?: string[];
|
|
143
138
|
hairPhysics?: HairPhysicsProfileConfig;
|
|
144
139
|
};
|
|
145
140
|
declare const AU_MAPPING_CONFIG: {
|
|
@@ -180,6 +175,7 @@ declare const AU_MAPPING_CONFIG: {
|
|
|
180
175
|
}>;
|
|
181
176
|
continuumLabels?: Record<string, string>;
|
|
182
177
|
annotationRegions?: AnnotationRegion[];
|
|
178
|
+
disabledRegions?: string[];
|
|
183
179
|
hairPhysics?: HairPhysicsProfileConfig;
|
|
184
180
|
};
|
|
185
181
|
declare const FISH_AU_MAPPING_CONFIG: {
|
|
@@ -220,6 +216,7 @@ declare const FISH_AU_MAPPING_CONFIG: {
|
|
|
220
216
|
}>;
|
|
221
217
|
continuumLabels?: Record<string, string>;
|
|
222
218
|
annotationRegions?: AnnotationRegion[];
|
|
219
|
+
disabledRegions?: string[];
|
|
223
220
|
hairPhysics?: HairPhysicsProfileConfig;
|
|
224
221
|
};
|
|
225
222
|
|
|
@@ -227,7 +224,7 @@ declare const FISH_AU_MAPPING_CONFIG: {
|
|
|
227
224
|
* Loom3 - Preset Exports
|
|
228
225
|
*
|
|
229
226
|
* All AU presets are exported from here.
|
|
230
|
-
* Frontend passes a presetType string and
|
|
227
|
+
* Frontend passes a presetType string and Loom3 looks up the preset internally.
|
|
231
228
|
*/
|
|
232
229
|
|
|
233
230
|
/**
|
|
@@ -235,14 +232,14 @@ declare const FISH_AU_MAPPING_CONFIG: {
|
|
|
235
232
|
*/
|
|
236
233
|
type PresetType = 'cc4' | 'skeletal' | 'fish' | 'custom';
|
|
237
234
|
/**
|
|
238
|
-
*
|
|
235
|
+
* Get a preset by type name.
|
|
239
236
|
* This allows frontend to pass a string instead of importing the full preset.
|
|
240
237
|
*/
|
|
241
|
-
declare function
|
|
238
|
+
declare function getPreset(presetType: PresetType | string | undefined): Profile;
|
|
242
239
|
/**
|
|
243
|
-
*
|
|
240
|
+
* Get a preset, then extend it with an optional profile.
|
|
244
241
|
*/
|
|
245
|
-
declare function
|
|
242
|
+
declare function getPresetWithProfile(presetType: PresetType | string | undefined, profile?: Partial<Profile>): Profile;
|
|
246
243
|
|
|
247
244
|
/**
|
|
248
245
|
* Loom3 - Core Type Definitions
|
|
@@ -673,6 +670,10 @@ interface Profile {
|
|
|
673
670
|
* Optional: Annotation regions for camera/marker overlays.
|
|
674
671
|
*/
|
|
675
672
|
annotationRegions?: AnnotationRegion[];
|
|
673
|
+
/**
|
|
674
|
+
* Optional: preset region names this profile explicitly disables.
|
|
675
|
+
*/
|
|
676
|
+
disabledRegions?: string[];
|
|
676
677
|
/**
|
|
677
678
|
* Optional: Hair physics defaults for this preset/profile.
|
|
678
679
|
*/
|
|
@@ -1259,7 +1260,7 @@ interface ReadyPayload {
|
|
|
1259
1260
|
* Configuration options for the Loom3 engine
|
|
1260
1261
|
*/
|
|
1261
1262
|
interface LoomLargeConfig {
|
|
1262
|
-
/** AU to morph target mappings (partial
|
|
1263
|
+
/** AU to morph target mappings (partial extensions merged into the preset). */
|
|
1263
1264
|
profile?: Partial<Profile>;
|
|
1264
1265
|
/** Preset type to resolve if profile is not provided. */
|
|
1265
1266
|
presetType?: PresetType | string;
|
|
@@ -1949,11 +1950,6 @@ declare function applyCharacterProfileToPreset(config: CharacterConfig): Profile
|
|
|
1949
1950
|
* 4. top-level saved `config.regions` overrides by region name
|
|
1950
1951
|
*/
|
|
1951
1952
|
declare function extendCharacterConfigWithPreset(config: CharacterConfig): CharacterConfig;
|
|
1952
|
-
/**
|
|
1953
|
-
* Backward-compatible alias for older integrations. Prefer
|
|
1954
|
-
* `extendCharacterConfigWithPreset(...)` at new call sites.
|
|
1955
|
-
*/
|
|
1956
|
-
declare function resolveCharacterConfig(config: CharacterConfig): CharacterConfig;
|
|
1957
1953
|
|
|
1958
1954
|
interface ResolvedFaceCenter {
|
|
1959
1955
|
center: THREE.Vector3;
|
|
@@ -2393,4 +2389,4 @@ declare function detectFacingDirection(model: THREE.Object3D, eyeBoneNames?: {
|
|
|
2393
2389
|
right: string[];
|
|
2394
2390
|
}): 'forward' | 'backward' | 'unknown';
|
|
2395
2391
|
|
|
2396
|
-
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,
|
|
2392
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -86,21 +86,15 @@ declare const MORPH_TO_MESH: Record<MorphCategory, string[]>;
|
|
|
86
86
|
declare const CC4_PRESET: Profile;
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
89
|
+
* Extend a base preset with a profile extension.
|
|
90
90
|
*
|
|
91
91
|
* Rules:
|
|
92
|
-
* - Scalars:
|
|
93
|
-
* - Maps: shallow-merged by key
|
|
94
|
-
* - Arrays: replaced when
|
|
95
|
-
* - annotationRegions: merged by region name, shallow field merge (
|
|
92
|
+
* - Scalars: extension wins when provided.
|
|
93
|
+
* - Maps: shallow-merged by key, values cloned.
|
|
94
|
+
* - Arrays: replaced when the extension provides them (except annotationRegions).
|
|
95
|
+
* - annotationRegions: merged by region name, shallow field merge (extension wins).
|
|
96
96
|
*/
|
|
97
|
-
declare function
|
|
98
|
-
/**
|
|
99
|
-
* Explicit helper for the common operation: start with a preset, then apply a
|
|
100
|
-
* profile override on top. This is the preferred name at call sites where the
|
|
101
|
-
* distinction between preset and profile should stay obvious.
|
|
102
|
-
*/
|
|
103
|
-
declare function applyProfileToPreset(base: Profile, override?: Partial<Profile>): Profile;
|
|
97
|
+
declare function extendPresetWithProfile(base: Profile, extension?: Partial<Profile>): Profile;
|
|
104
98
|
|
|
105
99
|
declare const BETTA_FISH_PRESET: {
|
|
106
100
|
bones: readonly ["Armature_rootJoint", "Bone_Armature", "Bone.001_Armature", "Bone.009_Armature", "Bone.027_Armature", "Bone.029_Armature", "Bone.031_Armature", "Bone.028_Armature", "Bone.030_Armature", "Bone.032_Armature", "Bone.010_Armature", "Bone.012_Armature", "Bone.014_Armature", "Bone.016_Armature", "Bone.011_Armature", "Bone.013_Armature", "Bone.015_Armature", "Bone.017_Armature", "Bone.002_Armature", "Bone.003_Armature", "Bone.004_Armature", "Bone.005_Armature", "Bone.020_Armature", "Bone.025_Armature", "Bone.026_Armature", "Bone.039_Armature", "Bone.040_Armature", "Bone.041_Armature", "Bone.042_Armature", "Bone.043_Armature", "Bone.044_Armature", "Bone.045_Armature", "Bone.019_Armature", "Bone.023_Armature", "Bone.024_Armature", "Bone.034_Armature", "Bone.036_Armature", "Bone.038_Armature", "Bone.018_Armature", "Bone.021_Armature", "Bone.022_Armature", "Bone.033_Armature", "Bone.035_Armature", "Bone.037_Armature", "Bone.046_Armature", "Bone.048_Armature", "Bone.050_Armature", "Bone.047_Armature", "Bone.049_Armature", "Bone.051_Armature", "Bone.006_Armature", "Bone.007_Armature", "Bone.008_Armature"];
|
|
@@ -140,6 +134,7 @@ declare const BETTA_FISH_PRESET: {
|
|
|
140
134
|
}>;
|
|
141
135
|
continuumLabels?: Record<string, string>;
|
|
142
136
|
annotationRegions?: AnnotationRegion[];
|
|
137
|
+
disabledRegions?: string[];
|
|
143
138
|
hairPhysics?: HairPhysicsProfileConfig;
|
|
144
139
|
};
|
|
145
140
|
declare const AU_MAPPING_CONFIG: {
|
|
@@ -180,6 +175,7 @@ declare const AU_MAPPING_CONFIG: {
|
|
|
180
175
|
}>;
|
|
181
176
|
continuumLabels?: Record<string, string>;
|
|
182
177
|
annotationRegions?: AnnotationRegion[];
|
|
178
|
+
disabledRegions?: string[];
|
|
183
179
|
hairPhysics?: HairPhysicsProfileConfig;
|
|
184
180
|
};
|
|
185
181
|
declare const FISH_AU_MAPPING_CONFIG: {
|
|
@@ -220,6 +216,7 @@ declare const FISH_AU_MAPPING_CONFIG: {
|
|
|
220
216
|
}>;
|
|
221
217
|
continuumLabels?: Record<string, string>;
|
|
222
218
|
annotationRegions?: AnnotationRegion[];
|
|
219
|
+
disabledRegions?: string[];
|
|
223
220
|
hairPhysics?: HairPhysicsProfileConfig;
|
|
224
221
|
};
|
|
225
222
|
|
|
@@ -227,7 +224,7 @@ declare const FISH_AU_MAPPING_CONFIG: {
|
|
|
227
224
|
* Loom3 - Preset Exports
|
|
228
225
|
*
|
|
229
226
|
* All AU presets are exported from here.
|
|
230
|
-
* Frontend passes a presetType string and
|
|
227
|
+
* Frontend passes a presetType string and Loom3 looks up the preset internally.
|
|
231
228
|
*/
|
|
232
229
|
|
|
233
230
|
/**
|
|
@@ -235,14 +232,14 @@ declare const FISH_AU_MAPPING_CONFIG: {
|
|
|
235
232
|
*/
|
|
236
233
|
type PresetType = 'cc4' | 'skeletal' | 'fish' | 'custom';
|
|
237
234
|
/**
|
|
238
|
-
*
|
|
235
|
+
* Get a preset by type name.
|
|
239
236
|
* This allows frontend to pass a string instead of importing the full preset.
|
|
240
237
|
*/
|
|
241
|
-
declare function
|
|
238
|
+
declare function getPreset(presetType: PresetType | string | undefined): Profile;
|
|
242
239
|
/**
|
|
243
|
-
*
|
|
240
|
+
* Get a preset, then extend it with an optional profile.
|
|
244
241
|
*/
|
|
245
|
-
declare function
|
|
242
|
+
declare function getPresetWithProfile(presetType: PresetType | string | undefined, profile?: Partial<Profile>): Profile;
|
|
246
243
|
|
|
247
244
|
/**
|
|
248
245
|
* Loom3 - Core Type Definitions
|
|
@@ -673,6 +670,10 @@ interface Profile {
|
|
|
673
670
|
* Optional: Annotation regions for camera/marker overlays.
|
|
674
671
|
*/
|
|
675
672
|
annotationRegions?: AnnotationRegion[];
|
|
673
|
+
/**
|
|
674
|
+
* Optional: preset region names this profile explicitly disables.
|
|
675
|
+
*/
|
|
676
|
+
disabledRegions?: string[];
|
|
676
677
|
/**
|
|
677
678
|
* Optional: Hair physics defaults for this preset/profile.
|
|
678
679
|
*/
|
|
@@ -1259,7 +1260,7 @@ interface ReadyPayload {
|
|
|
1259
1260
|
* Configuration options for the Loom3 engine
|
|
1260
1261
|
*/
|
|
1261
1262
|
interface LoomLargeConfig {
|
|
1262
|
-
/** AU to morph target mappings (partial
|
|
1263
|
+
/** AU to morph target mappings (partial extensions merged into the preset). */
|
|
1263
1264
|
profile?: Partial<Profile>;
|
|
1264
1265
|
/** Preset type to resolve if profile is not provided. */
|
|
1265
1266
|
presetType?: PresetType | string;
|
|
@@ -1949,11 +1950,6 @@ declare function applyCharacterProfileToPreset(config: CharacterConfig): Profile
|
|
|
1949
1950
|
* 4. top-level saved `config.regions` overrides by region name
|
|
1950
1951
|
*/
|
|
1951
1952
|
declare function extendCharacterConfigWithPreset(config: CharacterConfig): CharacterConfig;
|
|
1952
|
-
/**
|
|
1953
|
-
* Backward-compatible alias for older integrations. Prefer
|
|
1954
|
-
* `extendCharacterConfigWithPreset(...)` at new call sites.
|
|
1955
|
-
*/
|
|
1956
|
-
declare function resolveCharacterConfig(config: CharacterConfig): CharacterConfig;
|
|
1957
1953
|
|
|
1958
1954
|
interface ResolvedFaceCenter {
|
|
1959
1955
|
center: THREE.Vector3;
|
|
@@ -2393,4 +2389,4 @@ declare function detectFacingDirection(model: THREE.Object3D, eyeBoneNames?: {
|
|
|
2393
2389
|
right: string[];
|
|
2394
2390
|
}): 'forward' | 'backward' | 'unknown';
|
|
2395
2391
|
|
|
2396
|
-
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,
|
|
2392
|
+
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 };
|
package/dist/index.js
CHANGED
|
@@ -2879,7 +2879,7 @@ var HairPhysicsController = class {
|
|
|
2879
2879
|
}
|
|
2880
2880
|
};
|
|
2881
2881
|
|
|
2882
|
-
// src/mappings/
|
|
2882
|
+
// src/mappings/extendPresetWithProfile.ts
|
|
2883
2883
|
var isPlainObject = (value) => {
|
|
2884
2884
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2885
2885
|
};
|
|
@@ -2971,31 +2971,33 @@ var mergeHairPhysicsConfig = (base, override) => {
|
|
|
2971
2971
|
}
|
|
2972
2972
|
return merged;
|
|
2973
2973
|
};
|
|
2974
|
-
function
|
|
2974
|
+
function extendPresetWithProfile(base, extension) {
|
|
2975
|
+
if (!extension) {
|
|
2976
|
+
return base;
|
|
2977
|
+
}
|
|
2978
|
+
const disabledRegions = extension.disabledRegions ? [...extension.disabledRegions] : base.disabledRegions ? [...base.disabledRegions] : void 0;
|
|
2975
2979
|
return {
|
|
2976
2980
|
...base,
|
|
2977
|
-
...
|
|
2978
|
-
auToMorphs: mergeRecord(base.auToMorphs,
|
|
2979
|
-
auToBones: mergeRecord(base.auToBones,
|
|
2980
|
-
boneNodes: mergeRecord(base.boneNodes,
|
|
2981
|
-
morphToMesh: mergeRecord(base.morphToMesh,
|
|
2982
|
-
auFacePartToMeshCategory: base.auFacePartToMeshCategory ||
|
|
2983
|
-
visemeKeys:
|
|
2984
|
-
visemeMeshCategory:
|
|
2985
|
-
auMixDefaults: base.auMixDefaults ||
|
|
2986
|
-
auInfo: base.auInfo ||
|
|
2987
|
-
eyeMeshNodes:
|
|
2988
|
-
compositeRotations:
|
|
2989
|
-
meshes: base.meshes ||
|
|
2990
|
-
continuumPairs: base.continuumPairs ||
|
|
2991
|
-
continuumLabels: base.continuumLabels ||
|
|
2992
|
-
annotationRegions: mergeAnnotationRegions(base.annotationRegions,
|
|
2993
|
-
|
|
2981
|
+
...extension,
|
|
2982
|
+
auToMorphs: mergeRecord(base.auToMorphs, extension.auToMorphs),
|
|
2983
|
+
auToBones: mergeRecord(base.auToBones, extension.auToBones),
|
|
2984
|
+
boneNodes: mergeRecord(base.boneNodes, extension.boneNodes),
|
|
2985
|
+
morphToMesh: mergeRecord(base.morphToMesh, extension.morphToMesh),
|
|
2986
|
+
auFacePartToMeshCategory: base.auFacePartToMeshCategory || extension.auFacePartToMeshCategory ? mergeRecord(base.auFacePartToMeshCategory || {}, extension.auFacePartToMeshCategory || {}) : void 0,
|
|
2987
|
+
visemeKeys: extension.visemeKeys ? [...extension.visemeKeys] : [...base.visemeKeys],
|
|
2988
|
+
visemeMeshCategory: extension.visemeMeshCategory ?? base.visemeMeshCategory,
|
|
2989
|
+
auMixDefaults: base.auMixDefaults || extension.auMixDefaults ? mergeRecord(base.auMixDefaults || {}, extension.auMixDefaults || {}) : void 0,
|
|
2990
|
+
auInfo: base.auInfo || extension.auInfo ? mergeRecord(base.auInfo || {}, extension.auInfo || {}) : void 0,
|
|
2991
|
+
eyeMeshNodes: extension.eyeMeshNodes ?? base.eyeMeshNodes,
|
|
2992
|
+
compositeRotations: extension.compositeRotations ?? base.compositeRotations,
|
|
2993
|
+
meshes: base.meshes || extension.meshes ? mergeRecord(base.meshes || {}, extension.meshes || {}) : void 0,
|
|
2994
|
+
continuumPairs: base.continuumPairs || extension.continuumPairs ? mergeRecord(base.continuumPairs || {}, extension.continuumPairs || {}) : void 0,
|
|
2995
|
+
continuumLabels: base.continuumLabels || extension.continuumLabels ? mergeRecord(base.continuumLabels || {}, extension.continuumLabels || {}) : void 0,
|
|
2996
|
+
annotationRegions: mergeAnnotationRegions(base.annotationRegions, extension.annotationRegions),
|
|
2997
|
+
disabledRegions,
|
|
2998
|
+
hairPhysics: mergeHairPhysicsConfig(base.hairPhysics, extension.hairPhysics)
|
|
2994
2999
|
};
|
|
2995
3000
|
}
|
|
2996
|
-
function applyProfileToPreset(base, override) {
|
|
2997
|
-
return override ? resolveProfile(base, override) : base;
|
|
2998
|
-
}
|
|
2999
3001
|
|
|
3000
3002
|
// src/presets/bettaFish.ts
|
|
3001
3003
|
var BONES = [
|
|
@@ -3782,22 +3784,24 @@ var ANNOTATION_REGIONS = [
|
|
|
3782
3784
|
name: "gills",
|
|
3783
3785
|
bones: ["GILL_L", "GILL_R"],
|
|
3784
3786
|
paddingFactor: 1.6,
|
|
3785
|
-
children: ["
|
|
3787
|
+
children: ["gill_left", "gill_right"],
|
|
3786
3788
|
expandAnimation: "outward"
|
|
3787
3789
|
},
|
|
3788
3790
|
{
|
|
3789
|
-
name: "
|
|
3791
|
+
name: "gill_left",
|
|
3790
3792
|
bones: ["GILL_L", "GILL_L_MID", "GILL_L_TIP"],
|
|
3791
3793
|
parent: "gills",
|
|
3792
3794
|
paddingFactor: 1.4,
|
|
3793
|
-
cameraAngle: 270
|
|
3795
|
+
cameraAngle: 270,
|
|
3796
|
+
style: { lineDirection: "left" }
|
|
3794
3797
|
},
|
|
3795
3798
|
{
|
|
3796
|
-
name: "
|
|
3799
|
+
name: "gill_right",
|
|
3797
3800
|
bones: ["GILL_R", "GILL_R_MID", "GILL_R_TIP"],
|
|
3798
3801
|
parent: "gills",
|
|
3799
3802
|
paddingFactor: 1.4,
|
|
3800
|
-
cameraAngle: 90
|
|
3803
|
+
cameraAngle: 90,
|
|
3804
|
+
style: { lineDirection: "right" }
|
|
3801
3805
|
}
|
|
3802
3806
|
];
|
|
3803
3807
|
var BETTA_FISH_PROFILE = {
|
|
@@ -3834,7 +3838,7 @@ var AU_MAPPING_CONFIG = BETTA_FISH_PRESET;
|
|
|
3834
3838
|
var FISH_AU_MAPPING_CONFIG = BETTA_FISH_PRESET;
|
|
3835
3839
|
|
|
3836
3840
|
// src/presets/index.ts
|
|
3837
|
-
function
|
|
3841
|
+
function getPreset(presetType) {
|
|
3838
3842
|
switch (presetType) {
|
|
3839
3843
|
case "fish":
|
|
3840
3844
|
case "skeletal":
|
|
@@ -3845,9 +3849,8 @@ function resolvePreset(presetType) {
|
|
|
3845
3849
|
return CC4_PRESET;
|
|
3846
3850
|
}
|
|
3847
3851
|
}
|
|
3848
|
-
function
|
|
3849
|
-
|
|
3850
|
-
return applyProfileToPreset(base, overrides);
|
|
3852
|
+
function getPresetWithProfile(presetType, profile) {
|
|
3853
|
+
return extendPresetWithProfile(getPreset(presetType), profile);
|
|
3851
3854
|
}
|
|
3852
3855
|
|
|
3853
3856
|
// src/engines/three/Loom3.ts
|
|
@@ -3923,8 +3926,8 @@ var _Loom3 = class _Loom3 {
|
|
|
3923
3926
|
__publicField(this, "isRunning", false);
|
|
3924
3927
|
/** Store original emissive colors for highlight reset */
|
|
3925
3928
|
__publicField(this, "originalEmissive", /* @__PURE__ */ new Map());
|
|
3926
|
-
const basePreset = config.presetType ?
|
|
3927
|
-
this.config =
|
|
3929
|
+
const basePreset = config.presetType ? getPreset(config.presetType) : CC4_PRESET;
|
|
3930
|
+
this.config = extendPresetWithProfile(basePreset, config.profile);
|
|
3928
3931
|
this.mixWeights = { ...this.config.auMixDefaults };
|
|
3929
3932
|
this.animation = animation || new AnimationThree();
|
|
3930
3933
|
this.compositeRotations = this.config.compositeRotations || COMPOSITE_ROTATIONS;
|
|
@@ -5333,7 +5336,30 @@ var BLENDING_MODES = {
|
|
|
5333
5336
|
// THREE.NoBlending
|
|
5334
5337
|
};
|
|
5335
5338
|
|
|
5336
|
-
// src/
|
|
5339
|
+
// src/regions/normalizeRegionTree.ts
|
|
5340
|
+
function normalizeDisabledNames(disabledNames) {
|
|
5341
|
+
return new Set((disabledNames ?? []).filter((name) => Boolean(name)));
|
|
5342
|
+
}
|
|
5343
|
+
function normalizeRegionTree(regions, disabledNames) {
|
|
5344
|
+
if (!regions) return void 0;
|
|
5345
|
+
const disabled = normalizeDisabledNames(disabledNames);
|
|
5346
|
+
const nextRegions = regions.filter((region) => !disabled.has(region.name)).map((region) => ({
|
|
5347
|
+
...region,
|
|
5348
|
+
children: region.children ? [...region.children] : void 0
|
|
5349
|
+
}));
|
|
5350
|
+
const remainingNames = new Set(nextRegions.map((region) => region.name));
|
|
5351
|
+
return nextRegions.map((region) => {
|
|
5352
|
+
const nextChildren = region.children?.filter((child) => remainingNames.has(child));
|
|
5353
|
+
const nextParent = region.parent && remainingNames.has(region.parent) ? region.parent : void 0;
|
|
5354
|
+
return {
|
|
5355
|
+
...region,
|
|
5356
|
+
parent: nextParent,
|
|
5357
|
+
children: nextChildren && nextChildren.length > 0 ? nextChildren : void 0
|
|
5358
|
+
};
|
|
5359
|
+
});
|
|
5360
|
+
}
|
|
5361
|
+
|
|
5362
|
+
// src/characters/extendCharacterConfigWithPreset.ts
|
|
5337
5363
|
var PROFILE_OVERRIDE_KEYS = [
|
|
5338
5364
|
"name",
|
|
5339
5365
|
"animalType",
|
|
@@ -5361,6 +5387,7 @@ var PROFILE_OVERRIDE_KEYS = [
|
|
|
5361
5387
|
"continuumPairs",
|
|
5362
5388
|
"continuumLabels",
|
|
5363
5389
|
"annotationRegions",
|
|
5390
|
+
"disabledRegions",
|
|
5364
5391
|
"hairPhysics"
|
|
5365
5392
|
];
|
|
5366
5393
|
function isPlainObject2(value) {
|
|
@@ -5479,11 +5506,11 @@ function applyCharacterProfileToPreset(config) {
|
|
|
5479
5506
|
if (!presetType) {
|
|
5480
5507
|
return null;
|
|
5481
5508
|
}
|
|
5482
|
-
return
|
|
5509
|
+
return extendPresetWithProfile(getPreset(presetType), extractProfileOverrides(config));
|
|
5483
5510
|
}
|
|
5484
|
-
function
|
|
5485
|
-
if (!
|
|
5486
|
-
const
|
|
5511
|
+
function orderExtendedRegions(extendedRegions, prioritizedLists) {
|
|
5512
|
+
if (!extendedRegions) return void 0;
|
|
5513
|
+
const extendedByName = new Map(extendedRegions.map((region) => [region.name, region]));
|
|
5487
5514
|
const orderedNames = [];
|
|
5488
5515
|
const seen = /* @__PURE__ */ new Set();
|
|
5489
5516
|
for (const regions of prioritizedLists) {
|
|
@@ -5493,12 +5520,12 @@ function orderResolvedRegions(resolvedRegions, prioritizedLists) {
|
|
|
5493
5520
|
orderedNames.push(region.name);
|
|
5494
5521
|
}
|
|
5495
5522
|
}
|
|
5496
|
-
for (const region of
|
|
5523
|
+
for (const region of extendedRegions) {
|
|
5497
5524
|
if (seen.has(region.name)) continue;
|
|
5498
5525
|
seen.add(region.name);
|
|
5499
5526
|
orderedNames.push(region.name);
|
|
5500
5527
|
}
|
|
5501
|
-
return orderedNames.map((name) =>
|
|
5528
|
+
return orderedNames.map((name) => extendedByName.get(name)).filter((region) => Boolean(region));
|
|
5502
5529
|
}
|
|
5503
5530
|
function extendCharacterConfigWithPreset(config) {
|
|
5504
5531
|
const presetType = config.auPresetType;
|
|
@@ -5506,25 +5533,26 @@ function extendCharacterConfigWithPreset(config) {
|
|
|
5506
5533
|
return config;
|
|
5507
5534
|
}
|
|
5508
5535
|
const profileOverrides = extractProfileOverrides(config);
|
|
5509
|
-
const
|
|
5510
|
-
if (!
|
|
5536
|
+
const extendedPresetProfile = applyCharacterProfileToPreset(config);
|
|
5537
|
+
if (!extendedPresetProfile) {
|
|
5511
5538
|
return config;
|
|
5512
5539
|
}
|
|
5513
|
-
const presetRegions =
|
|
5540
|
+
const presetRegions = extendedPresetProfile.annotationRegions;
|
|
5514
5541
|
const mergedRegions = mergeRegionsByName(presetRegions, config.regions);
|
|
5515
|
-
const
|
|
5542
|
+
const normalizedRegions = normalizeRegionTree(
|
|
5516
5543
|
mergedRegions,
|
|
5544
|
+
profileOverrides.disabledRegions
|
|
5545
|
+
);
|
|
5546
|
+
const extendedRegions = orderExtendedRegions(
|
|
5547
|
+
normalizedRegions,
|
|
5517
5548
|
[config.regions, profileOverrides.annotationRegions, presetRegions]
|
|
5518
5549
|
);
|
|
5519
5550
|
return {
|
|
5520
5551
|
...config,
|
|
5521
|
-
...
|
|
5522
|
-
regions:
|
|
5552
|
+
...extendedPresetProfile,
|
|
5553
|
+
regions: extendedRegions ?? config.regions
|
|
5523
5554
|
};
|
|
5524
5555
|
}
|
|
5525
|
-
function resolveCharacterConfig(config) {
|
|
5526
|
-
return extendCharacterConfigWithPreset(config);
|
|
5527
|
-
}
|
|
5528
5556
|
var DEFAULT_HEAD_BONE_NAMES = ["CC_Base_Head", "Head", "head", "Bip01_Head"];
|
|
5529
5557
|
var DEFAULT_REFERENCE_HEIGHT = 1.8;
|
|
5530
5558
|
var DEFAULT_FORWARD_OFFSET = 0.08;
|
|
@@ -6843,6 +6871,6 @@ async function analyzeModel(options) {
|
|
|
6843
6871
|
};
|
|
6844
6872
|
}
|
|
6845
6873
|
|
|
6846
|
-
export { AU_INFO, AU_MAPPING_CONFIG, AU_MIX_DEFAULTS, AU_TO_MORPHS, AnimationThree, BETTA_FISH_PRESET, BLENDING_MODES, BONE_AU_TO_BINDINGS, CC4_BONE_NODES, CC4_BONE_PREFIX, CC4_EYE_MESH_NODES, CC4_MESHES, CC4_PRESET, CC4_SUFFIX_PATTERN, COMPOSITE_ROTATIONS, CONTINUUM_LABELS, CONTINUUM_PAIRS_MAP, DEFAULT_HAIR_PHYSICS_CONFIG, FISH_AU_MAPPING_CONFIG, HairPhysics, Loom3, Loom3 as Loom3Three, Loom3 as LoomLargeThree, MORPH_TO_MESH, VISEME_JAW_AMOUNTS, VISEME_KEYS, analyzeModel, applyCharacterProfileToPreset,
|
|
6874
|
+
export { AU_INFO, AU_MAPPING_CONFIG, AU_MIX_DEFAULTS, AU_TO_MORPHS, AnimationThree, BETTA_FISH_PRESET, BLENDING_MODES, BONE_AU_TO_BINDINGS, CC4_BONE_NODES, CC4_BONE_PREFIX, CC4_EYE_MESH_NODES, CC4_MESHES, CC4_PRESET, CC4_SUFFIX_PATTERN, COMPOSITE_ROTATIONS, CONTINUUM_LABELS, CONTINUUM_PAIRS_MAP, DEFAULT_HAIR_PHYSICS_CONFIG, FISH_AU_MAPPING_CONFIG, HairPhysics, Loom3, Loom3 as Loom3Three, Loom3 as LoomLargeThree, MORPH_TO_MESH, VISEME_JAW_AMOUNTS, VISEME_KEYS, 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 };
|
|
6847
6875
|
//# sourceMappingURL=index.js.map
|
|
6848
6876
|
//# sourceMappingURL=index.js.map
|