pymel.core.effects.getFluidAttr

getFluidAttr(*args, **kwargs)

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

Flags:

Long Name / Short Name Argument Types Properties
attribute / at unicode ../../../_images/create.gif
  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 ../../../_images/create.gif
  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 ../../../_images/create.gif
  Only return values for cells with this X index
xvalue / x bool  
  Only get the first component of the vector-valued attribute specified by the -at/attributeflag.
yIndex / yi int ../../../_images/create.gif
  Only return values for cells with this Y index
yvalue / y bool  
  Only get the second component of the vector-valued attribute specified by the -at/attributeflag.
zIndex / zi int ../../../_images/create.gif
  Only return values for cells with this Z index
zvalue / z bool  
  Only get the third component of the vector-valued attribute specified by the -at/attributeflag. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.getFluidAttr

Example:

import pymel.core as pm

# 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 )