4.25 Asset Factory not showing up in context menu?

I have the usual boilerplate code prepared but for some reason it does not show up in the context menu under ‘Blueprints’. What am I doing wrong?

Based on previous experience and code when I right click to create new asset under the ‘Blueprints’ it should show my new asset type to pick.

UMercusQuestFactory.h

#include "CoreMinimal.h"
#include "Factories/Factory.h"
#include "MercusQuestFactory.generated.h"

UCLASS()
class MERCUSPROJECT_API UMercusQuestFactory : public UFactory
{
	GENERATED_BODY()
public:
	UMercusQuestFactory();
	virtual uint32 GetMenuCategories() const override;
	virtual UObject* FactoryCreateNew(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override;
};

UMercusQuestFactory.cpp

#include "MercusQuestFactory.h"
#include "QuestSystem/Quest.h"
#include "AssetTypeCategories.h"

UMercusQuestFactory::UMercusQuestFactory()
{
	bCreateNew = true;
	bEditAfterNew = true;
	SupportedClass = UQuest::StaticClass();
}

uint32 UMercusQuestFactory::GetMenuCategories() const
{
	return EAssetTypeCategories::Blueprint;
}

UObject* UMercusQuestFactory::FactoryCreateNew(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn)
{
	UQuest* QuestAsset = NewObject<UQuest>(InParent, InClass, InName, Flags);
	return QuestAsset;
}

Quest.h

UCLASS()
class MERCUSPROJECT_API UQuest : public UObject
{
	GENERATED_BODY()
protected:
    UPROPERTY(EditAnywhere, Category = "Verix")
    FText QuestName;

    UPROPERTY(EditAnywhere, Category = "Verix")
    FText QuestDescription;
};

Just tested this on 4.24 and it seems to work fine there. I’m confused.

Nobody else has issues with this on 4.25? :o

having the same issue

I have the same problem on editor version 4.25.1
I solve it by creating child class from FAssetTypeActions_Base type. Then in my module StartupModule function i register asset type actions:

void FSociumSystemEditorModule::StartupModule()
{
	IAssetTools& AssetTools = FModuleManager::LoadModuleChecked<FAssetToolsModule>("AssetTools").Get();
	GameAssetCategory = AssetTools.RegisterAdvancedAssetCategory(FName(TEXT("SociumSystem")), LOCTEXT("SociumSystemCategory", "SociumSystem"));
	AssetTools.RegisterAssetTypeActions(MakeShareable(new FSociumSystemDatabaseActions(GameAssetCategory)));
}

class FSociumSystemDatabaseActions : public FAssetTypeActions_Base
{
public:
	FSociumSystemDatabaseActions(uint32 InAssetCategory);

	virtual FText GetName() const override;
	virtual FColor GetTypeColor() const override;
	virtual UClass* GetSupportedClass() const override;
1 Like

The same problem. Editor version 4.25.1

Hi, yes this seems to solve it but I’m not sure if it should still be listed as a bug or not :stuck_out_tongue:

Looks like “By-Design” behavior. If custom factory not added in Factory array - it not appear in ContextMenu:

1 Like

I’m just doing a factory so I can create a custom asset that I can ref in an actor, and use its’ data. The reason I’m not doing this in an actor inside the level is because it’ll be tampered with often by designers, and we don’t want it to be bound to the scene for collaboration. I need a separate asset as well, because I intend to make a custom editor for that asset.

However, does that mean I need to make a plugin to make factories work in 4.25? Haven’t worked with Modules outside of plugins, which seems a bit overkill to just add an asset to the context menu in the editor.

I’m seeing this too in 4.25. Registering the custom FAssetTypeActions_Base implementation seems to fix it. Not sure why but the IsAssetClassSupported doesn’t find one for a new asset type and so fails. Maybe the system provided a default one for you in the past.
This renders the various walkthrough examples broken as it stands.