Supplying Data to a Graph

There are different ways to supply data to a graph, depending on its output type.

Constants

Use a constant when you need a specific value that should not change, for example, the value of pi in a geometric formula. Constants can be used in any type of graph, and do not appear in a tool's rollout.

The Constant node can be used for different data types, depending on what you enter as its value:
  • Use a numeric string without a decimal point to create an integer constant (Int32). For example, 2 creates the integer number two.
  • Use a numeric string with a decimal point to crate a single-precision floating-point value (Single). For example, 2. or 2.0 creates the scalar value two.
  • Use 3 comma-separated values between square brackets to create a Vector3, for example, [1.5, -0.5, 4].
  • Use 4 comma-separated values between square brackets to create a Vector4, for example, [1.5, -0.5, 4, 0].
  • Put a sequence of characters between double quotes to create a string, for example, "Hello World!".

There are other nodes in the Constants category for various float and integer values. For other types, such as transforms or quaternions, you can find some constants in other categories like Geometry - Matrix and Geometry - Rotation, along with other nodes for creating values from basic data types like floats and vectors.

Parameters

Use a parameter node when you want to allow users to set values in the tool's rollout. You can specify the parameter's name as it appears on the rollout, as well as other data depending on the type of parameter. Parameters cannot be used in compounds.

You should always make sure that parameter names are not only meaningful for your users, but also unique and distinct from reserved MaxScript keywords.

The order in which parameters appear in the rollout by default is determined by a "depth-first" search of the graph, that is, by starting at the root output node and tracing left along the top connection in each successive node to a parameter node, before backing up and repeating along the next unsearched connection. You can override this by specifying a custom UI as described in Customizing the UI of an MCG Tool.

Note: You can use Parameter: Asset nodes to supply data from an external file to a graph. See Working with External Files in MCG.

Implicit parameters

Implicit parameters represent data about the object controlled by an instance of an MCG-based tool in a scene. They allow you get this data and use it in a graph. Different implicit parameters are available, depending on the output type of a graph. For example, a modifier graph can use an implicit parameter to get the current mesh from the previous modifiers in the stack. Implicit parameters do not appear in a tool's rollout.

Inputs

Use an input node for data that is required by a compound. There are different nodes in the Inputs category for different data types. Inputs can be used only in compound graphs, which do not have rollouts.