UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IMaterialProvider Class Referenceabstract

#include <MaterialProvider.h>

Public Member Functions

virtual int32 GetNumMaterials () const =0
 
virtual UMaterialInterfaceGetMaterial (int32 MaterialIndex) const =0
 
virtual void GetMaterialSet (FComponentMaterialSet &MaterialSetOut, bool bPreferAssetMaterials=false) const =0
 
virtual bool CommitMaterialSetUpdate (const FComponentMaterialSet &MaterialSet, bool bApplyToAsset)=0
 

Member Function Documentation

◆ CommitMaterialSetUpdate()

virtual bool IMaterialProvider::CommitMaterialSetUpdate ( const FComponentMaterialSet MaterialSet,
bool  bApplyToAsset 
)
pure virtual

Commit an update to the material set. This may generate a transaction.

Note that a target may not allow applying the material to an underlying asset, or may not even allow having the material applied to the instance, in which case the function will return false without doing anything.

TODO: We may decide that we want some functions to query whether the object allows one or the other, or we may break this out into a separate interface. We'll wait to see when this actually becomes necessary to see the most convenient way to go at that point.

Parameters
MaterialSetnew list of materials
Returns
true if successful

◆ GetMaterial()

virtual UMaterialInterface * IMaterialProvider::GetMaterial ( int32  MaterialIndex) const
pure virtual

Get pointer to a Material provided by this Source

Parameters
MaterialIndexindex of the material
Returns
MaterialInterface pointer, or null if MaterialIndex is invalid

◆ GetMaterialSet()

virtual void IMaterialProvider::GetMaterialSet ( FComponentMaterialSet MaterialSetOut,
bool  bPreferAssetMaterials = false 
) const
pure virtual

Get material set provided by this source

Parameters
MaterialSetOutreturned material set
bAssetMaterialsPrefer the underlying asset materials. This may be ignored by targets to which this is not relevant.

◆ GetNumMaterials()

virtual int32 IMaterialProvider::GetNumMaterials ( ) const
pure virtual
Returns
number of material indices in use by this Component

The documentation for this class was generated from the following file: