This repository aims to practice some Editor Tool Programming Patterns in Unreal Engine.
The repo contains an unreal project including an empty game and a plugin with some editor extension functionalities. Below lie the features and details of the plugin tool.
This project is developed and tested in version 5.3.2.
Custom menu entries and add quick some useful actions on assets. These actions can be invoked by right clicking the Asset in Content Browser.
🔹Add Prefixes: Detect the assets’ type and add recommended prefix on all selected assets’ names to fit naming convention.
🔹Duplicate Assets: Pop up a window for user to type in a number as duplicating times for selected assets.
🔹Remove Unused Assets: Check whether selected assets are referenced by current map or not. Unreferenced assets will be picked up together for user to confirm for deletion. “Fix Up Redirectors” will be executed on clicked.
Implementation using: AssetActionUtility
, EditorUtilityLibrary
, EditorAssetLibrary
.
Custom menu entries on Content Browser Folder. Right click any folder in content browser to access. Only one folder can be selected and multiple folders selected is currently not supported.
🔹Delete Unused Assets: Similar to the functionality listed above, but now it will traverse all assets on the selected folder.
🔹Delete Empty Folders: Check if the folder has any asset. Empty without asset will be deleted.
🔹Advance Deletion: Custom window displaying all assets for deletion under selected folder. Filter can be used to filter out assets fit demand.
Implementation using: GetAllPathViewContextMenuExtenders()
in Content Browser Module. Slate widget programming for Advance deletion dock tab and its list view.
Run WBP_QuickActorActions to use actor quick actions.
🔹Select Actors With Similar Name: Click any actor in level editor viewport and then click this button, it will select all actors with similar names in the viewport.
🔹Duplicate Actors: Duplicate selected actors along gizmo axis, with duplication times and distance between each duplication settings.
🔹Randomize Actor Transform: Apply random Yaw/Pitch/Roll rotation, random scale and random offset, all in custom range [min, max], to selected actors.
Implementation using: Editor Utility Widget, EditorActorSubsystem
.
Custom actor menu entries for lock/unlock actor selection. Right click Actors in Level Editor Viewport to use.
🔹Lock Actor Selection: Once clicked, selected actors will be no longer selectable unless you unlock. Shortcut: Alt+W.
🔹Unlock All Actor Selection: Once clicked, all actors locked before can be selectable again. To use this, you should right click on any selectable actors, or use shortcut: Alt+Shift+W.
Implementation using: FLevelViewportMenuExtender_SelectedActors
, Slate Style
Toggle actor selection locked/unlocked status. This is sync with above shortcut and right-click actions.
Implementation using: Slate Style, ActorTreeItem
, ISceneOutlinerInterface
.
Custom Editor Utility Widget for Auto Connect selected texture sampler nodes to material output node.
🔹Create Material From Selected Textures: Select AO, Diffuse, Normal, Roughness, Metallic textures and then click the button. A material asset will then be created. Open it and all related texture sampler nodes will auto-connect to material output node’s pins. OcclusionRoughnessMetallic (arm, orm) texture is also supported by changing the Channel Packing Type setting.
-
FARFilter.ClassNames
is marked deprecated when used for fix up redirectors. But if useClassPaths
with/Script/ObjectRedirector
, then ObjectRedirector class will not be identified correctly and leads to redirectors shown up in Advance Deletion window. -
Editor Utility Blueprint duplication:
UQuickAssetAction
inheritsUAssetActionUtility
, but related functions would not shown up unless there exists a derived blueprint class withUQuickAssetAction
as parent class. After this right click functionality will work fine but there will be double same ‘Advance Deletion’ under Window list of top menu. This might be a bug of UE 5.3.2.