Before we start discussing about the GraphEditor, let’s take a look at extending engine editor by blueprint.
1. Editor Utility Widget Blueprint
This tool helps you to create editor tool based on UMG, which can be created in the Content Browser.
Right click it with your mouse, it will show a SWindow
This tool can construct editor window like UMG, it contains a SPanel by default, and has a ability to use editor time only UMG widget, like the UDetailView:
I add a detail panel here, and set a random UObject to edit by it.
Advantages and disvantages of developing editor tool by this way are obvious:
- Faster than using slate in C++.
- Friendly to game designers.
- Perfect for personal tools.
But :
- Cannot merge while using git.
- Not all editor methods are BlueprintCallable. In fact, most of them are not.
- Not as flexible as using Slate.
2. Editor Utility Blueprint
Editor Utility Blueprint is a base class and is a collection of lots of useful tool classes.
EditorUtilityToolMenuEntry
It is helpful for MenuBar extension and Toolbar extension. Essencially, it is a collection of data with 8 virtual functions to override, and only 3 of the 8 are important, they are: Execute() CanExecute() and GetToggle()
I’ll and a button in MenuBar->Help like this:
First, we need to get out ehat the name of the menu is, it is hard to guess. First, find the Config directory under the root directory, add a ini file called DefaultEditorPerProjectUserSettings.ini here and type in:
[/Script/UnrealEd.EditorExperimentalSettings] bEnableEditToolMenusUI=true
Restart the editor, now you can see this in Menu-Winow:
Enable it, and now you can see:
It is especially helpful toolbar extension, because in Unreal Engine 4, there is only one Toolbar, but there are a lot of Toolbars with different name in Unreal Engine 5:
Back to EditorUtilityToolMenuEntry blueprint, set to:
Then, customizing a event called run, note that the name of the event must be “Run”.
Back to the ini file we used before, type in:
[/Script/UnrealEd.EditorExperimentalSettings] bEnableEditToolMenusUI=true [/Script/Blutility.EditorUtilitySubsystem] +StartupObjects=/Game/EU_Tutorial.EU_Tutorial // CopyReference in your blueprint widget to get the path.
Restart the engine editor, now you can see:
Override the Execute() woth your logic:
Assets Action Utility
AssetsActionUtility is a asset tool based on blueprint, it allows you to add scriptable button in asset menu of corresponding type.
It is simple to use, just create such a blueprint class and add EditorCallable function to it.
There are three virtual functions can be overwriten, GetSupportedClass makes this button only efftective in certain assets, such as StaticMesh I chose here.
IsActionForBlueprints should actually be called IsActionOnlyForBlueprints to be more accurate, to decide whether it can only be used for blueprints or both.