How to do Modular Characters with additive bones/animations for hair/jackets/caps?

I am researching the viability of a modular character creator for a fighting game. Unreal’s support for modular characters makes this look easy to get started, as far as the modular pieces syncing to the same skeleton and animations. But I would like additive animations for things like hair, jackets, capes (would be happy with hair only); which are all modular pieces and so not on all combinations of character outfits. I don’t know enough about Unreal to know how this works at a skeletal level, and if there is existing support for this behaviour. Also, I’ve been using Unreal’s defualt skeleton for my animations for workflow effeciency; and was wondering if adding bones to the skeleton would cause problems.

Note: I am using a keyframe animation style, as if 2D spites, so any kind of hair/cape simulation in real time is a no go.

2 Likes

Hi and welcome to the community. This is quite a complex topic, but I want to give you at least some useful information how we do this. So mesh component is a parent and it has the Animation Blueprint. All other component are placed on it and only follow main mesh animations (you can achieve that with SetMasterPoseComponent node).
If you need any other component to play animations on top of that main mesh, you can create it’s own animations blueprint and use CopyPose (then don’t add them in SetMasterPose).
You have it described here: Working with Modular Characters | Unreal Engine 4.27 Documentation

Regarding bones, you can have additional bones on all modular pieces, but don’t break main skeleton hierarchy and it will be fine. UE handles everything well as long as you only add bones, but don’t remove or change existing hierarchy.

Hope it helps, good luck with the system!

2 Likes

Thanks Sitiana. I just want to clarify a few things:
(1) Does the Master Skinned Mesh Component need to have all possible bones configurations, even when unused, or does the Master Pose Component add bones from the modular skeletal meshes to the master skeletal mesh? For instance, a skirt will have additional bones and animations for each pose.

(2) Can I add a skirt as a legs option with the SetMasterPoseComponent, or will this require me to use the CopyPose component, since these are not ‘separate’ animations, but additions to the same pose?

(3) I have been researching Texture Vertex Animation without bones for things like hair, and possibly cloths. But am unsure of how shader animation works within unreal; an attack pose will require different vertex animation to an idle pose, can I access this within the Animation Blueprint? Is CopyPose the correct node for this?

(4) Can I combine separate animations from things like hair and skirts into one animation to be used by the single mesh generated by Skeletal Mesh Merge? And do the limitations of a merged skeletal mesh make it less ideal for animation, such as facial animation (“you can only run one animation on the merged mesh and transferring Morph Targets to the merged mesh is not supported”, “If however, …once you have your Skeletal Mesh you can create your Morph Targets by calculating the FMorphTargetDelta between your base mesh and any morphs.”). If not, then for performance reasons, is it advisable to use both the MasterPose/CopyPose method, and generate a separate merged skeletal mesh to be used for LODs?

1 Like

Hi,

  1. No, master pose component can have basic skeleton without any additional bones. Master pose component then should only be used to play animations that are needed for the whole character, like walking, attack, etc.

  2. Sure you can put your skirt on legs (probably attach it to hip bone) and set it to follow master pose. If your skirt doesn’t require any additional animations Master Pose is good choice. If you want to play additional animations, then make it have it’s own animation blueprint and use copy pose.
    Copy pose is exactly for addition to main animation, as it will make your skirt follow main body animations and you will be able to add something else on top.

  3. I have never been trying to use normal and vertex animations together. For things like hairs and clothes I would rather use clothing and physics system. But in theory if you really want to do this with vertex animations, it’s probably possible to add such animation in material.
    But I wouldn’t do main animations as vertex, as it will be hard to create a system to switch between them and blend them together.

  4. I’m sorry, I have never been using Skeletal Mesh Merge. We just use separate Animation Blueprint for head, it has copy pose from the main body and we do all facial expressions in that animation blueprint. I think it would be hard to achieve such modular system with merging it to one skeletal mesh, especially if you want some parts to have it’s own animations.

3 Likes

Bumping my post to see if anyone can share experience with Skeletal Merged Mesh?

2 Likes

The whole unreal system doesnt support keyframing. Ever.

Animations in unreal are fluid and always interpolated, so wanting to “keyframe 2d style” automatically means, choose a different engine.

Additionally, unless a fighting game suddenly has a crowd of people or something similar that uses skeletal meshs and tanks pefromance, there are only ever 2 to 4 characters on screen.
As such, there is probably no need to optimize by mesh merge unless dealing with a mobile version and enven then its likely pointless now a days.

master pose component (or whatver it is called now which did change) simply makes it so that any mesh added to it utilizes the same animation the skeleton is using.
If the skirt has its own animation, then thats discarded…
If the skirt has additional bones (take for example a face with rigging), then the shared bones are overwritten while the additional ones do whatever else they are instructed to do.

2 Likes

Keyframed Animation: There was not much information about stepped keyframe animation other than a few forum posts from people struggling to get it to work in UE4. But I had no problem exporting a stepped animation with a ‘constant’ interpolation curve from blender to UE5; I added a simple keyframed attack animation to Unreal’s default 3rd person blueprint without any trouble.

MergedMeshes: Secondly, this is an arena fighter with mobs of enemies, which will absolutely benefit from merged skeletal meshes, as would a social hub world that, while outside of combat, would be populated with NPCs and other players, and that would benefit from auto-generated LODs since viewing distance will be a factor. I am assuming that Unreal would not be able to auto-generate LODs for modular meshes but could for a merged mesh. So it seems to me ideal to have both a modular setup with separate animations and morph targets, which is swapped out for a merged mesh LOD when appropriate. But I am making assumptions about Merged Skeletal Meshes and auto-generated LODs based on the documentation, and would appreciate advice on my intended use case.

MasterPose & CopyPose: My interpretation of how the system works is that MasterPose will take the additional bones of a modular piece, such as a long skirt, and add them to the body/main skeleton along with the leg bones, but only the leg bones will animate since they are the only common bones across leg variations. I assume I can then use a separate animation blueprint with CopyPose to animate the additional skirt bones?

My Use Case: For clarity, I am not trying to add a totally ‘separate’ animation from the Master Pose animation (like hair/cloth blowing in the wind independently of main animations), but ‘adjustments’ to the main animation: such as a kick animation, and while all modular leg pieces will follow that animation, a long skirt would clip through the legs unless extra bones and animation is added.

My question, therefore, is if MasterPose and CopyPose can be used together in this way, or if MasterPose can in fact handle this use case on its own, or if I must choose between one or the other system?

1 Like

First of all masterpose is forced. If you want the character to move and use animations all the parts have to be hooked into it.

Secondly, you may be better off with a control rig modifier - but there is no reason that adding extra animations or directly manipulating the additional bones wouldnt work. Ovviously faces get animated while characters perform actions all the time…

1 Like

Regarding bones, you can have additional bones on all modular pieces, but don’t break main skeleton hierarchy and it will be fine. UE handles everything well as long as you only add bones, but don’t remove or change existing hierarchy.

Hope it helps, good luck with the system!

1 Like