A class used to create new assets, such as when creating files in the content browser.

Not to be confused with UActorFactory which is unrelated and has a different purpose.

Usage

See Creating new assets in the Content Browser via code

Other examples

Get all factories

You can get a list of all engine factories via:

TArray<UFactory*> Factories = IAssetTools::Get().GetNewAssetFactories();

Find the appropriate factory for a given class

UClass* AssetClass = TheAssetClassYouWantToCreate;
 
TArray<UFactory*> AllFactories = IAssetTools::Get().GetNewAssetFactories();
for(UFactory* Factory : AllFactories)
{
	//Blueprint factories and gameplay abilities factories require
	//special handling despite being nearly identical to each other
	if(auto* BPFactory = Cast<UBlueprintFactory>(Factory))
	{
		if(AssetClass->IsChildOf(BPFactory->ParentClass))
		{
			return Factory->GetClass();
		}
	}
	else if(auto* GABPFactory = Cast<UGameplayAbilitiesBlueprintFactory>(Factory))
	{
		if(AssetClass->IsChildOf(GABPFactory->ParentClass))
		{
			return Factory->GetClass();
		}
	}
	else if(AssetClass->IsChildOf(Factory->GetSupportedClass()))
	{
		return Factory->GetClass();
	}
}