Update directive utilities plugin

This commit is contained in:
2026-08-15 21:06:43 +02:00
parent 2fe7f83a38
commit a06fed1cba
103 changed files with 18211 additions and 1071 deletions

View File

@@ -0,0 +1,36 @@
// Copyright (c) 2026 Unreal Directive. Licensed under the MIT License.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Types/DirectiveUtilEditorAuditTypes.h"
#include "DirectiveUtilEditorAssetAuditLibrary.generated.h"
UCLASS()
class DIRECTIVEUTILITIESEDITOR_API UDirectiveUtilEditorAssetAuditLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
/** Returns assets with no known Asset Registry referencers. Results are candidates and may still be loaded indirectly. */
UFUNCTION(BlueprintCallable, Category = "Directive Utilities|Editor|Asset Audit")
static TArray<FAssetData> FindUnreferencedAssetCandidates(const FDirectiveUtilAssetAuditOptions& Options);
/** Returns Asset Registry dependencies whose packages cannot be found. */
UFUNCTION(BlueprintCallable, Category = "Directive Utilities|Editor|Asset Audit")
static TArray<FDirectiveUtilMissingAssetReference> FindMissingAssetReferences(const FDirectiveUtilAssetAuditOptions& Options);
/** Returns dependency cycles between assets in the scanned paths. */
UFUNCTION(BlueprintCallable, Category = "Directive Utilities|Editor|Asset Audit")
static TArray<FDirectiveUtilAssetDependencyCycle> FindAssetDependencyCycles(const FDirectiveUtilAssetAuditOptions& Options);
/** Builds a read-only report for assets in the scanned paths. */
UFUNCTION(BlueprintCallable, Category = "Directive Utilities|Editor|Asset Audit")
static FDirectiveUtilAssetAuditReport BuildAssetAuditReport(const FDirectiveUtilAssetAuditOptions& Options);
/** Converts an asset audit report to CSV text. */
UFUNCTION(BlueprintPure, Category = "Directive Utilities|Editor|Asset Audit")
static FString AssetAuditReportToCsv(const FDirectiveUtilAssetAuditReport& Report);
};

View File

@@ -2,6 +2,7 @@
#pragma once
#include "AssetRegistry/AssetData.h"
#include "CoreMinimal.h"
#include "EditorAssetLibrary.h"
#include "Types/DirectiveUtilEditorAssetTypes.h"
@@ -44,7 +45,8 @@ public:
/**
* Fixes up (and deletes) object redirectors found under the given directories, without loading every asset.
* Equivalent to the Content Browser's "Fix Up Redirectors in Folder", but scriptable and headless-friendly.
* Equivalent to the Content Browser's "Fix Up Redirectors in Folder". Unreal shows a completion dialog,
* so this returns Failure in unattended sessions instead of blocking the process.
* @param DirectoryPaths Directories to scan for redirectors. If empty, the entire registry is scanned.
* @param OutRedirectorsProcessed [out] The number of redirectors submitted for fix-up (the engine does not report per-redirector success).
* @return Success if the operation ran (even if nothing needed fixing), Failure otherwise (e.g. a fixup is already in progress).

View File

@@ -0,0 +1,49 @@
// Copyright (c) 2026 Unreal Directive. Licensed under the MIT License.
#pragma once
#include "CoreMinimal.h"
#include "AssetRegistry/AssetData.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Types/DirectiveUtilEditorBlueprintTypes.h"
#include "DirectiveUtilEditorBlueprintLibrary.generated.h"
class UBlueprint;
UCLASS()
class DIRECTIVEUTILITIESEDITOR_API UDirectiveUtilEditorBlueprintLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
UFUNCTION(BlueprintPure, Category = "Directive Utilities|Editor|Blueprint Inspection")
static EDirectiveUtilBlueprintCompileStatus GetBlueprintCompileStatus(const UBlueprint* Blueprint);
UFUNCTION(BlueprintCallable, Category = "Directive Utilities|Editor|Blueprint Inspection")
static TArray<FAssetData> FindBlueprintsByCompileStatus(
EDirectiveUtilBlueprintCompileStatus CompileStatus,
const FDirectiveUtilBlueprintSearchOptions& Options);
UFUNCTION(BlueprintCallable, Category = "Directive Utilities|Editor|Blueprint Inspection")
static TArray<FAssetData> FindBlueprintsByParentClass(
UClass* ParentClass,
const FDirectiveUtilBlueprintSearchOptions& Options,
bool bIncludeDescendants = true);
UFUNCTION(BlueprintCallable, Category = "Directive Utilities|Editor|Blueprint Inspection")
static TArray<FAssetData> FindBlueprintsImplementingInterface(
UClass* InterfaceClass,
const FDirectiveUtilBlueprintSearchOptions& Options);
UFUNCTION(BlueprintCallable, Category = "Directive Utilities|Editor|Blueprint Inspection")
static TArray<FAssetData> FindBlueprintsContainingComponentClass(
UClass* ComponentClass,
const FDirectiveUtilBlueprintSearchOptions& Options,
bool bIncludeDerivedComponents = true);
UFUNCTION(BlueprintPure, Category = "Directive Utilities|Editor|Blueprint Inspection")
static TArray<FName> GetUnusedBlueprintVariables(
UBlueprint* Blueprint,
bool bIncludeExternallyAccessibleVariables = false);
};

View File

@@ -0,0 +1,25 @@
// Copyright (c) 2026 Unreal Directive. Licensed under the MIT License.
#pragma once
#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Types/DirectiveUtilEditorTaskTypes.h"
#include "DirectiveUtilEditorTaskLibrary.generated.h"
class UDirectiveUtilEditorSlowTask;
UCLASS()
class DIRECTIVEUTILITIESEDITOR_API UDirectiveUtilEditorTaskLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
/** Starts a modal editor progress task. TotalWork must be greater than zero, and only one task can be active. */
UFUNCTION(BlueprintCallable, Category = "Directive Utilities|Editor|Task")
static UDirectiveUtilEditorSlowTask* StartEditorSlowTask(float TotalWork, const FText& Description, bool bCanCancel = false);
/** Displays a fire-and-forget editor notification. */
UFUNCTION(BlueprintCallable, Category = "Directive Utilities|Editor|Notification")
static bool ShowEditorNotification(const FText& Message, EDirectiveUtilEditorNotificationState State = EDirectiveUtilEditorNotificationState::Neutral, float ExpireDuration = 3.0f);
};