Skip to content

Commit

Permalink
[Fixed] Indirect asset searching for blueprint classes
Browse files Browse the repository at this point in the history
* also fixed text in standard texts
  • Loading branch information
ashe23 committed Aug 18, 2021
1 parent 46b221e commit 4023269
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -574,9 +574,17 @@ void FProjectCleanerDataManager::FindIndirectAssets()
FRegexMatcher Matcher(Pattern, FileContent);
while (Matcher.FindNext())
{
const FName FoundedAssetObjectPath = FName{Matcher.GetCaptureGroup(0)};
FName FoundedAssetObjectPath = FName{Matcher.GetCaptureGroup(0)};
if (!FoundedAssetObjectPath.IsValid()) continue;

// if ObjectPath ends with "_C" , then its probably blueprint, so we trim that
if (FoundedAssetObjectPath.ToString().EndsWith("_C"))
{
FString TrimmedObjectPath = FoundedAssetObjectPath.ToString();
TrimmedObjectPath.RemoveFromEnd("_C");

FoundedAssetObjectPath = FName{*TrimmedObjectPath};
}
const FAssetData* AssetData = AllAssets.FindByPredicate([&] (const FAssetData& Elem)
{
return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ int32 FProjectCleanerManager::DeleteAllUnusedAssets()
else
{
ProjectCleanerNotificationManager::AddTransient(
FText::FromString(FStandardCleanerText::AssetsSuccessfullyDeleted),
FText::FromString(FStandardCleanerText::UnusedAssetsSuccessfullyDeleted),
SNotificationItem::CS_Success,
10.0f
);
Expand Down
2 changes: 1 addition & 1 deletion Source/ProjectCleaner/Public/StructsContainer.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ struct FStandardCleanerText
constexpr static TCHAR* FailedToDeleteSomeAssets = TEXT("Failed to delete some assets");
constexpr static TCHAR* SearchingForUnusedAssets = TEXT("Searching for unused assets...");
constexpr static TCHAR* Scanning = TEXT("Scanning...");
constexpr static TCHAR* AssetsSuccessfullyDeleted = TEXT("Assets deleted successfully");
constexpr static TCHAR* UnusedAssetsSuccessfullyDeleted = TEXT("Unused assets deleted successfully");
constexpr static TCHAR* FoldersSuccessfullyDeleted = TEXT("Empty folders deleted successfully");
constexpr static TCHAR* LoadingAssets = TEXT("Loading assets...");
constexpr static TCHAR* FixingUpRedirectors = TEXT("Fixing up redirectors...");
Expand Down

0 comments on commit 4023269

Please sign in to comment.