Download

String Variable as Parametername in Material

Hey, i am trying to learn ue4 and i need some help. I’m trying to paint my landscape with multiple materials/surfaces, therefore i created a landscapematerial with multiple layerblends. Furthermore i copied the nodes of a preexisting material (with albedo, roughness, etc.) multiple times. Now i planned on changing these “blocks” of nodes for each material i would use. But if i change the albedo in on block all others change. I guess its because they have the same name. Is there a way to make every name custom, with variables for example? Like in one block its rocks.albedo, rocks.roughness and another one would use grass.albedo and grass.roughness?

Or maybe if there’s a far easier way to import multiple materials in the landscape material, i would be happy too :stuck_out_tongue:

I included a screenshot, just in case.

This picture is pretty bad, you canot zoom, but maybe you are duplicanting the same variable, so, obviously if you change one, others with the same name are going to change, in this case, you should rename each new variable in the details menu after making a duplicant, this way each variable has its own name and if you change 1, the other one wont be affected; in therms of the layer material, i strongly recommend you to first watch youtube videos about making layered materials, BTW, there is a max amount of layers you can add, not sure how many, but maybe 5 or 6, after this amount of layers each new layer will make another one fail, unless you have a lot of know-how about materials, you wont be able to increase the number of layers.

After making this variable (parameter), you can set a group to clasify all variables in the same category, under its details find “groups” write a name over the drop menu, for example “sassy_lady” then click another parameter and click the drop button next to Group, and choose that previous name, after this, find the material inside content folder, right click and “create instance” apply this instance to the landscape or any mesh instead of the original material, and now you are able to modify the instance and watch changes in the viewport instantly, you always have to work with instances.

You’re right about the variable names. I thought it could be possible, to solve this problem a bit like in c++ where you have mutiple class instances with different names but the attributes have the same name in each classinstance. Then i wouldnt have to rename every single one.

Ive watched some tutorials, but most of them just cover very basic materials, and not necessarily multiple materials painted on a landscape. The solution to this is, if im understanding you correctly, to use multiple material instances and not one landscapematerial because it has limited layers? I definitly look into that! Do you have a good tutorial you can recommend?