How to Export Blender 3D Objects to Use in Unity
In this article, we will look at how you can export files from Blender to Unity so you can use the features of both of these applications for your 3D game projects. First, let’s look at both platforms.
What are Blender and Unity?
What is Unity? Unity is a cross-platform game engine that debuted in 2005 as software that only ran on the Apple Mac OS. The software has evolved over the years to support more operating systems and now supports more than 25 platforms.
Unity was designed from its first release to make game development more accessible to developers. When Unity came out in 2005, game development tools were not very easy to use. Most game engines relied only on command-line tools instead of visual and GUI based tools. Unity helped change that, making it possible for even new developers to get started creating games right away.
Unity can be used to create 2D, 3D, virtual reality (VR), and augmented reality (AR) games. It is not only used for games but also used by architects, engineers, and filmmakers for all types of 3D projects. Unity is free for personal use, so you can get started creating 3D projects simply by downloading Unity from the official website.
Last Updated August 2021
Use Blender to Create Beautiful 3D models for Video Games, 3D Printing & More. Beginners Level Course | By GameDev.tv Team, Rick Davidson, Grant AbbittExplore Course
Blender is a free, popular, open-source 3D creation suite. It supports a complete 3D pipeline. This includes modeling, rigging, animation, simulation, rendering, compositing, and motion tracking. You can even use Blender for 3D printing.
Advanced Blender users can customize its functionality with Python scripting to modify the application and build tools. Many of these tools are available as add-ons you can add to your own Blender installation.
Blender uses OpenGL to provide users with a consistent experience on whatever operating system they install it on. Blender is a cross-platform software that runs on Linux, Mac, and Windows that you can download at the official website.
Importing Blender objects into Unity
You can import Blender models into Unity, which will give you the ability to build 3D objects in a full-featured creation suite and use them in a friendly, flexible, cross-platform game engine. This feature allows you to use each tool where it is best suited for a full 3D game development workflow.
You can import Blender objects into Unity in two ways. One involves using a .blend file, while the other uses an .fbx file. Either method has its pros and cons. We will walk through both processes, and you can decide which technique suits your workflow.
If you read the documentation, importing a Blender model into Unity should be as easy as dragging and dropping a .blend file into Unity, and it just works. The other option is saving the .blend file in the Assets folder of your Unity project, and Unity will know what to do with it. It’s important to note that some manual steps are involved.
Differences between Blender and Unity
One big difference between Blender and Unity comes down to the configuration of their coordinate system. Each software uses X, Y, and Z axes to describe 3D objects, but Blender uses a right-handed coordinate system, and Unity uses a left-hand one.
What this means is that in Blender, the Z-axis points upward. But in Unity, the Y-axis points upward.
This difference we will have to deal with once we have imported our model into Unity. But before we get to that point, we will have to make a few adjustments to our Blender object to make sure the import process goes smoothly, and we get what we expect once the model is in Unity.
Preparing the model
If you are going to import a .blend file into Unity, you need to prepare it first. Let’s say you have a model like the one below:
The first thing you want to do is delete the default Blender camera and lamp. You want to use your model in Unity, not a fully rendered scene. So in the Scene Collection menu, find Camera and Light, left-click on them, and click Delete. In the layout above, this menu is in the top right.
Now you need to apply a transform to ensure that rotation for every axis of your model is 0 and the scale on each axis is 1. Go to the object menu then select apply/Rotation & Scale. This sets your model back to its default size and rotation so you can apply any transforms and rotation you need in Unity, where you will use it. You can do this in the Transforms panel of the Object Properties tab, as shown in the screenshot below.
Next, you need to set the origin in your model to a position that makes sense. Sometimes the origin can change accidentally as you are working on your model, so it is good to check it before importing it into Unity. This is so the model gets positioned correctly in your Unity scene, and you don’t have to modify its location relative to the floor each time you import it. We would want the human model we are using to stand on the floor in Unity. If that is at Y=0 in Unity, you want to set your model’s origin to this same coordinate.
To do this in Blender, use the 3d cursor by pressing Shift S/ Cursor to World Origin in the pie menu.
Now to set the origin to the location of the cursor, select the model in Object Mode and choose Object -> Set Origin -> Origin to 3D Cursor. You can see this in the screenshot below.
Now you want to make the normals of your model point outward. If you have ever imported a Blender model into Unity and some faces seem like they disappear, then you have run into the problem this change will fix. This happens because the mesh on your model has its normals pointing inward. The definition of a normal is the line perpendicular to the face of the mesh. This can either point inward or outward.
To make sure the normals on your model are pointing inward, switch to Edit Mode in Blender and navigate to Mesh -> Normals -> Recalculate Outside. You can see this in the screenshot below.
If you need to show both sides of a plane, then you should use a cube mesh or duplicate the face to create the effect. A single face should only be visible from one side. Unity only supports rendering one side per face. So the backface culling setting in Blender can be enabled or disabled. It doesn’t matter.
Now, after doing all of this, you may have modified your model’s rotation and scale. This is easy to do in a tool like Blender that has a lot of menus and functionality. Stray clicks and drags happen. So go back to the Transforms panel of the Object Properties tab and make sure that the rotation on all axes are 0 and the scale for each is 1.
Importing a .blend file into Unity
The .blend file format is the default file format of Blender. This file contains the models, materials, scene, rendering details, and the state of the Blender application when you saved it. When reopened in Blender, everything will look the same as when it was saved, down to how you have Blender configured.
The import process is automatic. If the .blend file is in your Unity project’s assets folder, Unity will detect it and transform it into the .fbx format that it can use. This will happen every time the file changes, so you can edit the model in Blender while using it with Unity.
After all the work to prepare the model, importing will now work as expected and will be the easiest step to the process. Since we are importing the .blend file, there is no need to export the model to another format. We can use the file as is now. You will need to add the .blend file to your Unity project’s Assets folder. You can accomplish this in a few ways:
- You could open up Finder or File Explorer and move the file there.
- You can drag and drop the file onto the Project tab when you have your project open in Unity.
- You could just save the file from Blender directly to the Assets folder and work out of there.
Once that is done, you can drag the model from your project’s Assets folder onto a scene, like the example in the screenshot below.
Importing an .fbx file into Unity
The other option for importing your Blender object into Unity is to first convert it into a .fbx file. You will still have to prepare your model as we did when we imported the .blend file. Remove everything you don’t need, like the camera and lights, so you are just exporting the model.
To start the export, go to File -> Export -> FBX, as shown in the screenshot below.
This will bring up the file view, like the one below.
In the Object Types menu, choose only Mesh unless you have a rig for a character model, then you should also select armature. And you have to select Apply Transform, leaving the default settings for the transform as is. Then click Export FBX and save the file.
To import the FBX file into Unity, the process is the same as it was for the .blend file. Just add it to the Assets folder or drop it onto the Project panel in Unity. Adding it to a scene in Unity also works the same. Just drag the newly imported model onto the scene.
Importing multiple blender models into Unity
If you have multiple blender objects in a single Blender file, it may be easier to export each model separately as a .fbx file and then import each model into Unity one by one. This will separate your original model from the models you will use in Unity. If you import the original directly, any change you make in Unity will affect the original Blender file.
If you have one model in each of your Blender files, importing the files directly into Blender should work fine. But if you want to keep your originals as they are, exporting the files as .fbx files might be the way to go.
So which of these methods would you use in your 3D development workflow? That depends on your preferences because either method we used here will work fine. Here are some pointers that may help you choose the proper method for your needs.
- If you are going to import .blend files, you will need Blender installed because Unity doesn’t actually do the conversion. It just recognizes the file extension, looks for Blender on the operating system, and then uses Blender to convert the actual model. If you don’t have Blender installed, it will not work. But that is not a big problem since you can download Blender for free on the Internet for either Linux, Mac OS X, or Windows operating systems.
- When you import a .blend file into Unity, Unity will watch the file for changes. So if you still have that .blend file open in Blender at the same time you have it in a Unity scene and change the model in Blender, it will be able to update the converted object that Unity is using. If you don’t know that this is happening, you may be surprised when your Unity game objects change in location and appearance unexpectedly.
- Exporting a Blender model as an .fbx file separates the model Blender will use from the one Unity will use. If you use this method and want to change your model again with Blender, you will have to delete your old exported model in Unity and re-import a newly exported .fbx file.
Blender and Unity work together well for developing 3D games as long as you know how to import Blender models into Unity. This seems to be straightforward, but there are a few manual steps. The process isn’t that hard to follow, and you have a couple of options to choose from. Once you try it once, you will have the process down.
Top courses in Blender
Blender students also learn
Empower your team. Lead the industry.
Get a subscription to a library of online courses and digital learning tools for your organization with Udemy for Business.