Persisting a Bone Rotation During Character Animation


I posted a reply to a solved issue at the following link: Unable to apply rotation to a Bone, but its TransformNode works

Since the original issue in the thread was solved, to avoid this from being buried, I’m reposting the issue and solution here should this be helpful to someone with the same issue. Following is the issue:

Is there a way to maintain this rotation though on an animated character?
For example, if this rotation is applied then an idle animation is played, the animation overtakes the rotation applied. Is there a weight that can be applied to the rotation to allow it to apply while an animation is playing (i.e. to create the effect of the character looking sideways while the idle animation is playing)?
See the current result that I’m getting when applying the rotation, then playing an animation a few seconds later:
test rpm (1)

Here’s the solution that works:

Before playing the animation. removing the neck animations within the _targetedAnimations array (inside the AnimationGroup) allows the rotation to persist. See the following code snippet:

animation._targetedAnimations = animation._targetedAnimations.filter(tAnim => != "Neck");

Thanks to some insights shared by Kyle Wetton at the following link: How to Create an Interactive 3D Character with Three.js | Codrops

1 Like