What this does? Mesh.GetBlendShapeFrameVertices

So I’m combining skinned meshes at runtime, now everything is working, except for the blend shapes from the head mesh not being saved(or get lost),
So now I’m finding a way to somehow save blendshapes from mesh parts first BEFORE combining them, so I can then save it to the new combined mesh.
I saw this function Mesh.GetBlendShapeFrameVertices
looks like can help me do the job, but this function doesn’t return a value or something? I don’t know what this does?
There’s also this function Mesh.AddBlendShapeFrame

Isn’t the documentation quite clear what the method does?


shapeIndex      The shape index of the frame.
frameIndex      The frame index to get the weight from.
deltaVertices   Delta vertices output array for the frame being retreived.
deltaNormals    Delta normals output array for the frame being retreived.
deltaTangents   Delta tangents output array for the frame being retreived.


Retreives deltaVertices, deltaNormals and deltaTangents of a blend shape frame.

deltaVetrices, deltaNormals and deltaTangents arrays must be of size = Mesh.vertexCount.
Add Mesh vertices, normals or tangents to convert from frame deltas to full vectors.
deltaNormals or deltaTangents may be set to null if there is no normals or tangents to be
retreived for a frame.

So you simply have to pass the blendshape index and the frame index of the frame you want to retrieve. Furthermore you need to pass 3 arrays which will be filled with the data you’re interested in. The arrays have to be initialized with the vertexCount of the mesh, so each array has “vertexCount” elements.

Mesh.AddBlendShapeFrame basically does exacly the opposite. You have to pass the blendshape name and the blend weight along with the 3 arrays. This will add a new frame to a specific blendshape.

Of course when you combine two skinned meshes, you would need to merge the arrays from both meshes according to their vertices.