@sage-rsc/talking-head-react 1.5.7 → 1.5.9
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 +2 -2
- package/dist/index.js +0 -14
- package/package.json +1 -1
- package/src/lib/talkinghead.mjs +11 -0
package/dist/index.js
CHANGED
|
@@ -4415,20 +4415,6 @@ class Be {
|
|
|
4415
4415
|
* and rotation should be dampened to prevent freakishly high positions
|
|
4416
4416
|
*/
|
|
4417
4417
|
applyShoulderAdjustmentToBones() {
|
|
4418
|
-
if (!this.armature) return;
|
|
4419
|
-
const t = this.armature.getObjectByName("LeftShoulder"), e = this.armature.getObjectByName("RightShoulder");
|
|
4420
|
-
if (!t || !e) return;
|
|
4421
|
-
const n = new y.Euler(), i = new y.Quaternion(), s = 0.6, o = 0.7;
|
|
4422
|
-
if (t.quaternion) {
|
|
4423
|
-
n.setFromQuaternion(t.quaternion, "XYZ");
|
|
4424
|
-
const l = n.x;
|
|
4425
|
-
n.x > o ? n.x = s : n.x > s && (n.x = s + (n.x - s) * 0.2), Math.abs(n.x - l) > 0.01 && (i.setFromEuler(n, "XYZ"), t.quaternion.copy(i), t.updateMatrix(), t.parent ? t.matrixWorld.multiplyMatrices(t.parent.matrixWorld, t.matrix) : t.matrixWorld.copy(t.matrix));
|
|
4426
|
-
}
|
|
4427
|
-
if (e.quaternion) {
|
|
4428
|
-
n.setFromQuaternion(e.quaternion, "XYZ");
|
|
4429
|
-
const l = n.x;
|
|
4430
|
-
n.x > o ? n.x = s : n.x > s && (n.x = s + (n.x - s) * 0.2), Math.abs(n.x - l) > 0.01 && (i.setFromEuler(n, "XYZ"), e.quaternion.copy(i), e.updateMatrix(), e.parent ? e.matrixWorld.multiplyMatrices(e.parent.matrixWorld, e.matrix) : e.matrixWorld.copy(e.matrix));
|
|
4431
|
-
}
|
|
4432
4418
|
}
|
|
4433
4419
|
/**
|
|
4434
4420
|
* Update avatar pose deltas
|
package/package.json
CHANGED
package/src/lib/talkinghead.mjs
CHANGED
|
@@ -1656,8 +1656,18 @@ class TalkingHead {
|
|
|
1656
1656
|
* and rotation should be dampened to prevent freakishly high positions
|
|
1657
1657
|
*/
|
|
1658
1658
|
applyShoulderAdjustmentToBones() {
|
|
1659
|
+
// TEMPORARILY DISABLED - No arm/shoulder adjustments
|
|
1660
|
+
return;
|
|
1661
|
+
|
|
1659
1662
|
if (!this.armature) return;
|
|
1660
1663
|
|
|
1664
|
+
// Only apply shoulder adjustment when FBX animations are playing
|
|
1665
|
+
// This prevents interference with normal pose system (idle, wide, side, etc.)
|
|
1666
|
+
const isFBXPlaying = this.mixer && this.currentFBXAction && this.currentFBXAction.isRunning();
|
|
1667
|
+
if (!isFBXPlaying) {
|
|
1668
|
+
return; // Don't adjust shoulders during normal poses
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1661
1671
|
// Get shoulder bones directly from armature
|
|
1662
1672
|
const leftShoulderBone = this.armature.getObjectByName('LeftShoulder');
|
|
1663
1673
|
const rightShoulderBone = this.armature.getObjectByName('RightShoulder');
|
|
@@ -1671,6 +1681,7 @@ class TalkingHead {
|
|
|
1671
1681
|
// Natural relaxed shoulders: X rotation ~0.5-0.7 radians (much lower for natural look)
|
|
1672
1682
|
// High/stiff shoulders: X rotation ~1.5-1.8 radians
|
|
1673
1683
|
// We aggressively clamp to a very relaxed position
|
|
1684
|
+
// Only apply this during FBX animations to prevent high shoulders from animation data
|
|
1674
1685
|
const targetX = 0.6; // Target X rotation for relaxed, natural shoulders (radians) - lowered significantly
|
|
1675
1686
|
const maxX = 0.7; // Maximum allowed X rotation - lowered significantly
|
|
1676
1687
|
|