Custom asset category?

A great tut for custom asset:
http://www.wraiyth.com/?p=209

The asset type I created is in Create Advanced Asset > Miscellaneous category, can I use my own category? Is there a specifier to do this?

Thanks!

You can register custom categories using the RegisterAdvancedAssetCategory function from the AssetTools module. You’d then need to use the registered category flag in the GetCategories function of your custom type asset actions.

The AI module provides an example of doing this. See FAIModule::StartupModule for the registration, and FAssetTypeActions_Blackboard::GetCategories for an example of using the registered flag in the asset type actions.

I notice that tutorial doesn’t actually cover creating asset type actions, however they’re pretty simple. FAssetTypeActions_Enum provides a pretty basic example, just remember to register them with the AssetTools module (via RegisterAssetTypeActions).

Aswesome info; I’ve managed to put together the Browser Asset menu I wanted, thanks.
But, we can’t have sub categories there, can we?!

Sub-menus would be very nice indeed! I managed to put my most common asset classes to “Gameplay” but would love to create branching structure from there. But for now I will most likely end up defining bunch of custom categories just to group types together… :confused: shame.

1 Like

Done, now it is all nice and tidy!

For everyone who is still looking for sub menus:
There is an override GetSubMenus() in the FAssetTypeActions_Base, that you can use for it.

If you want MyCustomCategory->SubMenuCategory you need to register your “MyCustomeCategory” with RegisterAdvancedAssetCategory and use this in the GetCategories() function.
And then add all you SubCategories in the GetSubMenus(), for example:

const TArray<FText>& FBodySetTypeAction::GetSubMenus() const
{
	static const TArray<FText> SubMenus
	{
		INVTEXT("SubMenuCategory ")
	};
	return SubMenus;
}