Export Rigged Model From Blender To UE4

Okay, this is driving me nuts. I’ve created a model of a mech and rigged it with some bones. All of the pieces of the mech are parented to bones and it animates beautifully - in blender. But I’ve had no luck importing this into Blender no matter how many searches I do or how many tutorials on the subject I read. I’ve spent over a day reading dozens of posts but no single post seems to have an answer that works for me. I can import the mech as a static mesh and it’s fine, but if I try to export the skeleton with the mesh, on import everything is split apart into dozens of parts and skeletons, one for each object or bone in the scene.

Here is an image of my blender mesh with the object hierarchy:

All of the objects in the scene are parented to the armature. each piece of the mech is parented to a bone. So that’s the setup. Does anyone have any idea what is going wrong here?

Hi mate! :slight_smile: First off, cool Mech! :smiley:

Sorry to hear your having trouble getting it into UE4.

Okay, I think this is what is going on here. You Mechanoid Mesh is split up into loads of different Mesh Objects. And then you have parented each individual Mesh object to the Skeleton. Right? Thats pretty much the wrong way to do it. All mesh objects should be contained inside one single Mesh. That single Mesh should then be parented and vertex weighted to the Skeleton.

That is how I do my Machine / Character animations from Blender - UE4. And it works just fine.

If you like, upload your .Blend file and I’ll take a look at it and or fix it for you. :slight_smile:

Hope the solution described above works for you. If not let me know.

When you say combined into one single mesh, do you mean I literally have to have the entire object be contiguous and unbroken, or could I just parent the objects to a single object? Right now parenting the pieces to the skeletal bones is the only way I know to rig it. I will have to look into more traditional methods.

Thanks for the compliment on the mech, but I’d actually like to add a disclaimer. This mech was the quickest, most lousy mech I could make in order to experiment with rigging and exporting, and is largely based on a tutorial. So…I’m just saying, not representative of final product. :slight_smile:

Hehe nps! :slight_smile: Mechs are cool in general.

Okay, let me explain what I mean. The way you are doing it at present is the wrong way to rig Skeletal Meshes in Blender for games. It is not the way Epic Games rig their characters or machines, or the way Skeletal Meshes are rigged for any game engine as far as I know. What you are doing wrong is the act of splitting up of the Mesh into separate Mesh Objects. In the screenshot of your blend I can see you have 20 or more Mesh Objects parented to the Skeleton. Like I said this is not the way to rig for game engines. Why? Because there is a simpler and more efficient way to do it.

The only reason you would want separate Mesh Objects is for vehicle suspension, but that’s a whole other story. What your doing here is essentially using Mesh Objects as Vertex Groups. When really Vertex Groups are what you want to control the different parts of your mesh.

Trust me here , I know what I’m talking about. :slight_smile: I’ll explain.

So, here’s how you fix it:

  1. In Object mode, select every single separate Mesh Object. (Hold Shift, Right Click on every Mesh Object until they are all high lighted Orange.)
  2. Join all the Mesh Objects together into 1 single Mesh Object. (With all Mesh Objects Selected, Press Control + J.) So now if you select the single Mesh Object and enter Edit mode, you will see that all the Meshes are part of the same Mesh Object. The Polygons themselves don’t have to be joined, they just have to all be part of the same object.
  3. In Object Mode with the Mesh Object Selected go to Object tab and under the Relations menu remove any Parent.
  4. In Object Mode, go to the Modifiers Tab and remove the Armature Modifier.
  5. With the Mesh Object select go to the Object Data tab, Vertex Groups menu and remove all the Vertex Groups from the Mesh Object by clicking on the - button on the right.
  6. Now in your scene you should have 1 single Mesh Object with no parent and no armature modifier and no vertex groups. This is essentially cleaning the object of unwanted armature data. And you should also have 1 Armature object.
  7. Select the Mesh Object and then holding Shift select the Armature object. They must be selected in this order, Mesh first, then Armature Second.
  8. Press Control + P and select “With Empty Groups”. Your Mesh is now parented to the Armature and Vertex Groups have been created on the Mesh Object, one Vertex group for every single bone in your Skeleton. But at present none of the polygons in your Mesh are weighted to the Armature.
  9. Select the Mesh Object and enter Edit Mode. Navigate to the Vertex Groups panel inside Object Data. Starting at the top with the first Vertex Group, select the Vertices of the Mesh, the Tris or Quads or NGons, that you want to be controlled by the Bone with the exact same name as that Vertex Group. With the chosen Vertices selected press Assign in the Vertex Group panel. Those Polygons will now be assigned to that Vertex group and so weighted to that specific bone. When that Bone now moves, those Polygons will move with it.
  10. Repeat this process with every single Vertex Group so that all Vertices/Polygons in the Mesh are assigned to a Vertex Group. All vertices must be assigned to a Vertex Group. Although it is perfectly fine to have a Vertex Group with no Vertices assigned to it.
  11. In Pose mode make a Single test animation. Export your Skeletal Mesh as FBX with the animation into UE4 and watch it play! :slight_smile:

This is a proper way to Rig Skeletal Mesh characters inside Blender. I hope it works fine for you. If you have any questions or need help with it please ask. :slight_smile:

3 Likes

You can take a look at this .Blend file which is a Blender version of the Shooter Game HeroTPP Rig for an example of how a Skeletal Mesh should be configured in Blender for it to work correctly in UE4. HeroTPP_ShooterGame_Rig&BlockMan.blend

In this Blend you can see that there is 1 single Mesh Object, parented to 1 Armature. The Mesh is controlled by the Bones using Vertex Groups. Mess around with posing that Blockman guy in Blender, to see that it works. :slight_smile:

Thank you very much, that was a very complete answer! I will certainly try this when I get home from work and let you know how it goes. Thanks again!

Safe! :slight_smile: Hope it all works fine for ya!

I’ve followed your guide to step 8, and have encountered a problem. I’ve applied all the vertices in the gun to the gun bone as specified, but moving the gun bone doesn’t cause the gun to move. Surely I don’t have to set all vertices to a group before any of them can be moved? All weights are 1.00 btw.

Edit 2: Actually, this procedure appears to have destroyed the IK data in my armature. Let me put that back together and see if it helps.

Son of a… I see now that when rigged in this way, moving bones in the edit mode doesn’t move the mesh. It’s working fine in pose mode. :rolleyes:

Also my IK data is still there which is good.

I feel that I am close. I export the model with armature, but uncheck baked animations and it seems to import the skeletal mesh. If I try to check export baked animations it screws up the model on import. I try to import the animations separately using a separate fbx export containing only the armature and animations. On the import screen I select the skeleton that was imported with the mesh. Unreal correctly identifies the file I’m trying to import as animations. However, when I try to import I get the folllowing error:

“FBXImport:Warning: Warning Imported bone transform is different from original. Please check Output Log to see detail of error.”

When I look at the output log, it seems as though every single bone in the skeleton generates a transform error as follows:

LogFbx:Warning: IMPORT TRASNFORM ERROR : Bone (Armature|ToeJointL_R:34)
Source Global Transform (-22.729170,211.232040,33.971336|0.000010,-157.606491,-0.000031|100.000015,100.000015,100.000000),
Converted Global Trasnform (-0.230589,1.332413,0.358693|0.000011,-157.606506,-0.000061|1.000000,1.000000,1.000000)

Am I right in thinking that UE4 can’t reconcile the positions of the bones in the imported animation armature with the positions of the bones in the skeleton I told it to use?

Edit: After spending some time thinking about the problem carefully, it occurred to me that I had scaled my model and armature at some point, and this might’ve caused a discrepancy once the model was exported. Therefore I set my armature and mesh scales back to 1.0 and exported. This…sort of worked. I can then get a model where the top half animates, but it looks like this broke all of the IK relationships in the legs. Also, the feet and launcher go a little nuts after the export, appearing in the wrong location just as when I tried to export with baked animations.

After working on this a while longer I managed to reset the scale of the armature and not break the IK data. However, this still isn’t quite working correctly. Whether I export animations with the original skeletal mesh and import as a single import skeletal mesh operation, or import the skeletal mesh and animations separately, I always get the above errors about bone transforms and the resulting animations don’t quite work correctly. Or rather, the animations appear to work fine, but the model itself is screwed up. I have included a link to a video showing this. Note how the feet and rocket launcher are in the wrong positions. I don’t suppose anyone has any ideas?

And yes, I realize it looks like the mech is head-banging. :slight_smile:

does the mech still animate as expected in blender?

do you still get the warnings on import?

have you tried clearing rotation/location/scale and then reapplying them to make sure there are all set correctly?

My best advice is, upload the .Blend file to a Dropbox/Google Drive and I’ll take a look at it and see if I can fix it.

Of course I don’t want to steal your work or anything, it’s just the easiest way to try to resolve the problems. Hopefully, I’ll learn
something from it, and we’ll find a solution.

If you don’t mind that is. :slight_smile:

My best advice is, upload the .Blend file to a Dropbox/Google Drive and I’ll take a look at it and see if I can fix it.

Of course I don’t want to steal your work or anything, it’s just the easiest way to try to resolve the problems. Hopefully, I’ll learn
something from it, and we’ll find a solution.

If you don’t mind that is. :slight_smile:
[/QUOTE]

The mech still animates properly in Blender. I still get the skeleton warnings on import. I’m not sure I’ve cleared rotation for everything in the model. I’ll double check later today. Thanks for the suggestion.

Nobody would want to steal this mech :). That said, I’ll be happy to upload the file when I get off work. I can’t tell you how grateful I am for all your help so far, DyotoOrion. It seems like there are a hundred tiny gotchas in exporting from blender to UE4 that aren’t documented anywhere.

Yep certainly, it takes a fair amount of practice and experience with Blender (Guess its the same with any 3D package though.) to learn all the individual settings and configurations to get a good working model in UE4. It’s not exactly “simple”. But once you get it down, it works fine. Glad to help. :slight_smile:

I’ve uploaded the problematic blend file to Google drive:

https://drive.google.com/file/d/0B1iSd_zwqpa6ODFWUDVEU2g1Snc/edit?usp=sharing

Cheers Nightfall. :slight_smile: I’ll take a look at the Blend and see if I can solve the issue’s. A nice break from my usual work. I’ll let ya know as soon as possible. :slight_smile:

I just took a quick look at your file and while I didn’t find the cause of your problem (it was just a very quick look) I did find a few things, here’s a list.

your mesh had a scale of 20.

the root bone should be at location 0,0,0.

you should have the mesh orientated so that X= forward, right now you have -Y= forward.

your lower leg bones should really be parented to the upper leg bones instead of the root bone (I think this might be part of your problem)

just a few things to think about:)

is correct about everything there except the X forward bit. -Y Forward is fine As far as I know. All my models are -Y forward and it results in the character facing forward (Toward the Camera) in Persona. Working to fix the rig now. More news coming soon. :slight_smile:

I fixed the things mentioned, and it did seem to fix the feet. For reasons I can’t determine yet, the launcher is still malformed. My most fervent hope is that I can take everything I’ve learned from this model and turn it into a repeatable workflow for future models. This is quite a bit of effort for one model.

Yeah Nightfall dude, don’t worry. You definitely definitely can turn it into a workflow for your future models that works with out issues. I have already done that with my mechanical models, and it really does work fine. Basically the reason you are encountering issues is because of a few mistakes in the way you have set up your rig. Basically because, no offence, at the start you had set your rig up in a pretty incorrect way. And I think the issues you are encountering now, are a legacy of the original rig set up.

But don;t worry we will definitely get those issues ironed out and work out a smooth workflow from Blender to UE4 for ya! :slight_smile:

Sorry, I havent got your .Blend file fixed and updated yet. Some of my mates turned up at my house this afternoon with bottles of booze… Damnit, social life interferes with 3D work :frowning:

Any ways, defo gonna get that Mech Rig fixed Soon™. Right now Im just gonna make two videos of my Mechanical Rig woorking in Blender and in UE4. I’ll post those as soon as they done, in 1/2 hour or so.

Hey don’t work too hard on my account. This is the first model I’ve ever attempted to rig in my life, so I’m not too surprised in retrospect that the methods used weren’t correct when your end goal is for exporting to a particular game engine. I would say though, it’s more important to tell me what’s wrong than to worry about fixing that particular blend file. It was, after all, only a test. Thank you again for all your kind assistance.