XaiJu
Megan Fox
Megan Fox

patreon


How to share animations across skeletons in UE5

(bonus blog time! because this came up in an email so I figured OMG THIS ISN'T COMMON KNOWLEDGE BUT IS SUPER IMPORTANT, so here we go!)

Right, so, first! Unreal's skeletal retargeting is INCREDIBLY powerful. It'll work on just about any skeleton. If you truly need to re-target a humanoid animation onto a centaur, they're the tool for the job. There's two forms of it, either runtime retargeting or the in-editor baked out sort.

But. There's a simpler way.

The Simple Way

You shouldn't have to do any kind of fancy retargeting at all for basic variations like male and female. Most times, your skeletons just have different bone lengths and slightly different orientations, right? But the skeleton is identical, in terms of the leg bone's connected to the hip bone and everything's named the same?

The right way to handle that in Unreal is to decide on one character's skeleton as the focal, import them first, then import all your other characters as using that skeleton. It's this thing. Just import your main guy first, then when you import any other skeletal meshes, pick their skeleton in here. In my case, the Crow Person is our focal skeleton, so we pick that when importing anything new.

Once you've done that, you'll need to open your newly imported not focal person, in this case my Badger Fellah, and enable this option,

And then you'll be able to set these options

As you can see, all of my bones are set to animation scaled. That's because I have a big badger guy and a little mouse sharing the bird person's skeleton. Huge scale differences. The various options behave differently, and it's outside of scope for me to tell you which to use. But,

The gist is that Animation Scaled is probably what you want if your primary concern is that each skeleton's bone lengths are different, but you ALSO want to be able to play animations that that stretch bones toon-style. Because that's what Animation Scaled means: "play the animation, including any bone length distortions, but scale the bone lengths overall by the ratio between this mesh's bone and the focal's equivalent bone." If you didn't care about animation squash and stretch? You could just shrug and pick skeleton, which just means: "use use this guy's bone lengths."

Yes, This Handles Substantial Differences

Note that the bird person's wings are fwingers, meaning technically the root skeleton has HORRIBLY distended hands relative to the others, and also note that the mouse is itty bitty and so on. Yet it all works fine! All these characters play the same animations.

Also, this tech isn't new, this doesn't actually leverage the new fancy "skeletal retargeting" tech at all. This is like, UE 4.27 era stuff, meaning it's super durable. This is just the tech Gears of War and such used.

Oh and the skeletons don't have to be truly identical. As a simple example, though we used the bird person as our focal, they only had 2 tail bones. The mouse has 4. The mouse also has extra ear bones.

When you import the Mouse and tell it to use the Bird Person skeleton, what happens is it adds those leaf bone chains to the base skelly. The result is that the bird doesn't use those bones / they aren't weighted to any verts, but the system knows they're weighted to verts in OTHER meshes. See the circle? Compare those bones to the weapon_r up there, which is in fact weighted to nothing because it's meant to be a pure marker bone. (uh ignore the fact that the twist bones are weighted to nothing twist bones are hard 😭).

Which is to say that the skeletons don't have to be truly identical. What's important is that the core is identical in terms of hierarchy. You can't inject an extra arm bone in one character such that one dude has a 3-joint arm like those guys from One Piece, THAT level of skeletal change would break this. But you can totally have unique jiggle bones on everyone, since those are all leaf, or ear bones, or tail bones, or etc. In general, almost every bone variant will be leaf, usually deeper changes mean you could never share animations between them easily anyways.

You Can Use Animation Retargeting Too!

Now, when you DO get to that level of skeletal change? When you need to map your humanoid animations onto the upper half of a centaur? THAT'S when you break out the actual shiny new UE5 skeletal retargeting tech. THAT one could indeed remap animation from your regular guys to your One Piece 3-joint arm guys, or way weirder, no sweat. But the process is more involved, so don't think about that until you're there.

Start here. This is much easier, and it just works. No need to do anything fancy at that point, no baking no processing no nothing. You'll just play the same animations on them and it'll just work. Be consistent when you export/import to keep importing animations for your focal skeleton guy, and everyone else will just, you know, use 'em! ezpz.

EDIT: Ok, the email discussion continued, so,

Bonus Section: Getting Characters + Animations Into Unreal From Blender

This really isn't that complex, once you find the right tools. While you can theoretically export Manny and import that into Blender and use that as a basis and etc etc, you're going to hit... mmmm, hurdles, most likely. Which hurdles? I can't say! Exporting from Blender to Unreal is quite um, fraught. Everyone hits different weird af glitches, I assume it depends on Blender version vs Unreal version vs phase of the moon or, who even knows.

Which is where TOOLS come to the rescue. Tools! I'm aware of 3 good options:

https://docs.blender.org/manual/en/2.81/addons/rigging/rigify.html <-- this is kinda the foundational tool in Blender

https://toshicg.gumroad.com/l/game_rig_tools <-- this is what we're using. I think internally it uses Rigify? I'm honestly uncertain, tracking how open-source stuff tends to blend and diverge is a bit messy. It does some wild stuff with this 3-skeleton setup that, so long as you don't look too closely works great! It's just. Disappears up its own sleeve a bit in how clever it is.

https://blendermarket.com/products/auto-rig-pro <-- Auto Rig Pro's probably the single most powerful option, and maybe most importantly, it presents the most Maya-like interface. The 3-skeleton thing is REALLY intimidating to a lot of animators, and this doesn't rely on any of that.

Generally any or all of those will have guides for "how I export to Unreal + (plugin name)". I don't have any horse in the race, pick whichever one you like, but if you at least START there, you'll find the necessary guides that smooth your path of getting your stuff out of Blender and into Unreal. So hooray! Have fun.

(static FBX meshes are way less fraught, so I won't go into it, suffices to say you want a plugin still but there's way more good options, just searching "static mesh export FBX Blender plugin" will likely be more than adequate)

EDIT: Bonus Correction, Maybe You Don't Need To Share Skellies?

Further experimentation seems to support the idea that even if you don't share skellies, the "Animation Scaled" setting (or similar) you can set per-bone might be applying? Whereas I thought that only worked with shared skellies.

Which might mean you can get equally good results with just setting that on all the bones of all your skellies, no actual shared-skelly required? I'm just, mmmmmm, extremely uncertain and a bit worried I'm missing something. But. Something worth experimenting with if you're in the midst of playing with animation pipelines. Just make sure you've got whatever full range of pose/size variant animated characters you intend, since it might be a case of it only working this well due to skeletons being close-enough. If anyone knows this for sure, please do leave a comment. Identifying what works / doesn't work here is a bit fraught, and it's entirely possible this working this well is only as of UE5 or whatever.

Other stuff though (ControlRigs et al) does, I believe, hard index off skeleton in use, though. So I suspect you'd need to share your skellies regardless. Still! Wanted to correct this, since my recent pokings muddied the waters a bit for me.


More Creators