Importing a Blender map
Exporting a Map from Blender into UE4 The purpose of this page is to provide the required steps to import a map from Blender into UE4. It is possible to use Blender as a rudimentary UE4 map authori...
Exporting a Map from Blender into UE4
The purpose of this page is to provide the required steps to import a map from Blender into UE4.
It is possible to use Blender as a rudimentary UE4 map authoring tool to create basic maps which can then be expanded inside the UE4 Editor.
Why use Blender to make UE4 maps?
Some users will be more efficient using Blender to create basic map meshes than using the tools within UE4.
Blender is able to handle the early stages of "roughing out" a UE4 map.
Authoring the early "roughing out" content of a map within Blender opens up the possibility to use Blender as part of the workflow. This is attractive to some members of the UE4 community with skills and experience in Blender.
Using Blender for this work will not detract from the overall quality of the final map produced.
Concepts
The most basic scenario is to create and export a rectangular prism. To achieve this objective two objects are required in Blender:
- A rectangular prism to display in UE4 (visual); and
- A rectangular prism for collision calculations in UE4 (physics).
If only a single general purpose mesh is provided, then within UE4 the player will “fall through” this mesh (if they are standing on it and if gravity is applicable) or walk through this mesh it is being used as a wall.
UE4 relies on the specific structure of the names of the exported meshes to understand the purpose of each mesh.
Naming Requirements
UE4 will read the name of each mesh when importing into UE4 to determine if a mesh is:
- a display mesh; or
- a collision mesh.
To create a rectangular prism for the UE4 player character to stand on requires:
- a visual mesh (the rectangular prism which is displayed in UE4) can be named almost anything; and
- the associated 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 to be generated by 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 akin to an instruction to UE4 than hard geometry physically depicting the shape of the object.
If a collision mesh is created within Blender as a rectangular prism but the name of that mesh includes the sphere prefix ("USP_") then UE4 will create a sphere collision object rather than the rectangular prism that was authored. Pay close attention to the names given to meshes in Blender.
The official guide to the collision meshes and their usage is found at:
Workflow
The required workflow includes:
- 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; and
- update materials on the map as needed.
Textures/Materials from Blender to UE4
The materials used in Blender can be influence (but not completely control) the materials used by UE4. The connection is based on the material name. In summary the material process is:
- set up UV coordinates on the display meshes (noting the collision mesh is never rendered and so never needs UV coordinates);
- apply a material in Blender (empty is ok); and
- in UE4, create a material with the same name and it should be applied to all the mesh elements that had that specific material applied in Blender.
Automating the creation of collision meshes
For any map that is more than a trivial placement of boxes it is a tedious process creating each related collision mesh after the visual meshes are created. The following python script which can be run in Blender will automate this process:
This script will:
- take any selected meshes;
- create a duplicate of them in layer 2 (collections in versions of Blender 2.80 or higher);
- name these newly created meshes according to the format "UXC_[mesh_name]_[number]" (this will allow UE4 to interpret these meshes as collision meshes).