UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FMaterialOverrideNanite Struct Reference

#include <MaterialOverrideNanite.h>

Public Member Functions

UMaterialInterfaceGetOverrideMaterial () const
 
void SetOverrideMaterial (UMaterialInterface *InMaterial, bool bInOverride)
 
bool Serialize (FArchive &Ar)
 
bool FixupLegacySoftReference (UObject *OptionalOwner=nullptr)
 

Public Attributes

bool bEnableOverride = true
 

Protected Attributes

TObjectPtr< UMaterialInterfaceOverrideMaterial
 
TSoftObjectPtr< UMaterialInterfaceOverrideMaterialRef
 

Detailed Description

Storage for nanite material override. An override material can be selected, and the override material can be used according to the current settings. We handle removing the override material and its dependencies from the cook on platforms where we can determine that the override material can never be used.

Member Function Documentation

◆ FixupLegacySoftReference()

bool FMaterialOverrideNanite::FixupLegacySoftReference ( UObject OptionalOwner = nullptr)

Resolve and fixup anylegacy soft pointer. Call this from the owning object's PostLoad(). Returns true if any fixup was done.

◆ GetOverrideMaterial()

UMaterialInterface * FMaterialOverrideNanite::GetOverrideMaterial ( ) const
inline

This will return the cached override material pointer, if the override material is set, or nullptr otherwise. In a cooked game this will always return nullptr if the platform can't support nanite.

◆ Serialize()

bool FMaterialOverrideNanite::Serialize ( FArchive Ar)

Serialize function as declared in the TStructOpsTypeTraits.

◆ SetOverrideMaterial()

void FMaterialOverrideNanite::SetOverrideMaterial ( UMaterialInterface InMaterial,
bool  bInOverride 
)

Setup the object directly.

Member Data Documentation

◆ bEnableOverride

bool FMaterialOverrideNanite::bEnableOverride = true

Stored flag to set whether we apply this override.
This is useful when evaluating an override along a hierachy of settings. We default to true to always override.

◆ OverrideMaterial

TObjectPtr<UMaterialInterface> FMaterialOverrideNanite::OverrideMaterial
protected

Reference to our override material. This is only non-null in cooked packages, and is only non-null for cooked platforms that support nanite.
Note that we skip default serialization and use special logic inside Serialize().

◆ OverrideMaterialRef

TSoftObjectPtr<UMaterialInterface> FMaterialOverrideNanite::OverrideMaterialRef
protected

Legacy editor soft reference that has been replaced by OverrideMaterialEditor.


The documentation for this struct was generated from the following files: