8#include "Materials/MaterialParameterCollection.h"
9#include "Kismet/GameplayStatics.h"
10#include "Engine/Engine.h"
11#include "Engine/World.h"
17 return MPCInstance->SetVectorParameterValue(ParameterName, Value);
27 return MPCInstance->SetScalarParameterValue(ParameterName, Value);
35 if (!WorldContextObject || !GEngine)
40 UWorld* World = GEngine->GetWorldFromContextObject(WorldContextObject, EGetWorldErrorMode::LogAndReturnNull);
41 UMaterialParameterCollection* Collection = LoadObject<UMaterialParameterCollection>(
nullptr, *Path);
42 if (Collection && World)
44 return World->GetParameterCollectionInstance(Collection);
static bool UpdateMaterialCollectionVectorValue(UMaterialParameterCollectionInstance *MPCInstance, const FName ParameterName, const FVector4 Value)
static UMaterialParameterCollectionInstance * LoadMaterialParameterCollectionInstance(const UObject *WorldContextObject, const FString &Path)
static bool UpdateMaterialCollectionScalarValue(UMaterialParameterCollectionInstance *MPCInstance, const FName ParameterName, const float Value)