Blender to UE4 physics issues

There’s Blender to UE4 workflow issues if you’d rather watch that instead.

tl;dr summary (I ramble but there’re details in the long version that are needed):

Blender to UE4 export/import procedure results in UE4 physics model exploding. Ensure you’ve applied scale and rotation (Ctrl-A->”Scale & Rotation”) to the objects before exporting, then set the FBX export scale to the correct value. Just because the model imports at what visually is a suitable size, doesn’t mean it’s the right scale. It may work fine in every respect (animations, appearance etc.) but still be wrong when you get to the UE4 PHAT editor. Details for how in the long version.

Long version:

I’ve had plenty of problems importing from Blender to UE4 previously but thought I’d got past those issues. Working with the PHAT editor to modify the physics body on a model I’m working on I discovered another. Happily I’ve also worked out what it is and how to fix it.

No matter how the physics body appears to match the model, it may be that it doesn’t really. I was happy with how the generated physics model looked with only some minor modifications needed, a few sphyls needing collision disabling manually, some rescaling etc.

After that though I couldn’t get the simulation to run without the model exploding like a cartoon clockwork toy.

The first thing to check is that in Blender you’ve applied the Scale and Rotation on all of the objects to be exported, but most especially the skeleton/armature. To do this go into Object Mode, select all of the objects you’ll be exporting and in the 3D view press Ctrl-A to bring up the ‘Apply’ menu, then select “Scale & Rotation“.

At this point your armature may mangle horribly, I’m afraid the only solution I’ve found so far is to start from scratch and apply the scale and rotation as soon as you’ve performed any scales or rotates, either that or manually move everything back into place. In a couple of my cases they were so badly mangled it was quicker to start over. I do like to learn the hard way 🙂

Applying scale and rotation will fix most of the issues.

Eventually I noticed that if I transformed a sphyl it would move faster than the transform arrows I was dragging. On a hunch I went back to Blender and halved the FBX export scale – deleting the previous import in UE4 and importing it from scratch made PHAT behave much better, then making some adjustments like turning off a few overlapping sphyl collisions it worked perfectly!

The following should work for you as well as it now does for me:

  1. Follow the Unit Scale in Blender” instructions on the Unreal Engine wiki.
  2. Remember to Ctrl-A->”Scale & Rotation” at suitable points in the Blender modelling process.
  3. When you Export->FBX, set the following options: Scale=0.005; Armature/Mesh (unset Empty, Camera, Lamp and Other); Smoothing=Face; Check “Only Deform Bones“. Everything else should be okay as default.
  4. In UE4 you should be able to import with the default settings.

You should now have a valid physics model, though you may need to turn off collisions (hover over the “Collision Off” button and hold Ctrl+Alt for an explanation of what it does and how to use it).

I hope this is of some use!


EDIT: I’ve put up Blender to UE4 workflow issues.

Building a human body from scratch

…but only in blender, this isn’t Weird Science.

I’ve been applying my recently learned knowledge to create a human character – I’ve not used any reference photos etc. as a bit of an experiment and I’m really pleased with how it’s looking so far.

So now I’ve got a giant woman doing cartwheels while the default UE4 character runs around. Oops, she just accidentally launched me into space as her leg came up. For some reason her head’s falling off. I should fix that.


Server issues

My poor overworked server has been running out of memory regularly, requiring restarts to ‘fix’ it. I’ve spent a little time investigating and tuning apache prefork feels like it’s improved things. Only time will tell, I’ll keep an eye on it.


2 Weeks in

I’ve learned a lot over the last couple of weeks, but not had all the time I’ll ordinarily have due to school holidays. There’s only so much time you can stick them in front of <random electronic device>.

I’ve learned that the blender to UE4 workflow has its pitfalls:

Body-with-inverted-armsWhy are the arms inside-out? I still don’t know. It’s fine in blender. I imagine I’ve got a bone with odd settings somewhere though I’ve tried resetting the roll on all of them already. It can wait, I’ll get back to it. If you happen to know, please say. When I find out I’ll post the answer.

I’ve learned more hot-keys in blender. That is so very useful and saves so very much time.

I’ve now taken two of my children through the Dynamic Spawning/Exploding Cow tutorial and they’ve had fun with it and then come back asking to do it again.

I’ve corrupted a UE4 project so badly I had to start again from scratch after a couple of days spent on it. Oh yes, that reminds me – I need to log a bug report, I’m fairly sure deleting an output and undoing that delete isn’t supposed to destroy your project…


UE4 “Access None” issue

After much messing around trying to identify the cause of an “Access None” error in a Blueprint function I finally worked out that it’s not only happening at a different node than the one reported, but a completely different function (the one giving the error isn’t even called!).

It turned out I’d stupidly used the ‘Length’ of the array to get the last item in the array, so it was returning ‘None’. It must have been an oversight as I’d correctly used ‘Last Index’ elsewhere!

There are various articles and threads relating to this in the forums and the problem was clearly my own mistake so I won’t log this, obviously, but the error could be less confusing (this too has been mentioned).


Visual Studio and UE4 include note

I’ve been meaning to mention:

In Visual Studio – if you create new files in the Solution Explorer, even if they appear to be in the same directory as your other files they will fail to #include as they aren’t really in the same directory. So when you get:

error C1083: Cannot open include file:

it will be because it’s created the .h or .cpp file in the GameTitle/Intermediate/ProjectFiles directory rather than the GameTitle/Source/GameTitle directory with the others. You can cut and paste the file(s) from one to the other, ‘Remove’ the files from Solution Explorer and then drag and drop the newly placed files from Windows Explorer to GameTitle in Solution Explorer to fix it.
I’m sure there’s some other way this is supposed to be done but I learn by playing and then read the instructions when I get stuck.


UE4 Glass Material

A short post in the hope of saving other people time – UE4 materials currently (in 4.7.5) do not support reflection/specular and translucent on the same material at the same time. Turning on translucent disables reflection and specular. So you’ll have to fake the reflection somehow if you need them, possibly using some clever texture manipulation.

EDIT: This tutorial has the clever texture manipulation –

I haven’t tried it but from the video it looks good!


Character design/animation workflow

I’ve had no trouble importing static meshes from blender into UE4, but adding animation is causing me trouble. I’m sure it’s going to be something simple (like checking a box that inverts something) but for some reason the character’s arm has decided it wants to be inside out – meaning now there’s an arm-shaped hole at the shoulder inside the body of the character.

I’m taking a short break from learning that to work on learning the C++ side of UE4. When I come back to it and work it out I’ll let you know what I find in case it helps anyone else!