How to Access a MaterialParameterCollection from C++

I have a C++ MaterialParameterCollection in my editor. I want to access this material parameter collection from my C++ code. What is the getter for accessing a specific material parameter collection, and how might I set a scalar and vector parameter within?

Thank you.

This is very challenging to get working the way you might want. The only way that worked for me was to use the KISMET interface library to access the MaterialParameterCollection and change a scalar value accordingly. This is done in the following way.

UKismetMaterialLibrary::SetScalarParameterValue(MyWorld, MyParameterCollection, FName(TEXT("MyScalar")), <MyScalarFloat>);

UKismetMaterialLibrary::SetScalarParameterValue(this, YourMPCName, FName(TEXT(“YourParameterName”)), YourNewParameter);I use this method to achieve dynamic modification