Returns values of built-in fluid attributes such as density, velocity, etc., for individual grid cells or for all cells in the grid.
Long name (short name) | Argument Types | Properties | |
---|---|---|---|
attribute (at) | unicode | ||
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) | bool | ||
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 commandFlag can have multiple arguments, passed either as a tuple or a list. |
|||
xIndex (xi) | int | ||
|
|||
xvalue (x) | bool | ||
|
|||
yIndex (yi) | int | ||
|
|||
yvalue (y) | bool | ||
|
|||
zIndex (zi) | int | ||
|
|||
zvalue (z) | bool | ||
|
Derived from mel command maya.cmds.getFluidAttr
Example:
import pymel.core as pm
import maya.cmds as cmds
# get density for entire fluid
pm.getFluidAttr( at='density' )
# get density at the cell x=1, y=2, z=3
pm.getFluidAttr( at='density', xi=1, yi=2, zi=3 )
# get the velocity at the cell x=1, y=2, z=3
pm.getFluidAttr( at='velocity', xi=1, yi=2, zi=3 )
# get the x-component of the velocity at cell x=1,
# y=2, z=3
pm.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
pm.getFluidAttr( xvalue=True, at='color', xi=1, yi=2, zi=3 )
# get the velocity x component the plane x=5
pm.getFluidAttr( at='velocity', x=True, xi=5 )