Blender to UE4 - parent buttons to shirt vertices?

Hi, helpful people. I’ve modelled a character and used MakeHuman’s default rig, which despite extreme modifications has held up really well and I’m thrilled with the results for the most part. However, nearing the final stages, I would like to add some buttons to his clothes. In my (limited) experience, what works best is to parent these to already rigged vertices that are part of the clothes. However, though this looks great in Blender, UE4 does not seem to import any meshes that are parented this way when I try. It could be an export problem as well but I don’t know how to test that.

Here’s my outliner in Blender. I’m new to Blender and not really too familiar with character-rigging, so it’s probably done wrong.
cca46eb72d075daaa1715f0483ffe6b93030e99b.jpeg

I found my method here:

Thank you, whoever.

I would Join them with the piece of clothing (mesh) they’re attached to and assign them to the same vertex group. If you want to keep them separate for some reason you can use sockets in the engine and add them in your blueprint instead.

Thanks. I thought about that but is there a way to make sure that they don’t deform but also don’t get ‘eaten’ by the waistcoat when he bends forwards? That’s usually why people recommend parenting the entire object to a vertex (or three, which is effectively a triangle), but I can’t find the method used for games. I imagine it’s always been done with textures until recently, but I have the geometry to spare and would like to do it this way if possible.

Regarding the socket method, I thought about that as well but I can’t think of a way they wouldn’t get swallowed inside the waistcoat when it deforms. Also, what’s the performance impact of extra sockets? negligible?

If they’re rigged to the same bone they will move with the clothes. You didn’t say how your rig is setup so I can only guess, but I would think you would get an opposite problem (doing the way I said), the buttons would move more than the mesh using 1.000 vertex weights for the buttons to the cloth bones. What you can do is create an extreme pose, then make sure the armature modifier is visible in edit mode and then manually set the weights for each button separately so they’re right on top of the mesh. That way they will move perfectly with the clothes.

You don’t have to worry about the performance impact of sockets.

Right, the buttons would move more, which is why they’d go inside the waistcoat when part of it deforms only somewhat. I’m trying to do this since 2015 (on and off, mind, not continuously) and every time I’ve attempted it in any way that didn’t involve parenting the buttons to vertices, the buttons would end up inside the waistcoat during a lot of animations.

What would you like to know about my rig? I put the full rig in the outliner in the screenshot hoping it would answer any questions but I’m still new to this area of modelling and Blender so I may have missed something. What I did was I made a MakeHuman character using their Game Engine rig, and imported it into Blender. It had individual meshes/objects for the Body, Suit, Eyes, Hair, and Shoes. I kept the full body intact for weight transferring during the modelling process, but have not been exporting it into UE4. I’ve duplicated the body mesh and deleted all but the head, and that head is what’s been going into the engine. So, for the rest of the individual objects as you see them in the outliner, most were once faces from the body mesh that I duplicated and edited (moustache for example, is a piece of his face that was resized to be a rectangle and then retextured and duplicated several times to make hair cards), which preserves the weights.

Regarding your suggestion, I’m not sure I understand it. Let’s say I bend him forwards all the way, then place the button where it should be in that pose and paint it. Well, when he moves upright, what’s to stop the button being too far away from the mesh?

If I took my single favourite vertex (though I’d prefer three, but I don’t see that working) that I’d parented a button to, copied its weights, and then pasted them onto every single vertex of the relevant button, what sort of results would that produce, do you think?

Thanks again for your help.

This is a matter of pivot points. If your button is on the cloth (which it should be) if it’s correct bent forwards it will be correct bent backwards assuming the weights are similar.

It would give you the results that you want, the buttons following the mesh properly. Fortunately there’s an easy way to do this (if your meshes are in the same object), you select the button, then select a vertex on the cloth right behind the button and press the Copy button under Vertex Weights in the N panel. Your buttons may clip backwards into the cloth slightly but this should be unnoticable since you don’t really see the back of the button anyway.

I made a small example .blend file showing this: Legobet88 – Agen Situs Slot Gacor Online Hari Ini Paling Gampang Maxwin & Terpercaya 2024 di Bet88

The button row at the middle is just weighted 100% to the bones so it can be seen as a rigid rig, something you would use for armor. The row at the edge to the right was weighted using the “select button using select linked, copy vertex weights by copying cloth weight” method. The row at the left is weighted again 100% to the bones but where the cloth is deforming smoothly so it looks bad. You can try fixing this yourself though to make it look like the button row at the right.

1 Like

You’re right! It worked! Took me a while to get back to you as I had to retopologise a bit to make sure there was a vertex directly behind each button (whereas with the previous method, I was using three, so it didn’t matter as much). Thanks a million. I’m thrilled it was that easy to copy the weights as well. And not least of all, thanks for going to such lengths as to make me a .blend file. Really appreciate that. I was worried that your advice may not work so well for me once I seen the 22K poly count of your file, but it works as well as my vertex-parenting method did, and is sure to be recognised by the the engine. Cheers.