No announcement yet.

Group variables in blueprint

  • Filter
  • Time
  • Show
Clear All
new posts

    Group variables in blueprint


    I am following this video tutorial: to change parameters of a dynamic material on a mesh during runtime. The problem is that my model is splitted up into different meshes to get better lightmap quality. I have added all meshes as variables in the blueprint but I cannot connect more than one variable into the "create dynamic material instance" node. Doing separate identical blueprints for every meshpart would solve the issue but seems to me like a dumb way to solve it, I would like to kind of group them all together. Can I add all meshpart variables to an array or something like that and connect the array into changing the dynamic material instances?

    Click image for larger version

Name:	DynamicMaterials.png
Views:	1
Size:	286.5 KB
ID:	1195959

    I don't understand.
    If each mesh uses a different material, Then each one needs it's own dynamic instance.
    But if they use the same material, You can just set them all to the same one.

    Never say Never, Because Never comes too soon. - ryan20fun

    Frames Per Second is NOT a proper performance metric, You should use frame time. You can read this or this as to why.
    (Profiling) Tools: RenderDoc (UE4 Plugin), NVIDIA nSight, AMD GPU PerfStudio, CodeXL
    Good articles/Series: A trip through the Graphics Pipeline 2011


      I would add them all to an array and then use a for each loop to make the MIDs for them all. Then I would add all the MIDs to an MID array and anytime you need to set MID settings, you loop over that array too.
      Ryan Brucks
      Principal Technical Artist, Epic Games


        Under the hood, what UE4 does is loop through all objects connected to the function node target pin and call the function for each of them, so of course this is only possible for functions that don't have output pins, because N input objects mean N return values.

        (Maybe this feature could be improved by turning the return pins into arrays when multiple objects are connected.)


          Thank you very much for the replies guys! I was actually going for RyanB`s approach but in the end I solved it globally in the level blueprint with Material parameter collections