feat: asset usage audit plugin
Editor tool for the LA and 3D departments: which assets each level uses, which are used nowhere, and export of a chosen set. Three modules. AssetUsageAuditCore holds the whole analysis and links no UI and no editor-only asset pipeline, so it stays runnable from a commandlet; AssetUsageAuditEditor holds the Slate panel and everything that needs UnrealEd or AssetTools; AssetUsageAuditTests holds 152 specs. Load-bearing decisions, each of which produces a wrong answer if undone: - Dependency queries are always Package + NoRequirements, never Hard. The map-to-external-actor edges the OFPA gatherer emits carry Game|Build without Hard, so a Hard query drops all 16117 external actor packages in this project. There is deliberately no Hard constant in the code. - Crossing into another map is allowed only from a level or its external actor package. Without that rule WP_Main reported 18136 assets, of which 9994 belonged to L_MainLevel, reached through the GameMode. - The verdict has five states, never a bool. The registry cannot see FMOD events, DataTable rows or string-built paths; those are Unknown, and the tool never proposes a deletion. - Copying .uasset files does not preserve references - they are stored as full package paths. Only the Migrate layout produces something Unreal can open; the others write a manifest so the graph can be rebuilt. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
// NextGenium 2026. Asset Usage Audit.
|
||||
|
||||
using UnrealBuildTool;
|
||||
|
||||
public class AssetUsageAuditEditor : ModuleRules
|
||||
{
|
||||
public AssetUsageAuditEditor(ReadOnlyTargetRules Target) : base(Target)
|
||||
{
|
||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
PublicDependencyModuleNames.AddRange(new string[]
|
||||
{
|
||||
"Core",
|
||||
"AssetUsageAuditCore"
|
||||
});
|
||||
|
||||
// Everything editor-only and UI-shaped belongs here and nowhere else. Keeping this list
|
||||
// out of AssetUsageAuditCore is what lets the same analysis run from a commandlet later.
|
||||
PrivateDependencyModuleNames.AddRange(new string[]
|
||||
{
|
||||
"CoreUObject",
|
||||
"Engine",
|
||||
"AssetRegistry",
|
||||
"AssetTools", // MigratePackages - the only path that keeps references working
|
||||
"DeveloperSettings",
|
||||
"DesktopPlatform", // native folder picker for the export destination
|
||||
"EditorFramework",
|
||||
"InputCore",
|
||||
"Projects",
|
||||
"Slate",
|
||||
"SlateCore",
|
||||
"ToolMenus",
|
||||
"ToolWidgets", // SSearchBox, SSegmentedControl
|
||||
"UnrealEd",
|
||||
"WorkspaceMenuStructure" // places the tab under Tools in the Window menu
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user