# Fluid Velocity Info

**URL:** https://forum.highend3d.com/t/fluid-velocity-info/1458
**Category:** Maya
**Tags:** mel
**Created:** [June 15, 2008, 10:02pm UTC](https://forum.highend3d.com/t/fluid-velocity-info/1458 "2008-06-15T22:02:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![nier](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/n/4da419/32.png) [@nier](https://forum.highend3d.com/u/nier)
#### Post date: [June 15, 2008, 10:02pm UTC](https://forum.highend3d.com/t/fluid-velocity-info/1458/1 "2008-06-15T22:02:42Z")

</div>

hello!!

Is there a way to get the velocity info on each voxel of a fluid container?

Like when I run fluids with velocity draw, I can see the arrows and all, but can I actually access the value of those arrows with mel? or maybe the density values....

Or should my approach be by integrating particles with my fluids and then getting the particle attributes (which I already know is possible, but I didn't want to have to reccur to particles for that....)

Thank you!!  
lg,  
Daniel

---

<div class="post-metadata">

### Author: ![nier](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/n/4da419/32.png) [@nier](https://forum.highend3d.com/u/nier)
#### Post date: [June 15, 2008, 10:04pm UTC](https://forum.highend3d.com/t/fluid-velocity-info/1458/2 "2008-06-15T22:04:22Z")

</div>

Sorry guys, just found what I was looking for...

CODE  
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&nbsp;&nbsp;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 )

thanks!!
