Dependency Scanner
The Dependency Scanner is the core analysis tool of Elys Asset Tools. It provides bidirectional dependency analysis to help you understand asset relationships in your project.
Overview
The scanner can analyze:
- Individual assets
- Entire folders (recursive)
- Multiple selections
And discover:
- Dependencies - What assets this uses
- Referencers - What uses this asset
- Bidirectional - Both directions at once
How It Works
Scanning Process
graph LR
A[Select Folder] --> B[Scan Assets]
B --> C[Query Asset Registry]
C --> D[Find Dependencies]
D --> E[Find Referencers]
E --> F[Generate Report]
F --> G[Display Results]
Data Sources
The scanner uses two primary sources:
-
Asset Registry (Fast)
- Lightweight asset metadata
- Cached dependency information
- Very fast for large projects
-
Editor Asset Library (Slower)
- Actual asset reference checking
- More accurate for referencers
- Used when precision is needed
Features
Bidirectional Analysis
Get a complete picture of asset relationships:
Inbound (Referencers)
- What Blueprints use this asset?
- What materials reference this texture?
- What maps include this actor?
Outbound (Dependencies)
- What does this Blueprint depend on?
- What textures does this material use?
- What assets are required by this map?
Recursive Scanning
When scanning folders:
- All subfolders are included
- Assets are organized by folder
- Progress indicator for large operations
Result Filtering
Filter results by:
- Asset type (Blueprint, Material, Texture, etc.)
- Folder location
- Reference type (hard vs soft references)
Usage
From Content Browser
- Right-click a folder in the Content Browser
- Select Elys Asset Tools → Analyze Folder Dependencies
- View results in the Asset Tools Panel
From Tools Menu
- Go to Tools → Elys Asset Tools → Asset Dependency Analyzer
- Select a folder or asset
- Choose scan type (Dependencies, Referencers, or Both)
- Click Scan
Via Blueprint
// Get the subsystem
UERP_AssetToolsEditorSubsystem* Subsystem =
GEditor->GetEditorSubsystem<UERP_AssetToolsEditorSubsystem>();
// Scan a folder
FERP_AssetDependencyScanResult Result = Subsystem->ScanFolder("/Game/MyFolder");
// Access results
TArray<FAssetData> Dependencies = Result.Dependencies;
TArray<FAssetData> Referencers = Result.Referencers;
Via C++
// Create scanner
UERP_AssetDependencyScanner* Scanner = NewObject<UERP_AssetDependencyScanner>();
// Configure scan
Scanner->SetScanType(ERP_ScanType::Bidirectional);
Scanner->SetRecursive(true);
// Execute scan
FERP_AssetDependencyScanResult Result = Scanner->ScanPath("/Game/MyFolder");
// Process results
for (const FAssetData& Asset : Result.Dependencies)
{
UE_LOG(LogElysAssetTools, Log, TEXT("Dependency: %s"), *Asset.AssetName.ToString());
}
Scan Results
Result Structure
USTRUCT(BlueprintType)
struct FERP_AssetDependencyScanResult
{
// Assets being scanned
UPROPERTY(BlueprintReadOnly)
TArray<FAssetData> ScannedAssets;
// What these assets depend on
UPROPERTY(BlueprintReadOnly)
TArray<FAssetData> Dependencies;
// What references these assets
UPROPERTY(BlueprintReadOnly)
TArray<FAssetData> Referencers;
// Scan metadata
UPROPERTY(BlueprintReadOnly)
float ScanDurationSeconds;
UPROPERTY(BlueprintReadOnly)
int32 TotalAssetsScanned;
};
Understanding Results
Internal References References within the scanned folder (expected dependencies)
External References References outside the scanned folder (important for move/delete decisions)
Circular References Assets that reference each other (potential issues)
Use Cases
Before Moving Assets
Check what references your assets:
// Check if folder is safe to move
FERP_AssetDependencyScanResult Result = Subsystem->ScanFolder("/Game/ToMove");
// If external referencers exist, handle them first
if (Result.Referencers.Num() > 0)
{
UE_LOG(LogElysAssetTools, Warning, TEXT("Folder has external references!"));
}
Before Deleting Assets
Verify no external dependencies:
// Check if safe to delete
bool bSafeToDelete = Subsystem->IsFolderSafeToDelete("/Game/ToDelete");
if (!bSafeToDelete)
{
UE_LOG(LogElysAssetTools, Error, TEXT("Cannot delete - has external references"));
}
Finding Unused Assets
Scan for assets with no referencers:
FERP_AssetDependencyScanResult Result = Subsystem->ScanFolder("/Game/Content");
for (const FAssetData& Asset : Result.ScannedAssets)
{
if (Result.Referencers.Num() == 0)
{
UE_LOG(LogElysAssetTools, Log, TEXT("Unused: %s"), *Asset.AssetName.ToString());
}
}
Dependency Auditing
Understand what your assets depend on:
// Scan a critical blueprint
FERP_AssetDependencyScanResult Result = Scanner->ScanAsset("/Game/Blueprints/BP_Core.uasset");
// Log all dependencies
UE_LOG(LogElysAssetTools, Log, TEXT("Blueprint depends on %d assets"), Result.Dependencies.Num());
Performance
Optimization Tips
- Use Asset Registry when possible - Faster for most queries
- Scan specific folders - Don't scan /Game/ root unless necessary
- Filter results - Apply filters to reduce processing time
- Cache results - Store scan results for repeated operations
Typical Performance
| Operation | Small Project (< 1K assets) | Large Project (> 10K assets) |
|---|---|---|
| Folder scan | < 0.5 seconds | 1-5 seconds |
| Recursive scan | < 1 second | 5-15 seconds |
| Full project scan | < 2 seconds | 30-60 seconds |
API Reference
See Dependency Scanner API for complete API documentation.
Next Steps
- Move Operations - Use scan results to plan moves
- Safe Deletion - Delete assets safely after scanning
- User Guide: Analyzing Dependencies - Step-by-step tutorial