GniLudio
(GniLudio)
September 7, 2022, 3:42pm
1
Is it possible to add custom asset types to the asset menu in the content browser?
E.g. adding a Room or Creature blueprint (class) to the Gameplay sub-menu:
Hey there @GniLudio ! Looks like you have to set up a factory for it. I myself know little on this subject, so I’ll like a couple threads. First thread has a full example, second one has a response from Epic Staff with some pointers.
Yes, it´s possible for any UObject; you just have to create an asset factory for your custom class:
[image]
In runtime module:
#include "Runtime/Engine/Classes/Engine/DataAsset.h"
USTRUCT()
struct FMyItemInfo{
GENERATED_USTRUCT_BODY()
UPROPERTY(EditAnywhere)
FString itemName;
UPROPERTY(EditAnywhere)
UTexture2D* itemThumbnail;
UPROPERTY(EditAnywhere)
UBlueprint* itemBlueprint;
UPROPERTY(EditAnywhere)
FColor itemColo…
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 crea…
Hope this helps!
3 Likes