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

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

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