PhAT does not properly handle scaled rigs

Just in terms of the Blender > UE4 pipeline, this is a pretty exasperating bug, because there is no end-user workaround.

If you have a scaled-up armature and you go to import it as a Skeleton, the Physics Asset will break because any constraint with Locked linear limits will cause the mesh to attempt to explode by the scaled-up value. i.e. if the armature was scaled by a factor of 12 before export, then the physics asset will attempt to scale the distance between the two bone physics assets to 12x what it ought to be.

Other bugs with scaled armatures are fixable with a little work (i.e. misinterpretation of root motion can be fixed by scaling the keyframes on the root bone by the same amount as the object) but as far as I can tell, there’s no way to manually force Unreal to change the distance between bones when Locked, so I can’t manually retune these broken constraints to make a working Physics Asset.

I know that Unreal officially “doesn’t support scaled bones”, but this seems backwards; if it doesn’t support scaled bones, why is it trying to apply their scale in this way? Shouldn’t it just be ignoring whatever their scale value is and treating them the same way the rest of the engine does?

Is the issue solved by applying the bone scale in Blender before exporting?

You can’t do that, or at least I can’t. Applying bone scale (as in, applying the armature object’s scale to the armature) breaks the armature in fascinating and bizarre ways, mostly related to destroying bone constraints in IK rigs, which don’t scale properly with the bones.

Obviously the “right solution” is to build the rig at the proper scale to start with, but for myself and I’m sure many others that would mean an enormous refactor of assets.

Hi RhythmScript,

You’re correct, we don’t recommend skeletal mesh scaling of any type inside UE4. But take a look through the links below before you rebuild your rig, they may have some info that could help with your issue.

The problem is how Blender handles scaling. In order to scale up the armature (i.e. the skeleton) to a usable scale in Unreal, you have to use the “scale” multiplier. Unfortunately this seems to have the unwanted side-effect of not actually SCALING the bones (i.e. changing their dimensions by modifying the position of root and tip), it “scales” the bones (i.e. it tells the FBX format that on top of their known dimensions some scale should be applied).

There’s no way NOT to do this, trying to “apply scale” as you would with a static mesh causes the rig to fall apart.

I guess my question is, if you don’t plan to let Unreal PROPERLY interpret bone scale data, is there something I can do to fake it in PhAT? Can I manually define the distance between bones if Unreal doesn’t know how to read it?

Actually, after SUBSTANTIALLY more experimentation I discovered that scaling the armature and applying the scale DOES work; the problem is that it simply breaks all existing poses (which of course makes the scaled armature look wrong, though if you tell Blender to force Rest Pose it actually works).

Obviously the problem is that this, in turn, makes all animations unusable since the bones as defined in those animations are all incorrect (which causes the exploding and deformation I was running into). You can work around this with animation retargeting but it’s still honestly easier to just not make a physics asset for your character at that point.

Hey RhythmScript - I’m having this same issue. Everything in your situation, I scaled my armature by 1.8 to make it to scale in the UE4 world, but when making the physics asset, the bones “pop out” when simulation. Fixed that by leaving the scale at 1.0. Doing the “apply scale” option in Blender isn’t an option for me because I’ve already done all the animations, so applying the scale changes up those animations and they don’t look right afterwards.

So you’re suggesting doing skeleton retargeting to fix this? I will try it. Making the physics asset is on my todo list and I’m finally taking care of it, though its all been grunt work at this point cause of the problem.

I’d like to hear from TJ Ballard on this one… Is skeleton retargeting the best way to go for now? Or are there any feature plans to add a better method for doing this? PhAT causes the bones to pop with a scaled armature (without applying the scale in blender). That seems buggy to me. Either way I’d like to hear what you guys think.

Well, it SORT of works, .

You’ll need to re-export all your anims without scaling (since, with a scaled up mesh, you’d have needed scaled-up anims as well)

Also, all of your sockets will break, as will any local space pose modifiers (IK solvers, etc) in your anim graph, as local space is defined before scaling (i.e. if you defined the sockets on a mesh scaled up 1.8, on your 1:1 scale rig, all of the socket coordinates will need to be multiplied by 1.8)

Also not all bone relationships will remain. For example, I have a sub-skeleton attached to my main armature for my weapon pieces; these animate correctly but do not retain their relationship to the scaled rig properly, even with retargeting, because they’re not children of any of the scaled bones (just of the Armature Object Root Bone).

For me it’s just live and learn; my main character won’t be able to ragdoll , but I’ll build enemies that can. I’m glad you worked it out on your end but until PhAT properly interprets scaling of bones there’s no workaround that will get existing too-small skeletal assets into Unreal 100% correctly.

UPDATE - skeleton retargeting seems to do the trick! Just import your 1:1 scale skeleton and leave the animations be. Then go to one of the animations and do what Zak says in this video: - then all the animations work right as rain, and the physics asset actually works normally! Thanks guys!

One way I’ve found around this ( I had a fully animated character with improper bone scaling ), was to re-rig the basemesh with a properly scaled armature. Create a physics asset with this mesh, and then just quickly swap them out when the character “dies”. It’s not perfect but with a bit of camouflage, such as an impact particle system( blood ), and a bit of angular impulse on the mesh, the transition is almost seamless.

Having the same export problems I tried scaling my 1.7 meter Blender mesh 100 times larger and re-built the bones at that size (no scaling at all), but Phat couldn’t make the physics bones small enough to fit the armature bones. I could enlarge them in any dimension, but not make them smaller (they were about four times too thick). Why?

Because your armature is too small.
your armature looks proper scale.but is actualy 1/100.
set Unit metric 0.01 in Blender Scene tab.
and make the scale of your armature and mesh scale 100 times larger in Edit mode not Object mode.

It’s not quite the size of your armature, more the size of the actual tail and head ends of each joint. What I did was just set the radius for each head/tail to at least 10 before exporting. Works fine in PhAT

Steps to solve this issue

Blender:

  1. Set the Unit to Metric and the Unit Scale to 0.01
  2. Scale the Mesh 100 times larger.
  3. Select all bones (not the Rig, but the bones) and scale them 100 times larger.
  4. Select both Rig and Mesh.
  5. Export to fbx.

FBX Export properties:

  • FBX 7.4 binary
  • Main->Selected Objects
  • Main->Scale: 1.0 and not using the “Scale all data…” button.
  • Main->Forward: -Z Forward
  • Main->Up: Y Up
  • Main->Both Armat button and Mesh button selected.
  • Geometrie->Apply Modifiers selected.
  • Geometrie->Smoothing: Face or Edge (to avoid the smoothing group warning).
  • Armatures->Only Deform Bones ticked (to avoid unnecessary bones on UE4).
  • Armatures->Add Leaf Bones unticked (to avoid unnecessary bones on UE4).

UE4 Import properties:

  • Skeletal Mesh ticked
  • Import Mesh ticked
  • Import Uniform Scale: 1.0
  • Convert Scene ticked
  • Convert Scene Unit unticked

Those steps allowed us to fix a Rig in order to not have problems with the PhAT.

I hope this will help you!

This is the real answer right here. Scale solved my issue of broken physics asset bodies. If you are trying to make a physics asset and the size of each body is really huge and you can’t get proper size without manually setting the body size properties in the Details panel, then you have incorrectly scaled your asset in Blender.