Optimization¶
10 tools for asset performance, memory, compression, LOD and streaming settings, and optimization suggestions.
Back to the index.
analyze_asset_performance¶
Read-only
Grade one asset Good, Fair or Poor against fixed thresholds, without changing it: the path is looked up in the asset registry and the asset loaded synchronously. Static meshes are graded on triangles summed over all render LODs (above 50k Fair, above 100k Poor), Texture2D on resolution (above 2K, above 4K), materials and instances on parameter count (above 25, above 50); fewer than 2 LODs or mips, a mesh or texture package over 50 MB and over 10 texture parameters only add performance_issues. Other classes get performance_rating Unknown. suggestions is fixed advice per class, not derived from the numbers; texture_sample_count counts texture parameters and instruction_count is always 0. A path missing from the registry or failing to load is an error. Many assets: execute_batch; a verdict: check_asset_optimization; shader stats: get_material_stats; memory: get_asset_memory_usage.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | Object path ("/Game/Meshes/SM_Rock.SM_Rock") or package path ("/Game/Meshes/SM_Rock") of an asset the asset registry knows |
Returns: { asset_path: string, asset_class: string, file_size_bytes: number, file_size_mb: number, optimization_type: string, lod_count?: number, triangle_count?: number, vertex_count?: number, section_count?: number, performance_rating: string, performance_issues: [string], suggestions: [string], width?: number, height?: number, mip_count?: number, compression_settings?: string, pixel_format?: string, parameter_count?: number, texture_sample_count?: number, instruction_count?: number }
check_asset_optimization¶
Read-only
Check one asset against fixed optimization thresholds and return a verdict, without changing it; the asset is found in the asset registry and loaded. Static meshes: LOD count (under 2 severe, under 3 mild), triangles over all render LODs (above 100k, above 50k) and package size (above 50 MB, above 10 MB). Texture2D: resolution (above 4K, above 2K), mips (under 2, under 4), package size and an advisory note for the TC_Default preset. Materials and instances: parameters (above 50, above 25) and texture parameters (above 10, above 5). Other classes: package size only. is_optimized turns false on any severe finding, optimization_status is the worst tier (Good, Fair, Poor), and issues pair one to one with recommendations. A path missing from the registry or failing to load is an error. Graded stats: analyze_asset_performance; more advice: suggest_asset_optimizations; fixes: set_asset_lod_settings, set_asset_compression.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | Object path ("/Game/Meshes/SM_Rock.SM_Rock") or package path ("/Game/Meshes/SM_Rock") of an asset the asset registry knows |
Returns: { asset_path: string, asset_class: string, file_size_bytes: number, file_size_mb: number, is_optimized: bool, optimization_status: string, issues: [string], recommendations: [string], lod_count?: number, triangle_count?: number, vertex_count?: number, width?: number, height?: number, mip_count?: number, compression_settings?: string, pixel_format?: string, parameter_count?: number, texture_sample_count?: number }
get_asset_compression¶
Read-only
Read a TEXTURE's compression settings (inverse of set_asset_compression): TC_* enum names plus pixel format and LOD group. Accepts UTexture2D / UTexture2DArray / UTextureCube / UTextureRenderTarget2D; hand it anything else and it does not error -- it answers is_texture=false and reports asset_class, so check that flag before reading the rest.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | Full /Game/... asset path |
Returns: { asset_path, asset_class, is_texture, compression_settings?, pixel_format?, lod_group?, source_format?, srgb?, never_stream?, note? }
get_asset_lod_settings¶
Read-only
Read a mesh's LOD config (inverse of set_asset_lod_settings): per-LOD triangle count, vertex count and screen size for UStaticMesh or USkeletalMesh, plus LODGroup, which exists on StaticMesh only. There is NO lod-bias field in the response -- see the note below before you go looking for it.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | Full /Game/... asset path |
Returns: { asset_path, asset_class, lod_count, lod_group?, lods:[{ lod_index, screen_size?, triangle_count, vertex_count }] }
get_asset_memory_usage¶
Read-only
Estimate the memory one asset needs from simple formulas, not a measurement, without changing it; the asset is found in the asset registry and loaded. Static meshes count 24-byte vectors, three per triangle plus one per vertex, over all render LODs; Texture2D 4 bytes per texel over the whole mip chain, whatever the compression; materials and instances 1 KB per parameter; any other class reports its package size. memory_usage bands the estimate per class (Low, Medium, High, Very High; Unknown for other classes) and optimization_tips is one fixed line per class. file_size_bytes is the package file on disk, 0 when there is none. A path missing from the registry or failing to load is an error. The disk size alone is get_asset_file_info, a graded report analyze_asset_performance, the whole editor's memory get_memory_usage.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | Object path ("/Game/Meshes/SM_Rock.SM_Rock") or package path ("/Game/Meshes/SM_Rock") of an asset the asset registry knows |
Returns: { asset_path: string, asset_class: string, file_size_bytes: number, file_size_mb: number, memory_type: string, lod_count?: number, triangle_count?: number, vertex_count?: number, section_count?: number, estimated_memory_usage_bytes: number, estimated_memory_usage_mb: number, memory_usage: string, optimization_tips: string, width?: number, height?: number, mip_count?: number, compression_settings?: string, pixel_format?: string, parameter_count?: number, texture_sample_count?: number }
get_asset_streaming_config¶
Read-only
Read the streaming knobs (inverse of set_asset_streaming_config). Works at two levels: with NO asset_path it reports the GLOBAL texture-streaming pool size (only when the editor runs a render-asset streaming manager -- an editor started with -nullrhi has none, and then streaming_manager_available is false and the pool size is omitted); with one, it adds that asset's NeverStream flag (which applies to any UStreamableRenderAsset -- textures AND static meshes) plus the texture-only LODGroup and VirtualTextureStreamingPriority. There is NO streaming_priority field -- see the note below.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | no | Optional /Game/... asset path; if omitted, returns global streaming config only |
Returns: { streaming_manager_available: bool, global_pool_size?: int, asset_path?, asset_class?, is_streamable?: bool, never_stream?: bool, lod_group?: string, lod_group_int?: number, use_virtual_texture_streaming_priority?: bool, note? }
set_asset_compression¶
Destructive Idempotent
Sets the REAL texture compression quality (UTexture::CompressionQuality) on a texture asset and saves it to disk. Only UTexture targets are supported (no engine-level "compression" concept exists for meshes/materials); non-texture assets fail honestly with success:false.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | The path to the asset in the asset registry. |
compression_type |
string | yes | The compression quality to apply: 'High', 'Medium', or 'Low' (case-insensitive). Maps to TCQ_High / TCQ_Medium / TCQ_Low. Any other value is a hard error. |
Returns: { asset_path: string, compression_type: string, asset_type: string, original_file_size_bytes: number, original_file_size_mb: number, is_texture: bool, compression_quality_applied?: string, current_compression_settings?: string, pixel_format?: string, width?: number, height?: number, mip_count?: number, saved: bool, success: bool, message: string, error?: string }
set_asset_lod_settings¶
Destructive Idempotent
Sets the REAL LOD count on a UStaticMesh (adds/removes FStaticMeshSourceModel entries via AddSourceModel/RemoveSourceModel, rebuilds via PostEditChange, saves to disk). SkeletalMesh LOD-count mutation is NOT supported (would require the FLODUtilities mesh-reduction subsystem, out of scope) -- read-only LOD info is still reported honestly. Non-mesh assets fail with success:false.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | The path to the asset in the asset registry. |
lod_count |
integer | yes | The desired number of LOD levels (1-8). Must be an integer. Only mutates for UStaticMesh; reported but not applied for SkeletalMesh/other. |
Returns: { asset_path: string, requested_lod_count: number, asset_type: string, current_lod_count?: number, total_triangles?: number, total_vertices?: number, lod_data?: [object], saved?: bool, success: bool, message: string, error?: string, final_lod_count: number, lod_efficiency?: number, lod_recommendations?: [string] }
set_asset_streaming_config¶
Destructive Idempotent
Sets the REAL NeverStream flag (UStreamableRenderAsset::NeverStream) on a texture or static mesh and saves it to disk. enable_streaming=true clears NeverStream (asset streams on demand); enable_streaming=false sets it (asset stays fully resident). Assets with no such knob (e.g. Material) fail honestly with success:false.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | The path to the asset in the asset registry. |
enable_streaming |
boolean | yes | Whether to enable streaming for the asset (maps to NeverStream = !enable_streaming). |
Returns: { asset_path: string, enable_streaming: bool, asset_type: string, file_size_bytes: number, file_size_mb: number, is_streamable: bool, never_stream?: bool, saved?: bool, success: bool, message: string, error?: string }
suggest_asset_optimizations¶
Read-only
List optimization advice for one asset, without changing it; the asset is found in the asset registry and loaded. critical_suggestions come from thresholds: a static mesh with fewer than 2 render LODs or over 100k triangles across them, a Texture2D above 4K or with fewer than 2 mips, a material or instance with over 50 parameters or over 10 texture parameters, and any package over 50 MB. performance_suggestions and memory_suggestions are fixed advice per class plus package-size notes above 10 MB, and suggestions joins all of them with eight generic lines every asset gets; other classes get a not-analyzed note instead of class advice. A path missing from the registry or failing to load is an error. For a pass/fail verdict use check_asset_optimization, for graded stats analyze_asset_performance.
| Parameter | Type | Required | Description |
|---|---|---|---|
asset_path |
string | yes | Object path ("/Game/Meshes/SM_Rock.SM_Rock") or package path ("/Game/Meshes/SM_Rock") of an asset the asset registry knows |
Returns: { asset_path: string, asset_class: string, file_size_bytes: number, file_size_mb: number, suggestions: [string], critical_suggestions: [string], performance_suggestions: [string], memory_suggestions: [string], lod_count?: number, triangle_count?: number, vertex_count?: number, width?: number, height?: number, mip_count?: number, compression_settings?: string, pixel_format?: string, parameter_count?: number, texture_sample_count?: number }