Can't Attach to Socket after Mesh Merge - packaged builds only

I’m using the Mesh Merge from here: http://ue4.su/en-US/Engine/Animation/WorkingwithModularCharacters/index.html, with a few gaps filled in by an old stack overflow post I found.

Everything works perfectly in the editor, and almost everything works in packaged builds. My character’s weapon/shield sockets don’t seem to exist (or does it?) in the packaged game however. Whenever I equip something, it just goes to the base of the capsule (ie, sword/shield between feet).

I’ve spent more than a day reading source code and trying different things and I’m really stuck. Master pose wasn’t working because it didn’t like my active physics animations (head kept falling off).

edit: if I print the location of the sockets in question, its the same result as if i print the location of a non-existant socket: just the spot between the feet (probably the 0,0 of the capsule). If I print the names of every socket, the socket does appear however. If I print its parent’s name via the GetSocketBoneName node, it displays the correct bone, and the location of that bone does move according to the character’s movement. The socket just does not move.

In my project i save all sockets params to struct variable Attach meshes to bone name and set relative transform

Did you ever get to the bottom of this? Having the same issue where skeleton sockets are placed in the root after merging meshes.

I switched to master pose.

I ran into the exact same problem and found a proper fix; call USkeletalMesh::RebuildSocketMap() on the mesh you create from FSkeletalMeshMerge::DoMerge()

4 Likes

Awsome! That worked for me as well! Thank you very much!

Glad to hear it! Good luck!

Thanks for this!!!

Perfect solution, exactly what I need ! You answere is better than other

BearInATie can you share more details about how did you solve this? I’m stuck…

Okay figured out and it worked! Thank you for that BearInATie!

BaseMesh->RebuildSocketMap();
return BaseMesh;

Hi, I work with BP, my C++ skills are by all means non existent, I just copied the code and followed ue4’s tutorial on how to merge skeletal meshes, but I have the same problem and not the slightest clue on how to implement this fix, could someone show a screenshot of the code, or copy/paste it here, so that us, simple BP people like me can know how to implement it? Would appreciate it very much! :slight_smile:

timV

In case you didn’t figure the out yet.
Like mentioned above you will paste code on around Line 123 in your mesh merge function library cpp file.

BaseMesh->RebuildSocketMap();

It should be pasted right above “return BaseMesh;”

Thanks a lot! I will give it a try directly. Should be added to the official “modular characters” documentation of unreal engine.

apologies for the late reply. Thank you very much I will try it right away :smiley:

you saved my life!
from 2022 07

Wondering if anyone here could help me.

I added the line
BaseMesh-> RebuildSocketMesh();
before the line “return BaseMesh” as was suggested, but it hasn’t fixed the issue. I am wondering if it has something to do with the fact my bones are not properly applying to the mesh.