Files
AssetUsageAudit/Source/AssetUsageAuditEditor/Public/AssetUsageAuditUserSettings.h
T
MagentaDolphin b7f5343a73 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>
2026-09-03 17:07:59 +07:00

76 lines
2.5 KiB
C++

// NextGenium 2026. Asset Usage Audit.
#pragma once
#include "CoreMinimal.h"
#include "Engine/DeveloperSettings.h"
#include "AssetUsageAuditUserSettings.generated.h"
/**
* Per-user panel state, written to Saved/Config/.../EditorPerProjectUserSettings.ini.
*
* Separate from UAssetUsageAuditSettings on purpose. That one is DefaultConfig and lands in
* Config/DefaultEditor.ini, which is version-controlled: exclusion lists and export formats are
* team decisions and should be reviewable. Which types someone happened to tick last Tuesday is
* not, and committing it would make every teammate's panel jump around on sync.
*
* Not shown in Project Settings - GetCategoryName is inherited but the class carries no
* EditAnywhere properties, so there is nothing to render. This is state, not configuration.
*/
UCLASS(config = EditorPerProjectUserSettings)
class ASSETUSAGEAUDITEDITOR_API UAssetUsageAuditUserSettings : public UDeveloperSettings
{
GENERATED_BODY()
public:
static UAssetUsageAuditUserSettings* Get();
/** Audit scope: level packages to sweep. Empty means all levels. */
UPROPERTY(config)
TArray<FString> LastLevelPackages;
/** Short class names ticked in the type menu. */
UPROPERTY(config)
TArray<FString> VisibleTypeNames;
/** Substring filter on a Blueprint's generated class. */
UPROPERTY(config)
FString GeneratedClassFilter;
/**
* Verdicts left visible, by name rather than by index.
*
* Names because the enum will gain values: an index saved today would silently mean a different
* verdict after the next one is inserted, and the user would find their filter quietly changed.
*/
UPROPERTY(config)
TArray<FString> VisibleVerdictNames;
/** EAuditViewMode as an integer. Validated on load. */
UPROPERTY(config)
int32 ViewMode = 0;
/** EFileExportMode as an integer. Validated on load. */
UPROPERTY(config)
int32 ExportMode = 0;
/** EReferenceStrengthFilter as an integer. Validated on load. */
UPROPERTY(config)
int32 ReferenceStrength = 0;
/** EAssetUsageProvenance bitmask that a row must carry. */
UPROPERTY(config)
int32 RequiredProvenance = 0;
/** Whether the export pulls in referenced assets. */
UPROPERTY(config)
bool bIncludeDependencies = true;
/**
* Deliberately absent: the search box.
*
* Restoring it would reopen the panel showing nothing, with the reason sitting in a text field
* the user is not looking at. A filter that hides everything must be something they just typed.
*/
};