Skip to content

Commit

Permalink
fix:( #42 ) utility widgets
Browse files Browse the repository at this point in the history
- added utility widget assets to primary asset list, because we don`t need them to be removed and scanned
  • Loading branch information
ashe23 committed Nov 5, 2022
1 parent b66d9f0 commit 9a1b72a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions Source/ProjectCleaner/Private/Core/ProjectCleanerDataManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include "HAL/PlatformFileManager.h"
#include "Internationalization/Regex.h"
#include "Settings/ContentBrowserSettings.h"
#include "EditorUtilityBlueprint.h"
#include "EditorUtilityWidgetBlueprint.h"

FProjectCleanerDataManager::FProjectCleanerDataManager() :
bSilentMode(false),
Expand Down Expand Up @@ -59,7 +61,7 @@ void FProjectCleanerDataManager::AnalyzeProject()
FindUnusedAssets();
}

void FProjectCleanerDataManager::PrintInfo()
void FProjectCleanerDataManager::PrintInfo() const
{
UE_LOG(LogProjectCleaner, Display, TEXT("All Assets - %d"), AllAssets.Num());
UE_LOG(LogProjectCleaner, Display, TEXT("Unused Assets - %d"), UnusedAssets.Num());
Expand Down Expand Up @@ -665,11 +667,15 @@ void FProjectCleanerDataManager::FindPrimaryAssetClasses()

for (const auto& AssetTypeInfo : AssetTypeInfos)
{
UClass* AssetTypeCLass = AssetTypeInfo.AssetBaseClassLoaded;
const UClass* AssetTypeCLass = AssetTypeInfo.AssetBaseClassLoaded;
if (!AssetTypeCLass) continue;
FName ClassName = AssetTypeCLass->GetFName();
PrimaryAssetClasses.Add(ClassName);
}

// marking EditorUtility assets as primary also, because they may not be used in any level , but still have specific logic that user written for in editor usage
PrimaryAssetClasses.Add(UEditorUtilityBlueprint::StaticClass()->GetFName());
PrimaryAssetClasses.Add(UEditorUtilityWidgetBlueprint::StaticClass()->GetFName());
}

void FProjectCleanerDataManager::FindAssetsWithExternalReferencers()
Expand Down
4 changes: 3 additions & 1 deletion Source/ProjectCleaner/ProjectCleaner.Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public ProjectCleaner(ReadOnlyTargetRules Target) : base(Target)
"UnrealEd",
"ToolMenus",
"AssetTools",
"AssetRegistry"
"AssetRegistry",
"Blutility",
"UMGEditor"
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class FProjectCleanerDataManager : public ICleanerUIActions

bool IsLoadingAssets() const;
void AnalyzeProject();
void PrintInfo();
void PrintInfo() const;

// cli
void SetExcludeClasses(const TArray<FString>& Classes);
Expand Down

0 comments on commit 9a1b72a

Please sign in to comment.