get_material_stats
Read per-asset shader complexity for a material or material instance, including instruction, sampler, and texture-sample counts, to inspect performance without modifying the asset.
Instructions
Read PER-ASSET shader complexity for a material or material instance (instruction counts, sampler/texture-sample counts) -- the numbers the Material Editor's Stats panel shows, unlike get_shader_info (project-wide/global). Read-only: does not Modify()/dirty the asset. Render-adjacent: forces synchronous shader compilation on the FIRST call for a given material (UMaterialEditingLibrary::GetStatistics blocks on FMaterialResource::FinishCompilation); subsequent calls are fast once the shader map is cached. Works for both UMaterial and UMaterialInstance (UMaterialInterface's GetMaterialResource is virtual/overridden on both).
Returns: { material_path, material_class, num_vertex_shader_instructions, num_pixel_shader_instructions, num_samplers, num_vertex_texture_samples, num_pixel_texture_samples, num_virtual_texture_samples, num_uv_scalars, num_interpolator_scalars, compile_errors: string[], stats_valid: bool }
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| material_path | Yes | Full path to the material or material instance (e.g., '/Game/Materials/MyMaterial.MyMaterial') |