Workflow for modular characters for things like skinning, physicsassets, rigid bodies, etc?

Hi! So I am trying to figure out how I would go on about making separate parts of my character that can go together (aside from the production aspect in other software, that part I got covered).
I just can’t seem to quite put my finger on what UE4 would actually expect you to do.
For instance, I have a belt with a lantern with a physicsasset/rigidbody on it (letting the lantern sway). I wish to give the option to have my character wear it.
I could just spawn and attach it to the hip bone of my character. But then the belt wouldn’t be skinned to the bones and deform with the character.
I *could *skin it to the skeleton in my modeling software and just add it to the character BP, but that means I have the instance of the character animating to one skeleton and the instance of the belt animating to another, with twice the animation data and skeletons running around together that just happens to match up.
Lot’s of systems like adding parts with rigidbodies to your character seems to presume that they will all be there from the start so that you just add them to the character as is.
I’m really struggling to find info on how to do these things in more modular ways without them being tacky/hacky methods that look ok then and there but are just a mess that’s bound to break.

I remember that having a lot of animating skeletal meshes were super expensive back in the UDK days, but maybe that’s changed?

Edit: I found this, but a lot of my questions still stand.

In this example, would I skin the belt to the skeleton, and import it as a skeletal mesh?

Eh, no.
not unless you want to have/end up with a bunch of worthless situational bones on your skeleton that will make everything painful.

modular meshes work with the master pose component but to do that, they require the same skeleton.

To attach something like a lantern, that the charater may or may not directly interact with and allow for its own animation you use a socketed mesh.
so you split the belt and the lantern out, adding the lantern to a socket where it is free to do its thing.

Some things are more convinent when added to the skeleton. A Hat bone for instance, so that you can animate the hat grab and putting it on.
or weapon bones, much for the same reason.
This is Mostly true for objects that cannot necessarily just be attached.
the example of the hat being a bad one, and the perfect variation being a hooded robe that needs to use self collision+cloth and thus requires the object to be one piece.

So, essentially, anything with extra bones that you need no directly animated control of can be socketed to a specifically created bone.
including weapons which happen to run in tandem with abimations.

anything that needs to run along with the character is an extra mesh plugged into master pose component at begin play.

You can easily exceed 20 meshes on main char without even blinking :stuck_out_tongue_winking_eye:

Also, let’s not forget that although still new, Control Rig was built precisely to accuratrly animate socketed meshes with extra bones?
check out the Claw example (from like 8 months ago, so old stuff).

Alright, so say I make the lantern mesh seperate. Fair enough, it can do it’s own physics thing.
But with for instance a piece of clothing, how do I get it to deform correctly without skinning it? Or do I skin it to only the necessary bones, and remove those bones from everything else?

So if I have some shirt and pants meshes, the pants would be skinned to the leg bones, and imported, and the shirt bould be skinned to the torso bones, then imported? Or something else?

As I mentioned with the hooded robe, full pieces of clothing that usually replace the mesh parts and need the full skeleton plus the master pose component hookup.

because of the way cloth works (currenly) you have almost no hope of preventing penetration of the underlying mesh with bckkstop/backstop radius. So you likely want to remove/replace that mesh in lieu of one that contains both items…

Let me give you a proper example of that.

I have a naked character as base with the following modular pieces:

2 arms, 2 shoulder, head, chest, pelvis, 2 legs

Now let’s say that I want to put on a kilt (thats a skirt).

to get something that truly works, without penetration of underlying mesh and clipping on the legs, ill want to replace the legs out to a mesh that doesn’t really reach all the way to the pelvis. Then, the pelvis will be swapped out with a mesh that contains the kilt, the thighs, and the pelvis.

ideally, the new kilt mesh needs to all be one material, so that you can import the kilt vertex paint to allow for the cloth, and at the same time you can use self collision with the thighs to prevent penetration and clipping.

As far as skinning goes, to re-re-re- state it. You need to use the whole skeleton for the master pose component node to work.

So I skin the object as if was the whole character, but use the existing skeleton on import?

What about parts that need additional bones?

Am example of such a part?

Say for instance something like this:

What if the head part is something that the player chooses and adds later, and doesn’t conform to the standard skeleton setup.

Well, then the head can be socketed and have its own animation set.
what you give up is the ability to move/articulate neck and shoulders on the bust - OR - you just cut the head further up to under the neck where the seam is also somewhat hidden.
That enables you to socket a whole different head, and because it is socketed to the last bone in the chain head it will follow flawlessly including all rotations.

Make sense?

I should add that, mostly I cut the head as a bust because I need the skin to show up under shirts, and I do not want to spend a year making assets for the games.
Having the neck be part of the shirt would mean having to at the very least parameterize the skin as part of every clothing item so that It too can be swapped.
I may end up doing that anyway, but for now the bust is what I find best.

Ah, so in such cases you would expect 2 skeletons that are attached together?

Yes, especially if id expect the object to react to the environment on its own. (Even if you can just apply phys animation to the character).

Thank you so much, you’ve illuminated a lot of things I’ve been unsure about for a long time!

Since I got this running correctly I figured I’d share an example what what works well as a PHAT asset but not as clothing:

This (al-tough still not unwrapped in some areas) is made specifically to be socketed to the pelvis (which has a -90 rotation just to make you want to cry when you edit the PHAT).
The settings in the Phat provide an individualized simulation with a much better result than cloth.
The character mesh has been given 2 specific collision capsules socketed to the thighs in order for the simulation not to clip (too much) into clothing and other parts.

How does the belt section deform with character animation? Can you use skinning for kinematic parts?

Also, how are you using collision capsules for your character mesh? Did you add them as components rather than a part of the character’s PHAT? Or did you manage to get your asset to collide with the character’s physics asset?

It’s correctly colliding with the character PHAT asset.
what I did was create a new collision channel called Apparel, and I made the default for it collide with everything except pawn.
My character has a complex setup (in up to 20 modular parts). But the PHAT on the main Mesh is the one responsible for preventing interpeneration (to the extent that contranits on the belt PHAT allow for.

In this case, the belt mesh does not deform along with the character. Out of choice. Afterall its set to be placed above a Lorica Segmentata, so it shouldn’t be moving or displacing/stretching at all if not for following the pelvis.

The character has a system for ragdolling in place, and i believe also some physical animation (or at the very least the component should be present and set up even if not active).
That may partially be responsible for the phat collision.

However the collision channel is the part that matters most. Since the capsule component has to be ignored (and thats set to pawn by default).

obviously, unlike cloth, this method ignores wind directional sources by default.
I’m trying to figure out a way around this - or to provide phat collision for the default cloth.
Though honestly I think that as soon as it pops out of beta I’ll be migrating off to Chaos/niagara on most things.
Yes the phat collision is nice (and will probably work better when chaos is out? maybe even enough to allow including wind?) But chaos offers a variety of cloth solvers that may actually just provide an easier workflow.

As things are, even if I re-factor everything to include the cingulum and the legs, the cloth asset would reach the maximum of 16 collisions and just stop working.
And thats why I’m looking at chaos.

I guess the alternative is a 72 or more skeletal mesh of the skirt that sort of approximates cloth movenent with cloth on it set to a maximum distance of 2 or 3cm.
I’m not really looking forward to that option either :stuck_out_tongue:

Just wanted to share.

the assets im using, particularly the pertuges, which is essentially a skirt made of bones kept having all sorts of issues when animating (obviously).

Being it isn’t rigged to the thighs it kept on relying on collisions, and twitching around during various poses.
This can be ok on some models, but once I added the actual cloth under the leather parts it become very problematic since you could really see the whole thing twitching about.

In this case, the answer was to use Control Rig to create proper constraints that allow the front of the skirt to move along with the base asset.

I doubt mentioning it will make a difference to a lot of folks, but there it is anyway.

The benefit is that the clothing is still fully modular but it does not require adding bones to the base skeleton.