FComponentEditorUtils::AttemptApplyMaterialToComponent

Attempts to apply a material to a component at the specified slot.

Windows
MacOS
Linux

References

Module

UnrealEd

Header

/Engine/Source/Editor/UnrealEd/Public/Kismet2/ComponentEditorUtils.h

Include

#include "Kismet2/ComponentEditorUtils.h"

Source

/Engine/Source/Editor/UnrealEd/Private/Kismet2/ComponentEditorUtils.cpp

Syntax

static bool AttemptApplyMaterialToComponent
(
    USceneComponent * SceneComponent,
    UMaterialInterface * MaterialToApply,
    int32 OptionalMaterialSlot
)

Remarks

Attempts to apply a material to a component at the specified slot.

Returns

True if the material was successfully applied to the component.

Parameters

Parameter

Description

SceneComponent

The component to which we should attempt to apply the material

MaterialToApply

The material to apply to the component

OptionalMaterialSlot

The material slot on the component to which the material should be applied. -1 to apply to all slots on the component.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss