Skeletal animations in Unreal Engine 5. How to import a 3D model?
The newest version of Epic Games’ 3D tool – Unreal Engine 5 – brings many benefits to the table, as well as a few challenges. One of the issues that we encountered when working with the software was importing 3D models. Today’s quest is to understand the bones system animation concept and go through a case study of creating a skeleton in an Unreal Engine 5 project.
What is Unreal Engine?
Unreal Engine, developed by Epic Games, is a suite of integrated tools used to create interactive experiences, predominantly in the gaming industry. However, thanks to its versatility, Unreal Engine is also used in human-machine interface designs, architectural visualisation or creating and running simulations. When writing this article, the latest version is Unreal Engine 5, released in September 2021.
Unreal Engine toolkit for 3D animations
When it comes to 3D animation, Unreal Engine is particularly adept due to its robust suite of animation tools. It includes the following:
- Sequencer. It is Unreal Engine’s built-in nonlinear editor for creating cinematic animations, in-game cutscenes, and more. You can animate properties over time using keyframes, allowing for the creation of complex sequences involving camera movements, character animations, audio, and visual effects.
- Skeletal Animation Systems. This is used to animate organic 3D characters (i.e., people, animals, monsters) and other complex, technical objects (i.e., vehicles, devices, machines). A skeletal mesh is defined by a hierarchy of bones, which can be animated to create realistic movement. This system also supports Inverse Kinematics, which makes more natural movements in character joints, like adjusting leg movements based on terrain.
- Control Rig. Rigging refers to the process of creating the bone structure of a 3D model, then used to animate the object regarding the animator’s intentions. Control Rig is Unreal Engine’s system for creating pose-based deformations directly within the engine. It offers a node-based interface for defining complex behaviours and can be used with Sequencer to create character animations.
- Physics-Based Animation. Unreal Engine also provides tools for simulating physics-based animation, like cloth, fluids, or rigid bodies. This allows for the creation of a realistic movement that reacts to in-game physics, like a flag flapping in the wind.
- Animation Blueprints. Blueprints is a visual scripting system used for creating complex animation logic, such as determining which animations to play under certain conditions, blending animations, and manipulating animations dynamically based on gameplay conditions.
These features, along with Unreal Engine’s powerful rendering capabilities and advanced material system, make it an excellent tool for creating rich and immersive 3D animations.
Check out HMI consulting and development services
Learn moreExternal software for 3D modelling
Since Unreal Engine serves as a typical game engine environment for developing games or applications, it is not inherently equipped to sculpt 3D objects, draw textures, or animate objects. Hence, creators often opt to generate content through external 3D tools before importing the finished assets into Unreal Engine. The most popular tools for creating 3D animations are Blender, 3ds Max and Maya, and from the CAD segment Catia, Autodesk Alias and Siemens NX.
Skeleton, skeletal mesh and skeletal animation
A skeleton (sometimes called “bones system”) is a rigging technique that is used to create complex and realistic movements. It does not resemble a real-world biological skeleton; thus, it consists of various “bones”, each representing a different part of a 3D model that can be manipulated independently or collectively. Bones are linked to specific parts of the skeletal mesh. Mesh is a visual surface of a shape model defined by the underlying skeleton.
The combination of skeleton and skeletal mesh leads to skeletal animation. It is a technique of 3D animation in which an object is represented in two parts: a visual surface (the mesh) and a system of interconnected bones (skeleton) that sets the character in motion. Skeletal animation is the most popular, widely used method to animate objects composed of multiple elements while maintaining specific relations between them.
Example
Let us consider a 3D model of an excavator.
First, a 3D artist creates a mesh, i.e., the visual representation of the machine that includes elements such as the cab, the boom, the stick or the bucket.
Then, they prepare a digital skeleton inside the model. It consists of bones for each part that is supposed to move – a bone for the boom that would allow it to move up and down, another for the stick to move inward and outward, or a bone for the bucket to mimic digging and dumping movements.
Once the skeleton is created, it is time to attach it to the mesh through the rigging, i.e., to link each bone to the mesh element it is to move. The boom bone will be linked to the boom part of the mesh, the stick bone to the stick part, and so on. The result of this process is the skeletal mesh.
When the animation process starts, the animator moves the bucket bone in motion. Because of the associations set up during rigging, the mesh around the bucket follows the movement of the bone, and the excavator appears to be digging.
How to import 3D designs to an Unreal Engine project?
While there are several ways of importing and animating 3D models in Unreal Engine (among others blending or building object hierarchy tree), we focus today on bones system and rigging.
Though a bit complex, this method involves adding an entire skeleton to the 3D model and setting numerous physical constraints to ensure they work well when movement is enacted.
It provides realistic and natural motion behaviour for many interdependent objects, making it particularly useful for complex objects with intricate relationships between parts. For example, imagine reproducing an animation of a working car engine while maintaining the natural operation of all its mechanisms, such as differentials, gears, pistons, or, as mentioned above, the motion of the digging excavator with several active cylinders.
However, this method has significant challenges. It requires proficiency in several 3D software packages and extensive modules to build a bone system and define its physical relationships. Additionally, a deep understanding of data exchange between the 3D program and Unreal Engine (or another game engine like Unity) is crucial.
Furthermore, while this method provides rich tools and huge possibilities, Unreal Engine (and game engines in general) only support the import of skeletal mesh and disregard data on physical constraints and connections in the bone system. These constraints then need to be redefined inside Unreal Engine, which can be a significant task.
DigiTwin case study: how we imported and animated a 3D excavator model
DigiTwin is Spyrosoft’s R&D project. It is a digital twin of a physical excavator model; the application captures the data from the machine’s movement and plays it back on a tablet in real time. Both the physical and digital devices have movement points such as cabin rotation, up and down activity in two parts of the boom and the bucket motion.
We have prepared the 3D model in Blender, as the files are relatively convenient to import to the Unreal Engine project. Because of the complexity of the device and its movement (several elements and cylinders), we have decided to import the animation by creating the bones system.
In general (but it is not obligatory in every case), Unreal Engine manage the data with other 3D software by the Autodesk Filmbox format (*.fbx) regardless of the 3D graphics package used to create a skeletal mesh. After importing a 3D model into Unreal Engine, we get the basic components: Skeleton, Skeletal Mesh, Physical Asset and Animation Blueprint.
While working on the bone system and rigging, we encountered technical obstacles requiring the team to have expertise in 3D software and data exchange. Unreal Engine (and all game engines generally) supports wireframe mesh during import but not directly physical constraints. To make the movements of the excavator as realistic as possible, we recreated some of the connections in the Unreal Engine, in the Animation Blueprint asset. In the picture below, you can see the whole model with related assets that were created in the import process.
As mentioned, Unreal Engine does not support the physical limitations of external 3D software when importing. We decided to use an additional object called “Socket” to solve this problem. Sockets come in handy when importing elements for the 3D model. In our case, we used them because, inside Animation Blueprint, they can easily define the relation between Bone and Socket with the “Look At” node.
How do Sockets work for us? If we have some objects and need to align them during animation playing, the idea of connecting Bone to Socket sounds like a solution. The “Look At” node checks a target position and aligns a connected bone to it if it detects a transformation.
To sum up
As Unreal Engine 5 is a quite recent release, we must deal with some areas anew. DigiTwin, a project described above as an example of a 3D model importing case, is Spyrosoft’s R&D initiative to get to know the freshest Epic Games’ engine. I hope the trail we already blazed will help you develop new, fascinating projects using Unreal Engine 5.
Start your next project in Unreal Engine with Spyrosoft
Are you planning to launch your next product in the Unreal Engine technology? Look no further than Spyrosoft for comprehensive support. Our team is a collective of skilled experts, boasting extensive experience working with Unreal Engine’s complex toolset. Whether you aim to develop an intuitive, interactive HMI, or harness the full power of Unreal Engine’s dynamic 3D animation features, we stand ready to guide you through the process. Learn more about the scope of our HMI services here.
About the author