Hi Developers

A common question I’ve noticed is how to take a model from Blender to Unity with the best settings.  Unity is able to accept raw blender files, however that is not advised since blender has a lot of extra information that makes the file unnecessarily heavy when Unity renders the model.

Blenders rotation and scale will also be wrong when importing into unity.  The rotation will be off by -90 degrees on the X-axis, and its scale will be the native blender size, this is because blender works off a different axis than Unity.

In this short tutorial we will correct the rotation and scale and import the file as a FBX.

I consider FBX the PNG of 3D models because it’s compact and stores all the details of a 3D model.

Keep in mind i’m using Blender 2.79b and Unity 2017 LTS.

Download the complimentary Lamp Zip file below, it contains the Blender file to follow along, and the finished FBX file for your reference.  File Size 234KB

Lamp Download

Blender – Set up

Blender to Unity Step 01

It’s good practice to make the origin of your model at the correct position.  On this lamp model, the origin is located at the base of the lamp, that is where the lamp stands on.  Make sure on your hierarchy are all properly label and parented, this will help when working within Unity.  This model has 4 pieces.  The lamp base is the parent, the bulb, frame and shade are all its children.

Blender – Lets get started

Blender to Unity Step 02

Select the whole model by pressing “A”, after your model is fully highlighted, press “R” .  The cursor will change to a rotation symbol.

Blender to Unity Step 03

After you see the rotation symbol, press the minus key “-“ then type the number “90” then “X” then press “enter”.  This will rotate the model by -90 degrees on the X axis.  You can see it going along the green axis within the blender view.

Blender to Unity Step 04

Take note that the model should still be fully selected during these actions, if not then press “A” again to make sure the model is fully selected.  Then press “Ctrl+A” , this will bring up the apply panel.  Click on the Rotation & Scale.  This will zero out the models rotation and scale size.

Blender to Unity Step 05

Make sure your model is still fully highlighted, press “R” .  The cursor will change to a rotation symbol again.

After you see the rotation symbol, type the number “90” then “X” then “enter”.  This will rotate the model by 90 degrees, back to its original position.  However, you can now see the rotation on the X axis is 90 degrees.  This is now its default value, and when you import this model into unity, it will counter the -90 degrees that Unity places on a blender file and it will equal to 0.

After all is done, go to the top menu bar.  Click on File –> Export –> FBX.

When the export window prompts up, your focus will be at your Export FBX settings.  Match the settings shown above.

here is a list of changes based off the default values starting from the top down.

  • Scale button is toggled off.  It’s a small button that is next to the value, Scale: 1.00, you don’t want that button darken, (pressed down), you want the button to be light and popping up.  This can be easily missed.
  • Apply Scale changes from All Local into FBX All
  • If the model is simple and you only need the mesh, deselect all and just have the mesh selected.

Choose a location to save the file, name it, then click on Export FBX.

Unity – Moment of Truth

There are a few ways to import an FBX model, we will use the drag and drop feature.

locate the FBX file in your computers folder, drag and drop it within the unity folder directory of your choice.

Blender to Unity Step 11

Take the lamp model and drop it into your scene, just drag and drop.

This is the moment of truth.  You want to see your scale values at 1, and your rotation value at 0.  These are the numbers you are looking for.  The model is facing the correct side.  Your values are ideal.  This is especially important when you start scripting, and your rotations are not following the logic.

Outro

Thank you for reading, I hope it has helped you.  Be advised that this works with multiple models in one blender file.  So you can have multiple objects that are parented with children.  Select them all, rotate, apply and follow the directions, it will work just the same, and remember to name your objects within blender.  Even if you will change them within Unity, it will help you when you start working with bigger files.

If the process seems a bit long, it really isn’t.  it takes me about 15 seconds to convert it with the correct rotations and scales in an FBX format no matter how large or how many objects are selected.  Keep in mind you can have preset FBX format settings.  I just wanted to be as clear as possible in detailing the procedure since I had to dig though a few forms and experience trial and error before I got the right settings, especially when blender updated.

If you have any questions, you can e-mail me, or comment below.

If you would like to see this as a video, let me know as well.

Thanks

Soja Exiles