# Merging Multiple Morph Targets in readyPlayerMe avatars

**URL:** <https://discourse.threejs.org/t/merging-multiple-morph-targets-in-readyplayerme-avatars/25778>\
**Category:** Questions\
**Tags:** morph-targets\
**Created:** [April 28, 2021, 12:36pm UTC](https://discourse.threejs.org/t/merging-multiple-morph-targets-in-readyplayerme-avatars/25778 "2021-04-28T12:36:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_S](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/john_s/32/17329_2.png) [@John\_S](https://discourse.threejs.org/u/John_S)\
**Post date:** [April 28, 2021, 12:36pm UTC](https://discourse.threejs.org/t/merging-multiple-morph-targets-in-readyplayerme-avatars/25778/1 "2021-04-28T12:36:48Z")

</div>

**Problem**  
readyPlayerMe avatars come with 63 facial morphTargets. Animating an expression on THREE.js requires tweening many of these simultaneously, e.g. surprise - “jawOpen”, “eyeWideLeft”, “eyeWideRight”, “browOuterUpLeft”…etc. This is cumbersome (especially with multiple avatars) and doesn’t work well as the number of morphTargets increases above 3.

**Desired Solution**  
Is there a way to create new morphTargets by merging those which ship with the avatar? i.e. create a 64th “surprise” morphTarget which equals “0.8 x jawOpen” + “0.5 X eyeWideLeft” + …etc.? Blender has a “New Shape From Mix” function that does exactly this.

Research so far has drawn a blank, and numerous attempts to manually add to morphAttributes have been unsuccessful. Any help would be much appreciated,

John

---

<div class="post-metadata">

**Author:** ![John\_S](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/john_s/32/17329_2.png) [@John\_S](https://discourse.threejs.org/u/John_S)\
**Post date:** [April 29, 2021, 8:05am UTC](https://discourse.threejs.org/t/merging-multiple-morph-targets-in-readyplayerme-avatars/25778/2 "2021-04-29T08:05:21Z")

</div>

**Solved!**  
Finally figured it out. It’s a manual workaround but it does the job. Here’s the solution if anyone else is facing the same issue:

1. Create new Float32BufferAttributes for position and normal with one of the existing morphs which make up the desired new expression (e.g. 45 is “jawOpen” in this case"):  
`const newMorphTargetPosition = new THREE.Float32BufferAttribute( mesh.geometry.morphAttributes.position[45].array, 3 )`  
`const newMorphTargetNormal = new THREE.Float32BufferAttribute( mesh.geometry.morphAttributes.position[45].array, 3 )`

2. Add these to the morphAttributes arrays:  
`mesh.geometry.morphAttributes.position = [...mesh.geometry.morphAttributes.position, newMorphTargetPosition]`  
`mesh.geometry.morphAttributes.normal = [...mesh.geometry.morphAttributes.normal, newMorphTargetNormal]`

3. Give it a name and index:  
`mesh.morphTargetDictionary['surprise'] = 63`

4. Append a value to morphTargetInfluences:  
`mesh.morphTargetInfluences = [...mesh.morphTargetInfluences, 0]`

Now you can add other morphs on top by element-wise adding their position and normal arrays to this new morph 🙂

If anyone has a more elegant solution please let me know!

John

---

<div class="post-metadata">

**Author:** ![reza\_zendehdel](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/reza_zendehdel/32/32772_2.png) [@reza\_zendehdel](https://discourse.threejs.org/u/reza_zendehdel)\
**Post date:** [January 24, 2023, 1:35pm UTC](https://discourse.threejs.org/t/merging-multiple-morph-targets-in-readyplayerme-avatars/25778/3 "2023-01-24T13:35:18Z")

</div>

Hello sir  
I have a question  
I imported readyplayer glb file in Blender. But only Openmouth and Smile blendshapes are shown to me. How can i see other blendshapes? Is there any way to figuring out what are other belndshapes?
