Provide Alternative Inputs to the Group Node and Label the Group Node Ports

You can add a Default Value node to your graph. This way, MyColor provides a default input value, while the user can also provide an alternate input value. If an alternate is provided, it is used. Otherwise, the default value is used.

Add the default value nodes to the graph:

  1. Enter the group view, right-click the work area, and choose Tools Toggle Advanced Mode to go into advanced mode. This mode provides a larger selection of nodes.

  2. Right-click the work area and choose Graph Nodes Code Control Default Value to create a Default Value node.
  3. Connect the nodes as follows:
    • Connect the RGB attribute of MyColor to the Default attribute of Default Value.
    • Connect the Alternate attribute of Default Value to the group node. A new Alternate 0 port appears automatically.
    • Connect the Result attribute of Default Value to the Value attribute of Multiply.
  4. (Optional) Create a second Default Value node and connect it to MyMultiplier as follows:
    • Connect the Float attribute of MyMultiplier to the Default attribute of Default Value.
    • Connect the Alternate attribute of Default Value to the group node. An Alternate 1 port appears automatically.
    • Connect the Result attribute of Default Value to the Value attribute of Multiply.

    Group node ports are renamed (in the parent group node at left).

Label the group node ports:

  1. Select the group node. On the Properties panel, make sure that Active Socket is set to 0, then change the Active Socket Label to MyColor.

    The first port of the group node is now renamed to MyColor 0.

  2. Repeat for the second port. Set Active Socket to 1, and change the Active Socket Label to MyMultiplier.

    The second port of the group node is now renamed to MyMultiplier 1.

    Choose the Active Socket value, then enter the Active Socket Label.

Supply an alternate input value:

  1. Exit the group view and create a Color node (Hw Shader Nodes Values Color).
  2. Connect the RGB attribute of the Color node to the MyColor attribute of the group node.
  3. This alternate Color node is used instead of the default value.

    Color node provides alternate input value and its value is used instead of the default value.

  4. (Optional) Repeat for the Float multiplier. Create a Float node (Hw Shader Nodes Values Float) and connect its Float attribute it to the MyMultiplier port of the group node.

Remove the color override: