@sage-rsc/talking-head-react 1.4.6 → 1.4.7
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 +769 -764
- package/package.json +1 -1
- package/src/lib/talkinghead.mjs +13 -0
package/package.json
CHANGED
package/src/lib/talkinghead.mjs
CHANGED
|
@@ -5760,6 +5760,7 @@ class TalkingHead {
|
|
|
5760
5760
|
// Filter and map animation tracks
|
|
5761
5761
|
const mappedTracks = [];
|
|
5762
5762
|
const unmappedBones = new Set();
|
|
5763
|
+
let filteredShoulderTracks = 0;
|
|
5763
5764
|
anim.tracks.forEach(track => {
|
|
5764
5765
|
// Remove mixamorig prefix first
|
|
5765
5766
|
let trackName = track.name.replaceAll('mixamorig', '');
|
|
@@ -5770,6 +5771,14 @@ class TalkingHead {
|
|
|
5770
5771
|
// Map bone name to avatar skeleton
|
|
5771
5772
|
const mappedBoneName = mapBoneName(fbxBoneName);
|
|
5772
5773
|
|
|
5774
|
+
// Filter out shoulder rotation tracks - we'll control shoulders manually
|
|
5775
|
+
if (mappedBoneName && (mappedBoneName === 'LeftShoulder' || mappedBoneName === 'RightShoulder')) {
|
|
5776
|
+
if (property === 'quaternion' || property === 'rotation') {
|
|
5777
|
+
filteredShoulderTracks++;
|
|
5778
|
+
return; // Skip this track - don't add it to mappedTracks
|
|
5779
|
+
}
|
|
5780
|
+
}
|
|
5781
|
+
|
|
5773
5782
|
if (mappedBoneName && property) {
|
|
5774
5783
|
// Create new track with mapped bone name
|
|
5775
5784
|
const newTrackName = `${mappedBoneName}.${property}`;
|
|
@@ -5797,6 +5806,10 @@ class TalkingHead {
|
|
|
5797
5806
|
}
|
|
5798
5807
|
});
|
|
5799
5808
|
|
|
5809
|
+
if (filteredShoulderTracks > 0) {
|
|
5810
|
+
console.log(`✓ Filtered out ${filteredShoulderTracks} shoulder rotation track(s) to prevent high shoulders`);
|
|
5811
|
+
}
|
|
5812
|
+
|
|
5800
5813
|
if (unmappedBones.size > 0) {
|
|
5801
5814
|
console.warn(`⚠️ ${unmappedBones.size} bone(s) could not be mapped:`, Array.from(unmappedBones).sort().join(', '));
|
|
5802
5815
|
}
|