Author Topic: How to pass a parameter value from one graph node to another  (Read 4026 times)

So here is my specific use case I would like to figure out:

 I have several substance materials feeding a multi-material blend and would like to automate the picking of the  mask color value (greyscale) via a value that is passed from parameters within the individual materials. We have a large set of base materials each with predefined mask values and it would greatly speed up the process to not have to always input the mask color value into the multi-material blend node for every new substance for publish.

 Is this type of action possible via functions? or maybe is there a way to connect an output to something that will set the values within the multi-material blend node?
Last Edit: March 07, 2014, 08:24:18 pm

Would love to just pick someone's brain on this topic, any thoughts would be greatly appreciated.

So, I haven't dealt with multi-material blends too much, but I know you can expose instance parameters to the scene graph, and you can link multiple instance node parameters that way (link all material level and contrast values in the hot rod template for example).

But it sounds like instead of passing a parameter from the scene level down to multiple node levels, you want to pass a parameter from one node into another node.

I think you might be able to do this if each of your materials output a solid matID color texture, then you alter the multi-material blend to add a new input for that matID texture, then set the material color to sample that texture.

I'm just spit-balling. But I can't see any other way to pass something between nodes than through texture outputs/inputs.

You could create a function for the mask value and then at the root of the graph, set a parameter that adjusts the function. The function will use get variable to read the value and then operate on it. For each mask value on a node that you want to be controlled by this global value, just create any empty function. You can create a function in the explore and drag and drop it to each empty function you create. I do this to create a global control so that I change a single parameter and all nodes looking at this function will update.


Integrations Product Manager / Training
Twitter: The3DNinja

Thanks for the suggestion, I will try it out on some future experiments. As for my current purposes, I went with something similar to what dayveeman suggested.

I nested a mask_ID uniform color node within each of my materials, and set the output to one of the materials the multi-material blend supported (in this case i wanted a greyscale mask so I used the metallic outputs). I then modified both the material blend graph and the multi-material blend to use the value from the metallic to drive the mask instead of a paramter-controlled value. This worked great, as I can control the intended mask value from elsewhere, and it is all automated when plugging my many materials in since I no longer need to set any parameters manually.