Creating a Custom Asset Editor in Unreal Engine 5
The code for this article can be found here.
Table of Contents:
Introduction
In Unreal Engine 5, UObjects are the basis for Assets. When interacting with Skeletal Meshes, Static Meshes, or anything in the Content Browser, it will derive from UObject. The editing experience for assets can be very different and customized for specific workflows. When you are editing a behavior tree, it is a much different experience than editing a Blueprint, for example. During the course of development, you are likely to create a custom asset type that requires some sort of editor, and this blog post will detail that.
In our example, we will be creating an asset editor for a Noise object. This will handle generation of various Noise patterns.
A perlin noise texture
One can expect after reading this blog to come out with this knowledge:
- How to create an Editor Module.
- How to create an Editor Toolkit.
- Rudimentary Slate UI.
Creating the Runtime Code
Our asset is relatively simple, it will proxy to FastNoiseLite.
Download the .h and put it into your Source directory.
Add the following Header file to import it:
After this, we create our Asset object, our Noise.
Note that in the source file we have an Editor only PostChangeProperty event which is called whenever a property is changed in the inspector. It would be best to check which property was changed, but for the conciseness we will just set all properties within FastNoise.
Creating the Editor Module
One of the easier way to create Modules is to use Rider. Unreal Engine doesn’t have a module creator, and relies on creating files manually.
If you don’t have the ability to use Rider, you can create the following files: