Issues using SkeletalMeshMerge to merge meshes inside the editor

wolflow94
Sun, 08 Mar 2020 09:52:26 +0000
C++

Hello everyone,
lately I tried to create a little tool to merge two skeletal meshes inside the editor. Basically I tried to use the skeletal Merge Mesh feature described here ( Working with Modular Characters | Unreal Engine Documentation ) but at editor time, and I tried to add the ability to save the created skeletalMesh as a package.

The code I use is very similar to the one shown in the documentation above. With some addition to make a package and create the skeletal mesh using this package so that it appears in the content browser / could be serialized on disk.

Everything seemed to work perfectly fine. I managed to run this code in the editor and got my skeletal meshes merged correctly. But that’s were the problems begin : The generated SkeletalMesh can’t be loaded by the engine. When I generate the mesh, put it on the map, close the editor and re-open it, it will crash.
The crash happens during the loading/initialization of the new mesh. The engines is complaining because it doesn’t find any LODInfo in the skeletalMesh. From what I see, those LODInfo where present before I close the editor. So I think that the SkeletalMergeMesh feature doesn’t generate all the required info to make the skeletal mesh completely viable.

Here are some screen of the warning and error during the mesh initialization when I re-open the editor :

I also noticed that the generated mesh doesn’t have anything in the Sections/ tab in LOD 0 :

Does anyone has any clue on what’s going on here ? I don’t know if it’s a “bug” or if it’s by design. Could be by design since this skeletal mesh merger is designed to merge meshes at runtime.
Do you know what this “Sections” section related about ? Is it the “TArray<FSkelMeshRenderSection> RenderSections;” in FSkeletalMeshLODRenderData ? If so, I’m pretty sure the Mesh merger is generating those. So I don’t know why they doesn’t appear in the editor.
It’s kind of frustrating to see the mesh working as intented but not being able to serialize/deserialize it properly so it remains “inaccessible” ^^.

Have a great day.

15 posts - 9 participants