Data Types

The Advanced Data Manipulation toolset in Particle Flow uses a variety of data types; following is a comprehensive list with illustrations of each type as a suboperator input connector:

Boolean - Blue

Complex - Cyan

Equal - Green

Integer - Indigo

Matrix - Maroon

Object - Orange

Pair - Pink

Quaternion - Yellow

Real - Red

Time - Teal

Vector - Violet

The colors are used by the input and output connectors in Data View, and, in certain cases, by buttons that enable additional inputs as alternatives to specifying values in the regular interface.

Most data types are self-explanatory. The following discussion covers the rest:

Pair and Complex Data Types

Some suboperators generate data that does not fit conveniently into the Vector, Integer, or Time format. Therefore, two new "artificial" types were added:

Pair = { Vector + Integer }

Complex = { Vector + Integer + Time } (not the traditional complex number).

Following is a discussion of situations in which the Pair and Complex types are used:

Object Suboperator - Point Position option

One of the inputs is of the Pair type = { Vector + Integer }, where the Vector input is the position in local coordinates of the object and the Integer input is the index of the object, as defined by the Select Object suboperator. The object index is needed because the Object suboperator can work with multiple objects at once. If there is a single reference object to work with then the Integer value should be set to 0. Also, as a reminder, indices in Data View are 0-based (start counting from 0). This is different from MAXScript, where indices are 1-based. Therefore, if you have several reference objects as defined in the Select Object suboperator, then their indices are 0, 1, 2, and so on.

Geometry suboperator - Closest Point option

The output is of the Pair type = { Vector + Integer } where Integer is a compound index that contains an object index and a face index, and Vector is the position in local face coordinates. When the closest point is calculated, the operator searches through all the reference objects, as defined by the Select Object suboperator, and finds the closest face as well as the closest point on the surface of this face. The local face coordinates use the edges of the face as the base vectors.

Geometry suboperator - Collision Point option

The output is of the Complex type = { Vector + Integer + Time } where Integer and Vector have the same meaning, as in the above instance, and Time is the time of the collision.

Geometry suboperator - Face Area and Face Selection options

The option can be used to calculate area of a face of an object (or the selection status of a face). And it looks like it is sufficient to supply the compound index as an index (object index + face index). However, the suboperator has a Pair-type input. This is done to simplify the wiring from the Closest Point option that has Pair as an output. If the object index + face index are created in a different way then you can use a Convert suboperator to create a Pair type; just use a zero vector as the other component of the Pair type.

Geometry suboperator - Point Color, Point Color Gradient, Point Self-Illumination, Point Mapping, Point Mapping Gradient, Point Material Index, Point Normal, Point Opacity, Point Position, Point Soft Selection, Point Speed options

One of the inputs is of the Pair type = { Vector + Integer } where Vector and Integer have the same meaning as in the Closest Point option.

Geometry suboperator - Random Surface Point option

The output is of the Pair type; the same meaning as in the Closest Point option.

Geometry suboperator - Random Volume Point option

The output is of the Pair type = { Vector + Integer } where Vector is the position in world coordinates and Integer is the index of the object used as a volume space.

Equal Data Type

The only suboperator that produces the Equal data type is the Parameter suboperator. The Parameter suboperator is particularly useful for setting (or letting the user set) the same parameter value for several suboperators. Very often this common parameter is exposed later in the interface.

One simple example: You would like to make a Data Operator that places particles randomly on the surface of an object, and sets a random initial speed. You'll use the Geometry suboperator (Random Surface Point) for position, and the Vector suboperator to define the speed with Deviation set to 360 degrees for a random spread of direction.

Both suboperators have the Random Seed parameter. So, naturally, you would like to expose the Random Seed parameter so the user can play with chaos setup. But it might seem strange to have two Random Seed parameters in the interface. Therefore, you can wire both Seed parameters in the Geometry and Vector suboperator into a single Parameter suboperator with the type Uniqueness Seed. You can then expose Random Seed of the Parameter suboperator.

The Equal data type has subtypes: Real, Integer, Time, Sync, and Seed. Each uses a different shade of green. The Parameter suboperator has several output types: Angle, Float, Percent, World (all are Real type), Integer, Time, Animation Sync (as Sync) and Uniqueness Seed (as Seed). Angle, Float, Percent and World just differ as they are shown to the user in the UI, they are all Real. You can wire the Parameter output only to the matching E inputs, which is usually quite obvious—if you link the Random Seed of a suboperator then the Parameter suboperator should have Uniqueness Seed type as well.

It is possible to live without the Parameter suboperator by using the standard 3ds Max script-wiring technique, and script-wiring the parameters of the suboperators, instead of linking them to a Parameter suboperator. However, script wiring is more time-consuming to set up, it does not have good visual reference as the Parameter suboperator, and it is prone to save/load and clone problems.

Compound Index

Sometimes it's necessary to pack two integer values into a single value, when, for example, an integer is used as a compound index = { object index and face/vertex index }. You can use the Convert suboperator to a) create a compound index out of to integer data; or b) split object index or face/vertex index out of a compound index. A compound index is not a new data type—it's a way to pack more information into an integer data channel.