Download

Storing some default values

I recently started learning UE4 and thought about creating some universal blueprints for objects that will work according to the same principle (contain some things, sort them and transform them to other ones), but will have different geometry and different material parameters (scalar and vector ones). I thought that creating a new material, blueprint (that will calculate some really complicated things) for each new object will be too long to do. And if I wanted to make some changes, it will take me to make changes in every blueprint. It will also take too much disk space.

What I decided to do:

  1. Make one universal **Material **with parameters: color, specular, roughness and opacity (some sort of glass material that will have different properties for each object).
  2. Make a ***Blueprint ***that will contain 3 Static Meshes (one with this glass material and others will have “non-changeable” materials) and will assign these meshes and material parameters on BeginPlay event. It will choose parameters depending on the Public String Variable that will contain object’s ID (I mean brand and model, like “Chevrolet_Camaro” or “Toyota_Corolla”). I had a doubt that it will assign same parameters to different objects due to the fact of that I’m using one material for multiple objects, but it doesn’t happen, it works fine. Parameters will be chosen from presetted ones, that I will store in some Container (see paragraph 3).
  3. Make some list of these parameters, that will look like this:


Chevrolet_Camaro
{
Meshes: {*list of meshes*}
Color: {0.1, 0.2, 1};
Specular: 0.1;
Roughness: 0.4;
Opacity: 0.8;
}

Toyota_Corolla
{
Meshes: {*list of meshes*}
Color: {1, 0.9, 0};
Specular: 0.5;
Roughness: 0.6;
Opacity: 0.7;
}


Or maybe it will will look like UE4 Structure or a table, it doesn’t matter. But the main thing is that it will contain certain number of **presetted **parameters that can be taken and applied in Blueprint.

I’m not sure, what asset I can use to make it. I tried to make it with Structures but it is not quite right, I think. I tried to google this problem, but I found nothing. So the question is: What asset should I use to make this thing? Or maybe I will have to make this “list” in another program? Any help is appreciated.

UPD: Sorry for my English, I’m not a native English speaker :stuck_out_tongue:

I think what you’re looking for is material instances.

The have all of these features. You can make one master material and tweak lots of parameters on the instance in blueprint:

https://www.youtube.com/watch?v=JavKsjv9esg