Download

Importing a model & it's animations from Blender to Unreal?

Hi again, I was wondering if anyone could help me out with some problems that have cropped up with the animations for a game model I created in Blender and imported into Unreal Engine.

So to start with, when I initially imported my model I got the following error message:

Afterwards I imported the animations into Unreal and then checked the animations to see how they turned out, during which I noticed a number of problems.

The first problem I noticed was with the idle animation, the head of my character is supposed to slightly bob back and forth in order to make my character seem more “alive”, but instead the head remains completely still while the rest of the model animates correctly. I assume the reason the animation isn’t working correctly is due to the head/spine of the model being controlled via Inverse Kinematics and it is my understanding that many of Blender’s modifiers, including Inverse Kinematics, do not work in Unreal Engine. Strangely though, the idle animation is the only one that has this problem, as the walking and running animations have my character’s head swaying back-and-forth and both of them have the head animating properly in Unreal.

However, the running animation has a different problem related to the eye(s) instead of the head. You see when my character runs, he shifts his head back and his pupils move downward, as shown in this screenshot from the original Blender model:

Whereas after being imported into Unreal Engine the pupils remain in their default position, presumably because the pupils were animated with Blender’s UV Warp Modifier.

In addition to the compatibility issues with Blender’s modifiers, there’s also problems with parts of the mesh becoming distorted in the animations that were not present in the original Blender model, as shown in these screenshot comparisons:

Blender:

Unreal Engine 4:

Blender:

Unreal Engine 4:

I’ve read about Baking animations in Blender, which would apparently fix the issues regarding the lack of Inverse Kinematic support with Unreal Engine, but what my issues regarding the UV Warp modifier and the distortions in the mesh? I have my doubts that Baking the animations would fix the mesh distortion problem and I’m similarly not sure about the UV Warp issue.

Any insight into this matter would be a huge boon to me and as always, would be greatly appreciated!

Okay, so far I haven’t had any luck in trying to figure out what is causing the mesh of my model to distort. I tried setting frame 0 as a reference pose and then re-importing the skeletal mesh as suggested by the Message Log, but nothing happened. I also tried normalizing all of the vertex weights & setting the smoothing group to Face instead of Normals, all to no avail. For the life of me, I just can’t seem find the reason why my model is distorting like this:

Whereas this is how it looks in Blender before being imported.

One oddity I’ve noticed is that for some reason it seems that all of my animations that I imported are missing a frame. Both of the screenshots shown below were taken on the 8th frame of the running animation cycle but note that the poses in the two screenshots are not the same:

https://forums.unrealengine.com/filedata/fetch?filedataid=163585&type=full

In particular, the left foot in the top screenshot is slightly bent while in the lower one, the foot is completely straight. The pose in the top screenshot seems to have originated from the 9th frame of the original animation rather the 8th as the top one appears to be almost identical to the one in frame 9, minus the distorted geometry.

https://forums.unrealengine.com/filedata/fetch?filedataid=163584&type=medium

Additionally, the animation timeline ends at 15 frames when the original animation is 16 frames.
frames.png
Is this normal? Does Unreal Engine 4 always remove a frame from imported animations or is there something else wrong?

So after reading thisforum topic, I tried re-importing the skeletal mesh and all its animations with the Scene Units in Blender changed to Metric, Degrees and Scale 0.01, but alas, once again nothing changed aside from a adjustment I made to one of the animations.

Honestly, at this point I feel like I’ve exhausted all of my options. I just don’t know what on earth is causing this problem and how to fix it:(.

Did you use any modifiers in blender without applying them to the mesh? It’s best to apply every modifier you need in blender at first while keeping only the armature modifier for a successful fbx export from blender to ue4. Another problem could be, if you have checked “preserve volume” in blender, because ue4 can’t recognize it and displays the mesh how it would look like without “preserve volume” checked.

I gave it a shot and tried applying the modifiers before re-importing the model into Unreal, only for nothing to change at all. There is only one other course of action I can think of at this point which I was hoping I won’t have to fallback on. That option is to re-do every single animation I’ve done so far, as according to thisvideo tutorial, issues of scale will result in bone transformations and that simply changing Blender’s scaling units isn’t enough to fix it, you have to re-do all the animations.

Having to re-do all the animations over again is going to suck because I already created about 18 different animations for my character, but unless someone else has any other suggestions, I have no other options left. And if re-doing the animations doesn’t work, then I’ll be at a complete loss as to what to do:(.

UE4 can use up to 8 bone weights per vertex while this number is unlimited in Blender. If a vertex in Blender uses more than 8 weights, UE4 will discard extra bone weights, which can result in bad skeletal deformation. You can verify this happening by checking in Blender, if the problematic verts use more than 8 weights. Go to Weight Paint mode, turn on vertex selection masking and observe Vertex Weights on the Properties (N) Panel of each vertex.

You can preview in Blender how a mesh will deform in UE4 using the object.limit_vertex_group_total operator. (Space > Limit Number of Weights per Vertex, Limit = 8)

(By the way, limiting to 4 weights results in much better performance, 4 weights are usually enough to achieve acceptable deformation. It’s a compromise between quality and performance.)

As for the unit scale, you can use this addon to export to UE4 while not having to modify the unit scale: https://blenderartists.org/t/gyaz-ex…-4-fbx/1121132

Welp, I found the source of the problem. It occurred to me last night before I went to bed that when I tried applying the Mirror & Subdivision modifiers as Bronislaw666suggested, I didn’t try posing the model to see what effect it would have on the way that mesh deforms while animating. So this morning I applied the Mirror & Subdivision modifiers once again and tried playing some of my animations to see what the results would be, and this was what I ended up with:

image_163894.png

image_163585.png
image_163896.png

They’re exactly the same, applying the modifiers on my Blend file resulted in the exact same deformations as the version of my model imported into Unreal Engine. It turns out that it wasn’t Unreal Engine causing the problem, well not directly anyways, but rather Blender’s Subdivision Division modifier screwing me over by giving me an inaccurate view of what my model would look like.

So now I guess the question is, now what? Unreal Engine will not accept Blender’s Subdivision Division modifier but applying the modifier destroys the mesh. I guess that is it too much to hope for that there’s some way that I can get a 1:1 conversion of the Subdivided version of my model into a Unreal Engine-friendly version, is there?

EDIT: Whoops! After checking this topic from my cellphone, now I see the images are missing. I’ve re-uploaded them so they should visible now.

In what sense does applying the Subdivision Surface Modifier destroy the mesh? (images from your last post are not visible) The only problem is, that there is no going back, after you have applied the modifier.
But you can still keep the blender file without the subdivision and make any necessary changes (sculpting,weighting,rigging…) there, while applying the corresponding modifiers only before you export into ue4. The modifier will smooth out the weights automatically.
By the way the UE4 roadmap states that in a future release there will be support for some form of subdivision surfaces inside of the engine.

That’s weird, the images I posted are visible for me, so I’m not sure why aren’t showing up for you.

Anyways, it’s not so much that the process of applying the Subdivision modifier destroys the mesh, so much as the Subdivision modifier does not give a accurate representation of what your model is going to look like with the modifier applied, resulting in the mess shown at the top of the page. I need some way of being able to convert the version of my model with Subdivision modifier unapplied into a version with the modifier applied that maintains every element of the Subdivision Modifier version. Right now as it stands, my guess is that applying the modifier doesn’t carry over the automatic weight smoothing you’ve mentioned and that’s what is very likely causing the mesh to distort.

How long into the future would I have to wait for Subdivision modifier support for Unreal? For the time being I can continue working on my project with the distorted model but if it’s going to be years and years before support is added then that’s going to be a problem for me. Is there any add-ons or something along those lines that would allow me to convert the model with the Subdivision modifier into one that would work properly with Unreal, or am I out of luck in that regard?

The images are visible now. For me the modifier does smooth out the weights as expected (have tested it multiple times, because I needed this for different high resolution models), but you have to put and apply it before the armature modifier and the effects should be the same as without applying it, because it makes a difference if you put the modifier before the armature or after it.
And it’s important, that the mesh is quad only (without triangles etc.) for best results.
As for the future subdivision support of UE, its very vague in what will be really possible: https://trello.com/c/KNTPP2Nx/120-po…ision-surfaces,
Normally there shouldn’t be any distortions or hard edges (unlike with the normal subdivision in the tools panel).
Another issue that comes to my mind, could be the limitation of weights per vertex in UE4 to 8, which could cause some distortions as well. I’m having similar problems, which seem to be caused by UE4, because I’m using a custom version of it. To check if the problem lies within UE simply read the following thread (esp. the answer provided by witch-dev: “for your second issue”

https://forums.unrealengine.com/deve…-glitch-in-ue4

I think I might have solved the problem.

Since the problem seemed to be that the automatic weight smoothing of the Subdivision modifier wasn’t being carried over when applied, I decided to look into alternative ways of applying weight smoothing to my model. My search yielded thistopic on Blender Stack Exchange on how to manually smooth out a model’s weight values. After following the advice in the forum topic, I managed to smooth out the model to the point where it largely resembled the pre-applied Subdivision modifier version. With the smoothing done, I then imported the model into Unreal as a FBX file and checked it to make sure that it turned out alright.

Fortunately though, it appears that the model has no major issues and all of the major distortions that previously plagued my model are no longer present.

There’s still a couple of small problem areas with the model, but those can probably be ironed out in Blender.


Otherwise, everything seems to be more or less in proper working order. I still find it frustrating that weight smoothing doesn’t carry over when you apply the Subdivision modifier in Blender, but I guess there isn’t really anything I can about that.

Oh well, thanks for all the help!

I’m glad that it worked for you, but it’s really strange, that the subsurf modifier didn’t work correctly. Did you use the Catmull-Clark or the Simple one. In my opinion the Catmull-Clark Modifier makes smoother edges.

I use Catmull-Clark because Simple results in this:

Anyways, the problem is that when I click the Apply button on the Subdivision modifier it doesn’t carry over the weight smoothing of the function of the modifier. Hence why I had to do it myself manually.