Material Parameter Collection

Hello

I have been using a UMaterialInstanceDynamic to set my material parameters. But I now got the need of using a material parameter collection. The thing is that I have tried to search after how to do it in c++ but haven’t found a thing. How do you change material parameter collections parameter from source code?

Thanks for your time

If you want to create the material instance dynamic and changed the parameters use something like this:

UMaterialInstanceDynamic* MatInstance = UMaterialInstanceDynamic::Create(UMaterialInterface* ParentMaterial, this);
MatInstance->SetVectorParameterValue(FName param, Color);
MatInstance->SetVectorParameterValue(FName param, Brightness);

Hope that gets you in the right direction.

Good luck and don’t forget the Karma points =)

I found a simular question here: UMaterialParameterCollectionInstance and MinimalAPI - Programming & Scripting - Unreal Engine Forums and it answered my question!