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

Synopsis

getFluidAttr([attribute=string], [lowerFace=boolean], [xIndex=int], [xvalue=boolean], [yIndex=int], [yvalue=boolean], [zIndex=int], [zvalue=boolean])

Note: Strings representing object names and arguments must be separated by commas. This is not depicted in the synopsis.

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.)
lowerFace(lf) boolean 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.
xIndex(xi) int create
Only return values for cells with this X index
xvalue(x) boolean
Only get the first component of the vector-valued attribute specified by the "-at/attribute" flag.
yIndex(yi) int create
Only return values for cells with this Y index
yvalue(y) boolean
Only get the second component of the vector-valued attribute specified by the "-at/attribute" flag.
zIndex(zi) int create
Only return values for cells with this Z index
zvalue(z) boolean
Only get the third component of the vector-valued attribute specified by the "-at/attribute" flag.

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 have multiple arguments, passed either as a tuple or a list.

Python examples

import maya.cmds as cmds

# get density for entire fluid
cmds.getFluidAttr( at='density' )

# get density at the cell x=1, y=2, z=3
cmds.getFluidAttr( at='density', xi=1, yi=2, zi=3 )

# get the velocity at the cell  x=1, y=2, z=3
cmds.getFluidAttr( at='velocity', xi=1, yi=2, zi=3 )

# get the x-component of the velocity at cell x=1,
# y=2, z=3
cmds.getFluidAttr( xvalue=True, 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
cmds.getFluidAttr( xvalue=True, at='color', xi=1, yi=2, zi=3 )

# get the velocity x component the plane x=5
cmds.getFluidAttr( at='velocity', x=True, xi=5 )