Extending the Editor with FExtender
Example
TSharedPtr<FExtender> TestExtender = MakeShareable(new FExtender);
TestExtender->AddToolBarExtension("CommonActions", EExtensionHook::After, NULL, FToolBarExtensionDelegate::CreateStatic(&FOS_SLV_CommandsCallbacks::BuildToolbar));
FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
LevelEditorModule.GetToolBarExtensibilityManager()->AddExtender(TestExtender);
Create the extender.
Add the toolbar (or menu) extension, defining where it should be placed and the create function.
Find the correct module.
Add the extender to the Extensibility Manager
Extensibility Managers
Global
Add to all asset editors - ie, Actor Blueprint, Animation Blueprint, Data Asset, etc
FAssetEditorToolkit::GetSharedToolBarExtensibilityManager()->AddExtender(TestExtender);
Level Editor
FLevelEditorModule& LevelEditorModule = FModuleManager::LoadModuleChecked<FLevelEditorModule>("LevelEditor");
LevelEditorModule.GetToolBarExtensibilityManager()->AddExtender(TestExtender);
Persona
FPersonaModule& PersonaModule = FModuleManager::LoadModuleChecked<FPersonaModule>("PersonaModule");
PersonaModule.GetToolBarExtensibilityManager()->AddExtender(TestExtender);
Animation Blueprint
IAnimationEditorModule& AnimationEditorModule = FModuleManager::GetModuleChecked<IAnimationEditorModule>("AnimationEditor");
AnimationEditorModule.GetToolBarExtensibilityManager()->AddExtender(TestExtender);
Actor/Object Blueprints
NOT Animations, Data Assets, etc - ones that have a normal Blueprint Graph
FBlueprintEditorModule& BlueprintEditorModule = FModuleManager::LoadModuleChecked<FBlueprintEditorModule>("Kismet");
BlueprintEditorModule.GetMenuExtensibilityManager()->AddExtender(TestExtender);
Last updated