More work on the Asset Lookup system.

This commit is contained in:
2025-04-02 19:58:16 -04:00
parent aa511b9b8c
commit b4f918e15d
11 changed files with 22 additions and 17 deletions

View File

@@ -36,7 +36,6 @@ void UlxAssetLookup::ScanStaticMeshes()
{
TArray<FAssetData> FoundData;
FARFilter AssetFilter;
AssetFilter.PackagePaths.Add(FName(TEXT("/Game/StarterContent/Shapes")));
AssetFilter.PackagePaths.Add(FName(TEXT("/Game/StaticMeshes")));
AssetFilter.ClassPaths.Add(UStaticMesh::StaticClass()->GetClassPathName());
AssetFilter.bIncludeOnlyOnDiskAssets = true;
@@ -72,7 +71,7 @@ FString UlxAssetLookup::StaticMeshLoadPath(const FName &AssetName) const
UStaticMesh *UlxAssetLookup::GetStaticMeshByName(const UObject *Context, const FString &Name)
{
ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(Context);
FString Path = mode->GetAssetLookup()->StaticMeshLoadPath(FName(Name));
FString Path = mode->GetAssetLookup()->StaticMeshLoadPath(FName(FString("SM_") + Name));
if (Path.IsEmpty())
{
UE_LOG(LogLuprexIntegration, Error, TEXT("Static mesh not on search path: %s"), *Name);
@@ -91,7 +90,7 @@ UStaticMesh *UlxAssetLookup::GetStaticMeshByName(const UObject *Context, const F
UClass *UlxAssetLookup::GetTangibleClassByName(const UObject *Context, const FString &Name) {
ALuprexGameModeBase *mode = ALuprexGameModeBase::FromContext(Context);
FString Path = mode->GetAssetLookup()->TangibleLoadPath(FName(FString("Tan") + Name));
FString Path = mode->GetAssetLookup()->TangibleLoadPath(FName(FString("TAN_") + Name));
if (Path.IsEmpty())
{
UE_LOG(LogLuprexIntegration, Error, TEXT("Tangible not on search path: %s"), *Name);