Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/UMaterialInstanceDynamic
Description
Use this function to set an initial value and fetch the index for use in SetScalarParameterByIndex. This function should only be called once for a particular name, and then use SetScalarParameterByIndex for subsequent calls. However, beware using this except in cases where optimization is critical, which is generally only if you're using an unusually high number of parameters in a material and setting a large number of parameters in the same frame. Also, if the material is changed in any way that can change the parameter list, the index can be invalidated.
| Name | InitializeScalarParameterAndGetIndex |
| Type | function |
| Header File | /Engine/Source/Runtime/Engine/Public/Materials/MaterialInstanceDynamic.h |
| Include Path | #include "Materials/MaterialInstanceDynamic.h" |
| Source | /Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceDynamic.cpp |
UFUNCTION (BlueprintCallable, Meta=(Keywords="SetFloatParameterValue"),
Category="Rendering|Material")
bool InitializeScalarParameterAndGetIndex
(
const FName & ParameterName,
float Value,
int32 & OutParameterIndex
)