Mesh Generation: ProceduralMeshComponent to StaticMesh / StaticMeshActor at run-time

I’m currently using Blueprint scripting to generate meshes from a list of vertices using the ProceduralMeshComponent. The algorithm is working as intended.


However, I am looking to convert the ProceduralMeshComponent to a StaticMesh or StaticMesh actor at run-time but it doesn't seem to be possible to do this with blueprints.
You can do this conversion in editor with the use of the 'Create StaticMesh' button in the Details Panel under the ProceduralMeshComponent. I attempted to leverage some of the source code behind this button to create a custom component. However, there were numerous problems using `RawMeshData` and `RawMesh`.
This code for this can be found in the ProceduralMeshComponentDetails.cpp file in the following function:
`FProceduralMeshComponentDetails::ClickedOnConvertToStaticMesh`




I was wondering if anyone else has found a solution for this problem.

Thanks,

Bump here
I’m looking for the same

Interested too, looking for implementation. Much more interesting if this is really possible to do in runtime. So it looks like transfering Editor’s code stuff into runtime plugin or class, sometimes it’s not possible.

More further questions appear: how to store new assets and so on. In theory this can lead a huge problems with storage if player will generate many-many meshes. And how it could be implemented for online games, replication and so on.

Many troubles from just an idea =)