Any idea why this is happening? it works well in males, but in females its asif its not being recognized. We’re using the code base provided by yourselves:
import React, { useEffect, useRef, useState, useMemo } from ‘react’;
import { useGLTF } from ‘@react-three/drei’;
import { useAnimations } from ‘@react-three/drei’;
import { useRPMLipsync } from ‘…/…/hooks/useRPMLipsync’;
import { useHeadTracking } from ‘…/…/hooks/useHeadTracking’;
export function RPMCharacter(props) {
const { modelPath, animationPath } = props;
const { nodes, materials, scene } = useGLTF(modelPath);
const { animations } = useGLTF(animationPath);
const characterRef = useRef();
const { actions, mixer } = useAnimations(animations, characterRef);
const [animation, setAnimation] = useState(
animations.find((a) => a.name === ‘Idle’) ? ‘Idle’ : animations[0].name
);
const { client } = props;
useEffect(() => {
if (client?.isTalking) {
setAnimation(‘Talking’);
} else {
setAnimation(‘Idle’);
}
}, [client?.isTalking]);
useEffect(() => {
if (actions[animation]) {
actions[animation]
.reset()
.fadeIn(mixer.stats.actions.inUse === 0 ? 0 : 0.5)
.play();
return () => {
if (actions[animation]) {
actions[animation].fadeOut(0.5);
}
};
}
}, [animation]);
useRPMLipsync({ client, nodes, scene });
useHeadTracking({ client, nodes, RPM: true });
useEffect(() => {
if (nodes.EyeLeft && nodes.EyeRight) {
[‘EyeLeft’, ‘EyeRight’].forEach(eyeName => {
const eye = nodes[eyeName];
if (eye.morphTargetInfluences && eye.morphTargetDictionary) {
// Log available morphTargets for debugging
console.log(${eyeName} morphTargets:
, Object.keys(eye.morphTargetDictionary));
// Only reset specific eye-related morphTargets
const eyeTargets = {
'eyeBlinkLeft': 0,
'eyeBlinkRight': 0,
'eyeSquintLeft': 0,
'eyeSquintRight': 0,
'eyeWideLeft': 0,
'eyeWideRight': 0
};
Object.entries(eyeTargets).forEach(([targetName, defaultValue]) => {
const index = eye.morphTargetDictionary[targetName];
if (index !== undefined) {
eye.morphTargetInfluences[index] = defaultValue;
}
});
}
});
}
}, [nodes]);
// Add debug logging for client data
useEffect(() => {
console.log(‘Client state:’, {
isTalking: client?.isTalking,
headTracking: client?.headTracking,
client: client
});
}, [client]);
return (
<group {…props} dispose={null} ref={characterRef}>
<skinnedMesh
name="EyeLeft"
geometry={nodes.EyeLeft.geometry}
material={materials.Wolf3D_Eye}
skeleton={nodes.EyeLeft.skeleton}
morphTargetDictionary={nodes.EyeLeft.morphTargetDictionary}
morphTargetInfluences={nodes.EyeLeft.morphTargetInfluences}
bindMode="attached"
bindMatrix={nodes.EyeLeft.bindMatrix}
bindMatrixInverse={nodes.EyeLeft.bindMatrixInverse}
visible={true}
renderOrder={2}
/>
<skinnedMesh
name="EyeRight"
geometry={nodes.EyeRight.geometry}
material={materials.Wolf3D_Eye}
skeleton={nodes.EyeRight.skeleton}
morphTargetDictionary={nodes.EyeRight.morphTargetDictionary}
morphTargetInfluences={nodes.EyeRight.morphTargetInfluences}
/>
<skinnedMesh
name="Wolf3D_Teeth"
geometry={nodes.Wolf3D_Teeth.geometry}
material={materials.Wolf3D_Teeth}
skeleton={nodes.Wolf3D_Teeth.skeleton}
morphTargetDictionary={nodes.Wolf3D_Teeth.morphTargetDictionary}
morphTargetInfluences={nodes.Wolf3D_Teeth.morphTargetInfluences}
/>
</group>
);
}
// useGLTF.preload(‘/models/Elon.glb’);
// useGLTF.preload(‘/animations/eman_animations.glb’);