@lovelace_lol/loom3 1.0.13 → 1.0.15
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 +73 -72
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -39
- package/dist/index.d.ts +6 -39
- package/dist/index.js +74 -73
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1122,7 +1122,7 @@ interface HairObjectRef {
|
|
|
1122
1122
|
isMesh: boolean;
|
|
1123
1123
|
isEyebrow: boolean;
|
|
1124
1124
|
}
|
|
1125
|
-
interface HairPhysicsDirectionConfig
|
|
1125
|
+
interface HairPhysicsDirectionConfig {
|
|
1126
1126
|
yawSign: 1 | -1;
|
|
1127
1127
|
pitchSign: 1 | -1;
|
|
1128
1128
|
}
|
|
@@ -1150,11 +1150,11 @@ interface HairPhysicsRuntimeConfig {
|
|
|
1150
1150
|
windFrequency: number;
|
|
1151
1151
|
idleClipDuration: number;
|
|
1152
1152
|
impulseClipDuration: number;
|
|
1153
|
-
direction: HairPhysicsDirectionConfig
|
|
1153
|
+
direction: HairPhysicsDirectionConfig;
|
|
1154
1154
|
morphTargets: HairMorphTargetsConfig;
|
|
1155
1155
|
}
|
|
1156
1156
|
type HairPhysicsRuntimeConfigUpdate = Partial<HairPhysicsRuntimeConfig> & {
|
|
1157
|
-
direction?: Partial<HairPhysicsDirectionConfig
|
|
1157
|
+
direction?: Partial<HairPhysicsDirectionConfig>;
|
|
1158
1158
|
morphTargets?: Partial<HairMorphTargetsConfig>;
|
|
1159
1159
|
};
|
|
1160
1160
|
interface HairObjectState {
|
|
@@ -1319,41 +1319,8 @@ interface LoomLarge extends Animation, Hair {
|
|
|
1319
1319
|
}
|
|
1320
1320
|
type Loom3Config = LoomLargeConfig;
|
|
1321
1321
|
|
|
1322
|
-
type
|
|
1323
|
-
|
|
1324
|
-
pitchSign: 1 | -1;
|
|
1325
|
-
};
|
|
1326
|
-
type HairMorphTargets = {
|
|
1327
|
-
swayLeft: string;
|
|
1328
|
-
swayRight: string;
|
|
1329
|
-
swayFront: string;
|
|
1330
|
-
fluffRight: string;
|
|
1331
|
-
fluffBottom: string;
|
|
1332
|
-
headUp: Record<string, number>;
|
|
1333
|
-
headDown: Record<string, number>;
|
|
1334
|
-
};
|
|
1335
|
-
type HairPhysicsConfig$2 = {
|
|
1336
|
-
stiffness: number;
|
|
1337
|
-
damping: number;
|
|
1338
|
-
inertia: number;
|
|
1339
|
-
gravity: number;
|
|
1340
|
-
responseScale: number;
|
|
1341
|
-
idleSwayAmount: number;
|
|
1342
|
-
idleSwaySpeed: number;
|
|
1343
|
-
windStrength: number;
|
|
1344
|
-
windDirectionX: number;
|
|
1345
|
-
windDirectionZ: number;
|
|
1346
|
-
windTurbulence: number;
|
|
1347
|
-
windFrequency: number;
|
|
1348
|
-
idleClipDuration: number;
|
|
1349
|
-
impulseClipDuration: number;
|
|
1350
|
-
direction: HairPhysicsDirectionConfig;
|
|
1351
|
-
morphTargets: HairMorphTargets;
|
|
1352
|
-
};
|
|
1353
|
-
type HairPhysicsConfigUpdate = Partial<HairPhysicsConfig$2> & {
|
|
1354
|
-
direction?: Partial<HairPhysicsDirectionConfig>;
|
|
1355
|
-
morphTargets?: Partial<HairMorphTargets>;
|
|
1356
|
-
};
|
|
1322
|
+
type HairPhysicsConfig$2 = HairPhysicsRuntimeConfig;
|
|
1323
|
+
type HairPhysicsConfigUpdate = HairPhysicsRuntimeConfigUpdate;
|
|
1357
1324
|
|
|
1358
1325
|
/**
|
|
1359
1326
|
* Loom3 - Three.js Implementation
|
|
@@ -2390,4 +2357,4 @@ declare function detectFacingDirection(model: THREE.Object3D, eyeBoneNames?: {
|
|
|
2390
2357
|
right: string[];
|
|
2391
2358
|
}): 'forward' | 'backward' | 'unknown';
|
|
2392
2359
|
|
|
2393
|
-
export { type AUInfo, type AUSelector, AU_INFO, AU_MIX_DEFAULTS, AU_TO_MORPHS, type AnalyzeModelOptions, type Animation, type AnimationActionHandle, type AnimationAnalysis, type AnimationClipInfo, type AnimationInfo, type AnimationPlayOptions, 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, AU_MAPPING_CONFIG as 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
|
|
2360
|
+
export { type AUInfo, type AUSelector, AU_INFO, AU_MIX_DEFAULTS, AU_TO_MORPHS, type AnalyzeModelOptions, type Animation, type AnimationActionHandle, type AnimationAnalysis, type AnimationClipInfo, type AnimationInfo, type AnimationPlayOptions, 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, AU_MAPPING_CONFIG as 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, collectMorphMeshes, detectFacingDirection, extractFromGLTF, extractModelData, findFaceCenter, fuzzyNameMatch, generateMappingCorrections, getModelForwardDirection, hasLeftRightMorphs, isMixedAU, isPresetCompatible, resolveBoneName, resolveBoneNames, resolveFaceCenter, resolvePreset, resolvePresetWithOverrides, resolveProfile, suggestBestPreset, validateMappingConfig, validateMappings };
|
package/dist/index.d.ts
CHANGED
|
@@ -1122,7 +1122,7 @@ interface HairObjectRef {
|
|
|
1122
1122
|
isMesh: boolean;
|
|
1123
1123
|
isEyebrow: boolean;
|
|
1124
1124
|
}
|
|
1125
|
-
interface HairPhysicsDirectionConfig
|
|
1125
|
+
interface HairPhysicsDirectionConfig {
|
|
1126
1126
|
yawSign: 1 | -1;
|
|
1127
1127
|
pitchSign: 1 | -1;
|
|
1128
1128
|
}
|
|
@@ -1150,11 +1150,11 @@ interface HairPhysicsRuntimeConfig {
|
|
|
1150
1150
|
windFrequency: number;
|
|
1151
1151
|
idleClipDuration: number;
|
|
1152
1152
|
impulseClipDuration: number;
|
|
1153
|
-
direction: HairPhysicsDirectionConfig
|
|
1153
|
+
direction: HairPhysicsDirectionConfig;
|
|
1154
1154
|
morphTargets: HairMorphTargetsConfig;
|
|
1155
1155
|
}
|
|
1156
1156
|
type HairPhysicsRuntimeConfigUpdate = Partial<HairPhysicsRuntimeConfig> & {
|
|
1157
|
-
direction?: Partial<HairPhysicsDirectionConfig
|
|
1157
|
+
direction?: Partial<HairPhysicsDirectionConfig>;
|
|
1158
1158
|
morphTargets?: Partial<HairMorphTargetsConfig>;
|
|
1159
1159
|
};
|
|
1160
1160
|
interface HairObjectState {
|
|
@@ -1319,41 +1319,8 @@ interface LoomLarge extends Animation, Hair {
|
|
|
1319
1319
|
}
|
|
1320
1320
|
type Loom3Config = LoomLargeConfig;
|
|
1321
1321
|
|
|
1322
|
-
type
|
|
1323
|
-
|
|
1324
|
-
pitchSign: 1 | -1;
|
|
1325
|
-
};
|
|
1326
|
-
type HairMorphTargets = {
|
|
1327
|
-
swayLeft: string;
|
|
1328
|
-
swayRight: string;
|
|
1329
|
-
swayFront: string;
|
|
1330
|
-
fluffRight: string;
|
|
1331
|
-
fluffBottom: string;
|
|
1332
|
-
headUp: Record<string, number>;
|
|
1333
|
-
headDown: Record<string, number>;
|
|
1334
|
-
};
|
|
1335
|
-
type HairPhysicsConfig$2 = {
|
|
1336
|
-
stiffness: number;
|
|
1337
|
-
damping: number;
|
|
1338
|
-
inertia: number;
|
|
1339
|
-
gravity: number;
|
|
1340
|
-
responseScale: number;
|
|
1341
|
-
idleSwayAmount: number;
|
|
1342
|
-
idleSwaySpeed: number;
|
|
1343
|
-
windStrength: number;
|
|
1344
|
-
windDirectionX: number;
|
|
1345
|
-
windDirectionZ: number;
|
|
1346
|
-
windTurbulence: number;
|
|
1347
|
-
windFrequency: number;
|
|
1348
|
-
idleClipDuration: number;
|
|
1349
|
-
impulseClipDuration: number;
|
|
1350
|
-
direction: HairPhysicsDirectionConfig;
|
|
1351
|
-
morphTargets: HairMorphTargets;
|
|
1352
|
-
};
|
|
1353
|
-
type HairPhysicsConfigUpdate = Partial<HairPhysicsConfig$2> & {
|
|
1354
|
-
direction?: Partial<HairPhysicsDirectionConfig>;
|
|
1355
|
-
morphTargets?: Partial<HairMorphTargets>;
|
|
1356
|
-
};
|
|
1322
|
+
type HairPhysicsConfig$2 = HairPhysicsRuntimeConfig;
|
|
1323
|
+
type HairPhysicsConfigUpdate = HairPhysicsRuntimeConfigUpdate;
|
|
1357
1324
|
|
|
1358
1325
|
/**
|
|
1359
1326
|
* Loom3 - Three.js Implementation
|
|
@@ -2390,4 +2357,4 @@ declare function detectFacingDirection(model: THREE.Object3D, eyeBoneNames?: {
|
|
|
2390
2357
|
right: string[];
|
|
2391
2358
|
}): 'forward' | 'backward' | 'unknown';
|
|
2392
2359
|
|
|
2393
|
-
export { type AUInfo, type AUSelector, AU_INFO, AU_MIX_DEFAULTS, AU_TO_MORPHS, type AnalyzeModelOptions, type Animation, type AnimationActionHandle, type AnimationAnalysis, type AnimationClipInfo, type AnimationInfo, type AnimationPlayOptions, 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, AU_MAPPING_CONFIG as 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
|
|
2360
|
+
export { type AUInfo, type AUSelector, AU_INFO, AU_MIX_DEFAULTS, AU_TO_MORPHS, type AnalyzeModelOptions, type Animation, type AnimationActionHandle, type AnimationAnalysis, type AnimationClipInfo, type AnimationInfo, type AnimationPlayOptions, 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, AU_MAPPING_CONFIG as 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, collectMorphMeshes, detectFacingDirection, extractFromGLTF, extractModelData, findFaceCenter, fuzzyNameMatch, generateMappingCorrections, getModelForwardDirection, hasLeftRightMorphs, isMixedAU, isPresetCompatible, resolveBoneName, resolveBoneNames, resolveFaceCenter, resolvePreset, resolvePresetWithOverrides, resolveProfile, suggestBestPreset, validateMappingConfig, validateMappings };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { Vector3, Clock, Box3, Quaternion, LoopOnce, LoopPingPong, LoopRepeat, QuaternionKeyframeTrack, NumberKeyframeTrack, AnimationClip, AnimationMixer } from 'three';
|
|
2
|
+
import { Vector3, Clock, Box3, Quaternion, Mesh, LoopOnce, LoopPingPong, LoopRepeat, QuaternionKeyframeTrack, NumberKeyframeTrack, AnimationClip, AnimationMixer } from 'three';
|
|
3
3
|
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
@@ -171,6 +171,17 @@ var BakedAnimationController = class {
|
|
|
171
171
|
__publicField(this, "actionIdToClip", /* @__PURE__ */ new Map());
|
|
172
172
|
this.host = host;
|
|
173
173
|
}
|
|
174
|
+
getActionId(action) {
|
|
175
|
+
if (!action) return void 0;
|
|
176
|
+
return this.actionIds.get(action) ?? action.__actionId;
|
|
177
|
+
}
|
|
178
|
+
setActionId(action, clipName) {
|
|
179
|
+
const actionId = makeActionId();
|
|
180
|
+
this.actionIds.set(action, actionId);
|
|
181
|
+
this.actionIdToClip.set(actionId, clipName);
|
|
182
|
+
action.__actionId = actionId;
|
|
183
|
+
return actionId;
|
|
184
|
+
}
|
|
174
185
|
getMeshNamesForAU(auId, config, explicitMeshNames) {
|
|
175
186
|
if (explicitMeshNames && explicitMeshNames.length > 0) {
|
|
176
187
|
return explicitMeshNames;
|
|
@@ -675,19 +686,13 @@ var BakedAnimationController = class {
|
|
|
675
686
|
mixerWeight
|
|
676
687
|
} = options || {};
|
|
677
688
|
let action = this.clipActions.get(clip.name);
|
|
678
|
-
let actionId =
|
|
689
|
+
let actionId = this.getActionId(action);
|
|
679
690
|
if (action && !actionId) {
|
|
680
|
-
actionId =
|
|
681
|
-
this.actionIds.set(action, actionId);
|
|
682
|
-
this.actionIdToClip.set(actionId, clip.name);
|
|
683
|
-
action.__actionId = actionId;
|
|
691
|
+
actionId = this.setActionId(action, clip.name);
|
|
684
692
|
}
|
|
685
693
|
if (!action) {
|
|
686
694
|
action = this.animationMixer.clipAction(clip);
|
|
687
|
-
actionId =
|
|
688
|
-
this.actionIds.set(action, actionId);
|
|
689
|
-
this.actionIdToClip.set(actionId, clip.name);
|
|
690
|
-
action.__actionId = actionId;
|
|
695
|
+
actionId = this.setActionId(action, clip.name);
|
|
691
696
|
}
|
|
692
697
|
const existingClip = this.animationClips.find((c) => c.name === clip.name);
|
|
693
698
|
if (!existingClip) {
|
|
@@ -840,10 +845,10 @@ var BakedAnimationController = class {
|
|
|
840
845
|
const debugSnapshot = () => ({
|
|
841
846
|
target: name,
|
|
842
847
|
params,
|
|
843
|
-
clipActions: Array.from(this.clipActions.entries()).map(([k, a]) => ({ name: k, actionId: this.
|
|
844
|
-
animationActions: Array.from(this.animationActions.entries()).map(([k, a]) => ({ name: k, actionId: this.
|
|
848
|
+
clipActions: Array.from(this.clipActions.entries()).map(([k, a]) => ({ name: k, actionId: this.getActionId(a) })),
|
|
849
|
+
animationActions: Array.from(this.animationActions.entries()).map(([k, a]) => ({ name: k, actionId: this.getActionId(a) })),
|
|
845
850
|
clipHandles: Array.from(this.clipHandles.entries()).map(([k, h]) => ({ name: k, actionId: h.actionId })),
|
|
846
|
-
mixerActions: (this.animationMixer?._actions || []).map((a) => ({ name: a?.getClip?.()?.name || "", actionId: this.
|
|
851
|
+
mixerActions: (this.animationMixer?._actions || []).map((a) => ({ name: a?.getClip?.()?.name || "", actionId: this.getActionId(a) }))
|
|
847
852
|
});
|
|
848
853
|
console.log("[Loom3] updateClipParams start", debugSnapshot());
|
|
849
854
|
const apply = (action) => {
|
|
@@ -1477,53 +1482,53 @@ var BONE_AU_TO_BINDINGS = {
|
|
|
1477
1482
|
42: [{ node: "TONGUE", channel: "rx", scale: 1, maxDegrees: 20 }]
|
|
1478
1483
|
};
|
|
1479
1484
|
var VISEME_KEYS = [
|
|
1480
|
-
"
|
|
1485
|
+
"AE",
|
|
1481
1486
|
"Ah",
|
|
1482
|
-
"Oh",
|
|
1483
|
-
"OO",
|
|
1484
|
-
"I",
|
|
1485
|
-
"U",
|
|
1486
|
-
"W",
|
|
1487
|
-
"L",
|
|
1488
|
-
"F_V",
|
|
1489
|
-
"Th",
|
|
1490
|
-
"S_Z",
|
|
1491
1487
|
"B_M_P",
|
|
1488
|
+
"Ch_J",
|
|
1489
|
+
"EE",
|
|
1490
|
+
"Er",
|
|
1491
|
+
"F_V",
|
|
1492
|
+
"Ih",
|
|
1492
1493
|
"K_G_H_NG",
|
|
1493
|
-
"
|
|
1494
|
-
"R"
|
|
1494
|
+
"Oh",
|
|
1495
|
+
"R",
|
|
1496
|
+
"S_Z",
|
|
1497
|
+
"T_L_D_N",
|
|
1498
|
+
"Th",
|
|
1499
|
+
"W_OO"
|
|
1495
1500
|
];
|
|
1496
1501
|
var VISEME_JAW_AMOUNTS = [
|
|
1497
|
-
0.
|
|
1498
|
-
// 0:
|
|
1502
|
+
0.75,
|
|
1503
|
+
// 0: AE
|
|
1499
1504
|
0.8,
|
|
1500
1505
|
// 1: Ah
|
|
1501
|
-
0
|
|
1502
|
-
// 2:
|
|
1503
|
-
0.5,
|
|
1504
|
-
// 3: OO
|
|
1505
|
-
0.2,
|
|
1506
|
-
// 4: I
|
|
1507
|
-
0.5,
|
|
1508
|
-
// 5: U
|
|
1509
|
-
0.4,
|
|
1510
|
-
// 6: W
|
|
1506
|
+
0,
|
|
1507
|
+
// 2: B_M_P
|
|
1511
1508
|
0.3,
|
|
1512
|
-
//
|
|
1513
|
-
0.
|
|
1514
|
-
//
|
|
1515
|
-
0.
|
|
1516
|
-
//
|
|
1509
|
+
// 3: Ch_J
|
|
1510
|
+
0.2,
|
|
1511
|
+
// 4: EE
|
|
1512
|
+
0.35,
|
|
1513
|
+
// 5: Er
|
|
1517
1514
|
0.1,
|
|
1518
|
-
//
|
|
1519
|
-
0,
|
|
1520
|
-
//
|
|
1515
|
+
// 6: F_V
|
|
1516
|
+
0.2,
|
|
1517
|
+
// 7: Ih
|
|
1521
1518
|
0.35,
|
|
1522
|
-
//
|
|
1523
|
-
0.
|
|
1524
|
-
//
|
|
1525
|
-
0.35
|
|
1526
|
-
//
|
|
1519
|
+
// 8: K_G_H_NG
|
|
1520
|
+
0.6,
|
|
1521
|
+
// 9: Oh
|
|
1522
|
+
0.35,
|
|
1523
|
+
// 10: R
|
|
1524
|
+
0.1,
|
|
1525
|
+
// 11: S_Z
|
|
1526
|
+
0.3,
|
|
1527
|
+
// 12: T_L_D_N
|
|
1528
|
+
0.15,
|
|
1529
|
+
// 13: Th
|
|
1530
|
+
0.5
|
|
1531
|
+
// 14: W_OO
|
|
1527
1532
|
];
|
|
1528
1533
|
var isMixedAU = (id) => {
|
|
1529
1534
|
const morphs = AU_TO_MORPHS[id];
|
|
@@ -2043,7 +2048,7 @@ var HairPhysicsController = class {
|
|
|
2043
2048
|
this.clearRegisteredHairObjects();
|
|
2044
2049
|
const result = [];
|
|
2045
2050
|
for (const obj of objects) {
|
|
2046
|
-
if (obj
|
|
2051
|
+
if (obj instanceof Mesh) {
|
|
2047
2052
|
const mesh = obj;
|
|
2048
2053
|
this.registeredHairObjects.set(mesh.name, mesh);
|
|
2049
2054
|
const meshInfo = CC4_MESHES[mesh.name];
|
|
@@ -2119,7 +2124,7 @@ var HairPhysicsController = class {
|
|
|
2119
2124
|
}
|
|
2120
2125
|
} : this.hairPhysicsConfig.morphTargets;
|
|
2121
2126
|
this.hairPhysicsConfig = { ...this.hairPhysicsConfig, ...config, direction, morphTargets };
|
|
2122
|
-
const
|
|
2127
|
+
const idleKeys = [
|
|
2123
2128
|
"idleSwayAmount",
|
|
2124
2129
|
"idleSwaySpeed",
|
|
2125
2130
|
"windStrength",
|
|
@@ -2128,14 +2133,16 @@ var HairPhysicsController = class {
|
|
|
2128
2133
|
"windTurbulence",
|
|
2129
2134
|
"windFrequency",
|
|
2130
2135
|
"idleClipDuration"
|
|
2131
|
-
]
|
|
2136
|
+
];
|
|
2137
|
+
const idleChanged = idleKeys.some((key) => config[key] !== void 0);
|
|
2132
2138
|
const morphTargetsChanged = config.morphTargets !== void 0;
|
|
2133
2139
|
const directionChanged = config.direction !== void 0;
|
|
2134
|
-
const
|
|
2140
|
+
const impulseKeys = [
|
|
2135
2141
|
"stiffness",
|
|
2136
2142
|
"damping",
|
|
2137
2143
|
"impulseClipDuration"
|
|
2138
|
-
]
|
|
2144
|
+
];
|
|
2145
|
+
const impulseChanged = impulseKeys.some((key) => config[key] !== void 0);
|
|
2139
2146
|
const gravityChanged = morphTargetsChanged;
|
|
2140
2147
|
if (idleChanged || morphTargetsChanged) {
|
|
2141
2148
|
this.idleClipDirty = true;
|
|
@@ -2276,7 +2283,7 @@ var HairPhysicsController = class {
|
|
|
2276
2283
|
if (state.position) {
|
|
2277
2284
|
obj.position.set(state.position.x, state.position.y, state.position.z);
|
|
2278
2285
|
}
|
|
2279
|
-
if (state.color && obj.material) {
|
|
2286
|
+
if (state.color && obj.material && !Array.isArray(obj.material)) {
|
|
2280
2287
|
const mat = obj.material;
|
|
2281
2288
|
if (mat.color) {
|
|
2282
2289
|
mat.color.set(state.color.baseColor);
|
|
@@ -2654,35 +2661,29 @@ var HairPhysicsController = class {
|
|
|
2654
2661
|
};
|
|
2655
2662
|
|
|
2656
2663
|
// src/mappings/resolveProfile.ts
|
|
2657
|
-
var
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
}
|
|
2661
|
-
return item;
|
|
2662
|
-
});
|
|
2664
|
+
var isPlainObject = (value) => {
|
|
2665
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2666
|
+
};
|
|
2663
2667
|
var cloneValue = (value) => {
|
|
2664
2668
|
if (Array.isArray(value)) {
|
|
2665
|
-
return
|
|
2669
|
+
return value.map((item) => cloneValue(item));
|
|
2666
2670
|
}
|
|
2667
|
-
if (value
|
|
2671
|
+
if (isPlainObject(value)) {
|
|
2668
2672
|
return { ...value };
|
|
2669
2673
|
}
|
|
2670
2674
|
return value;
|
|
2671
2675
|
};
|
|
2672
2676
|
var mergeRecord = (base, override) => {
|
|
2673
|
-
if (!override) {
|
|
2674
|
-
const next2 = {};
|
|
2675
|
-
for (const [key, value] of Object.entries(base)) {
|
|
2676
|
-
next2[key] = cloneValue(value);
|
|
2677
|
-
}
|
|
2678
|
-
return next2;
|
|
2679
|
-
}
|
|
2680
2677
|
const next = {};
|
|
2681
2678
|
for (const [key, value] of Object.entries(base)) {
|
|
2682
2679
|
next[key] = cloneValue(value);
|
|
2683
2680
|
}
|
|
2684
|
-
|
|
2685
|
-
|
|
2681
|
+
if (override) {
|
|
2682
|
+
for (const [key, value] of Object.entries(override)) {
|
|
2683
|
+
if (value !== void 0) {
|
|
2684
|
+
next[key] = cloneValue(value);
|
|
2685
|
+
}
|
|
2686
|
+
}
|
|
2686
2687
|
}
|
|
2687
2688
|
return next;
|
|
2688
2689
|
};
|