Go to: Synopsis. Return value. Keywords. Flags. MEL examples.

Synopsis

getFluidAttr [-attribute string] [-lowerFace] [-xIndex int] [-xvalue] [-yIndex int] [-yvalue] [-zIndex int] [-zvalue]

getFluidAttr is NOT undoable, NOT queryable, and NOT editable.

Returns values of built-in fluid attributes such as density, velocity, etc., for individual grid cells or for all cells in the grid.

Return value

None

Keywords

fluid

Flags

attribute, lowerFace, xIndex, xvalue, yIndex, yvalue, zIndex, zvalue
Long name (short name) Argument types Properties
-attribute(-at) string create
Specifies the fluid attribute for which to display values. Valid attributes are "force", "velocity", "density", "falloff", "fuel", "color", and "temperature". (Note that getting force values is an alternate way of getting velocity values at one time step.)
-xvalue(-x)
Only get the first component of the vector-valued attribute specified by the "-at/attribute" flag.
-yvalue(-y)
Only get the second component of the vector-valued attribute specified by the "-at/attribute" flag.
-zvalue(-z)
Only get the third component of the vector-valued attribute specified by the "-at/attribute" flag.
-xIndex(-xi) int create
Only return values for cells with this X index
-yIndex(-yi) int create
Only return values for cells with this Y index
-zIndex(-zi) int create
Only return values for cells with this Z index
-lowerFace(-lf) create
Only valid with "-at velocity". Since velocity values are stored on the edges of each voxel and not at the center, using voxel based indices to set velocity necessarily affects neighboring voxels. Use this flag to only set velocity components on the lower left three faces of a voxel, rather than all six.

Flag can appear in Create mode of command Flag can appear in Edit mode of command
Flag can appear in Query mode of command Flag can be used more than once in a command.

MEL examples

// get density for entire fluid
getFluidAttr -at "density";
// get density at the cell x=1, y=2, z=3
getFluidAttr -at "density" -xi 1 -yi 2 -zi 3;
// get the velocity at the cell  x=1, y=2, z=3
getFluidAttr -at "velocity"  -xi 1 -yi 2 -zi 3;
// get the x-component of the velocity at cell x=1,
// y=2, z=3
getFluidAttr -xvalue -at "velocity" -xi 1 -yi 2 -zi 3;
// get the first component (red) of the rgb vector-valued
// attribute "color" at the cell x=1, y=2, z=3
getFluidAttr -xvalue -at "color" -xi 1 -yi 2 -zi 3;
// get the velocity x component the plane x=5
getFluidAttr -at "velocity" -x -xi 5;