Content Browser
Credits:
Thanks to mklabs for his GAS Companion plugin, his content browser extension code is the original reason I pursued this system. Although no GAS Companion code is used in this plugin.
Some of the code is borrowed from the open-source VoxelCore plugin.
OmniToolbox allows any C++ class to be easily added to the content browser's context menu by simply adding the I_AssetDetails interface and returning true for AppearsInContextMenu.
Your asset will now automatically get a UOmniAssetDefinition and UOmniFactory to handle displaying it in the context menu and to create the asset.
The interface provides some utilities, such as enabling a class picker


When overriding AppearsInContextMenu, I recommend doing it like this:
virtual bool AppearsInContextMenu_Implementation() const override
{
return GetClass() == UEntityAbility::StaticClass();
}Handling it like this will prevent child classes from also attempting to appear in the context menu.
Blueprint support
I do NOT recommend using this system for blueprints. It's not good practice to have your base abstract classes be blueprints and there are many potential issues that can occur when loading blueprints like this.
To allow blueprints to appear in the content browsers context menu, a little bit more work is required:
Go to your editor settings and find
OmniToolboxand add your blueprint toContext Menu EntriesThe blueprint must implement
I_AssetDetailsto appear
Restart the editor.
The code that handles this system is only executed once and that is when the plugin is started.
Last updated