Create a procedural mesh at runtime and apply morph targets

Hi all!

I wonder if anyone can help me. I’m rather new to UE4 so please correct any misapprehension I have about how things work!

I am currently trying to create a unique mesh at runtime (from a set of data) to which I can apply morph targets. Currently I have created a mesh at runtime using the procedural mesh component - however, I understand that this does not permit morph targets. As I understand it, skeletal meshes take morph targets but cannot be procedurally generated at runtime. Static meshes can also use morph targets by packing them into the uv channels and offsetting the world pixel position on the material. But these also can’t be generated at runtime. I have been exploring the idea of calculating the vertex world position offset and then somehow passing this to the material (similar to the static mesh morph target approach). Or, alternatively, rebuilding the procedural mesh section with the new vertex positions each frame. Neither of these approaches seem particularly good though.

Another alternative I have considered is having a generic skeletal mesh in the project, then creating a morph target at runtime and applying it to the generic skeletal mesh. I can then apply the other morph targets I want on top of this. However, as far as I can see, it’s not possible to create a morph target at runtime. (Does anyone know if this is possible?)

Does anyone have a good approach to procedurally generating a mesh at runtime and applying morph targets to it?