Importing a Blender map
Exporting a Map from Blender into UE4 The purpose of this page is to inform the reader of the the required steps to be able to import a map from Blender into UE4. In essence it is possible to use B...
Exporting a Map from Blender into UE4
The purpose of this page is to inform the reader of the the required steps to be able to import a map from Blender into UE4.
In essence it is possible to use Blender as a rudimentary UE4 map maker which can then be built upon in UE4.
Why use Blender to make UE4 maps?
If you are more comfortable editing meshes in Blender than the UE4 editor, it can be more efficient for you to create your basic basic map meshes in Blender.
The UE4 editor is a fantastic tool for making maps but it is likely that some members of our community will be more familiar with mesh editing in Blender than UE4.
Blender editing also allows for different workflows.
[Insert Image here once mod approved]
Concepts
If the reader wished to export a rectangular prism from Blender to UE4, two objects would be required:
- A rectangular prism to display in UE4 (visual); and
- A rectangular prism for collision calculations in UE4 (physics).
Therefore, if the reader wishes to export a rectangular prism from Blender into UE4 for the player to stand on, the reader must first create two meshes in Blender. If only a single general mesh is provided, then in UE4 the player will “fall through” this mesh (if they are standing on it and if gravity is applicable). UE4 interprets the names of the exported meshes to identify the purpose of each mesh.
Naming
UE4 will read the name of each mesh when importing to determine if a mesh is a display mesh or a collision mesh. Assuming the scenario is to import a rectangular prism for the player character to stand on, the visual mesh (the rectangular prism which is displayed in UE4) can almost be named anything. The collision mesh (which is usually the exact same size and dimensions of the display mesh) will require a special name. There are four special collision mesh names. Each type depends on the shape of the collision mesh being generated in UE4.
- Box – UBX_[RenderMeshName]_##
- Capsule – UCP_[RenderMeshName]_##
- Sphere - USP_[RenderMeshName]_##
- Convex Object – UCX_[RenderMeshName]_##
UE4 will interpret the vertices in the collision mesh and then create a physics object corresponding. Therefore the collision mesh created in Blender is more of an instruction to UE4 than an attempt to physically depict the shape of the object. By this we mean that if you draw a box shape in Blender but name it with the Sphere prefix then UE4 will create a sphere collision object rather than the box that was drawn. Therefore it is very important to correctly name your Blender objects. The official guide to the collision meshes and their usage is found at:
Workflow
Therefore it is possible to create a low-poly version of your map in Blender using the standard Blender mesh editing tools and then export the result to UE4. The process is:
- Create visual meshes in Blender including basic texture information.
- Create collision meshes in Blender.
- Select both visual and collision meshes in Blender and export to an FBX file.
- Import the FBX file into UE4 as a static mesh.
- Place the map into UE4.
- Update materials on the map as needed.
Textures/Materials from Blender to UE4
The Materials used in Blender can be leveraged to control the materials used by UE4. The connection is based on the Material name. In summary the process is:
- Set up UV coordinates on your display mesh (collision mesh is never rendered so no UV is required)
- Apply a material in Blender (empty is ok)
- In UE4, create a material with the same name and it should be applied to all the mesh elements that had that material applied in Blender.
A script to automate creation of collision meshes
For any map that is more than a trivial placement of boxes it is tedious to have to create a second set of collision meshes once the visual meshes are created. The following python script which can be run in Blender will automate these process for you:
This script will:
- take any selected meshes;
- create a duplicate of them in layer 2;
- rename these created meshes to UXC_[mesh_name]_[number] that that UE4 will interpret these created meshes as collision meshes.
There is a variable to set which will also automatically perform a “UV Unwrap” on the selected meshes if you would like to automatically create UV coordinates as well.