I was wondering if there’s a way to create a reference to a material parameter collection, such that I can make an editable variable. I have a scene component blueprint that I add to objects that adds some highlight functionality to the material of the attached object. I could create a public material variable that I could then make a material instance dynamic from and do all of that jazz, but with a scene component blueprint it’s difficult to get the attached parent’s object type (static mesh, skeletal mesh etc, which you need to set the MID to), therefore it requires additional steps to get that attached parent’s material. I only want to change the material parameter collection on a per object basis, NOT at runtime.
The goal of this system is to be completely self-contained, so it grabs all necessary info from it’s attached parent, meaning no hard-coded references to object or mesh components.
There is no way to create a variable of a Material Parameter Collection (MPC), so you will need to select it on each node. To do this you will need to select the drop down menu for “Collection” on the node shown above and select the MPC you have created in your project. This way you can edit the values in one blueprint and have the changes carry over to another blueprint, or use the variables stored in the MPC in a material.
You will want to use the node shown above and the “Get” version of the same node to get/set the variable value in blueprints.
Let me know if any of that is unclear, hope it helps!
There is kind of a workaround - you can create a UDataAsset in C++ that has a Material Parameter Collection member variable and then use your DataAsset as variables in Blueprints - you can access the Material Parameter Collection variable inside your DataAsset just fine. Something like this from our “Robinson House” project:
Creating a variable for a Material Parameter Collection is something I would really like to be able to do as well. I also agree that its super weird that you cannot. Is there a technical limitation that makes it not possible or is it something that Epic hasn’t gotten around to implementing yet (notes that the original question was posted 4 years ago)?