class MFnFluid

Jump to documentation

: public MFnDagNode Fluid node function set (OpenMayaFX) (OpenMayaFX.py)

Inheritance:

MFnFluid < MFnDagNode < MFnDependencyNode < MFnBase

public members:

MFnFluid ( const MObject & object, MStatus * ReturnStatus = NULL )
enum FluidMethod
kZero
all values in grid are zero
kStaticGrid
values in the grid are static
kDynamicGrid
values in the grid come from a dynamic solver
kGradient
ramps the value based on the gradient setting
enum FluidGradient
kConstant
value is set to one across the volume
kXGradient
ramp the value from zero to one along the X axis
kYGradient
ramp the value from zero to one along the Y axis
kZGradient
ramp the value from zero to one along the Z axis
kNegXGradient
ramp the value from one to zero along the X axis
kNegYGradient
ramp the value from one to zero along the Y axis
kNegZGradient
ramp the value from one to zero along the Z axis
kCenterGradient
ramps the value from one at the center to zero at the edges
enum FalloffMethod
kNoFalloffGrid
No falloff grid should be defined.
kStaticFalloffGrid
Values in the falloff grid are static.
enum ColorMethod
kUseShadingColor
off, use shading color instead
kStaticColorGrid
values in the grid are static
kDynamicColorGrid
values in the grid come from a dynamic solver
enum CoordinateMethod
kFixed
values are equal the object space coordinates
kGrid
coordinate values will be moved using the current density solver
MObject create3D ( unsigned int Xres, unsigned int Yres, unsigned int Zres, double Xdim, double Ydim, double Zdim, MObject parentOrOwner = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create2D ( unsigned int Xres, unsigned int Yres, double Xdim, double Ydim, MObject parentOrOwner = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MStatus getResolution ( unsigned int &Xres, unsigned int &Yres, unsigned int &Zres ) const
MStatus getResolution ( unsigned int &Xres, unsigned int &Yres ) const
MStatus getDimensions ( double &Xdim, double &Ydim, double &Zdim ) const
MStatus setSize ( unsigned int Xres, unsigned int Yres, unsigned int Zres, double Xdim, double Ydim, double Zdim, bool resample )
MStatus setSize ( unsigned int Xres, unsigned int Yres, double Xdim, double Ydim, bool resample )
unsigned int gridSize ( MStatus * ReturnStatus = NULL )
MStatus velocityGridSizes ( int & xsize, int & ysize, int & zsize )
float * falloff ( MStatus * ReturnStatus = NULL )
float * density ( MStatus * ReturnStatus = NULL )
MStatus getVelocity ( float *& Xvel, float *& Yvel, float *& Zvel )
float * pressure ( MStatus * ReturnStatus = NULL )
float * temperature ( MStatus * ReturnStatus = NULL )
float * fuel ( MStatus * ReturnStatus = NULL )
MStatus getCoordinates ( float *& u, float *& v, float *& w )
MStatus getColors ( float *& r, float *& g, float *& b )
MStatus setFalloffMode ( FalloffMethod mode )
MStatus getFalloffMode ( FalloffMethod &mode )
MStatus setDensityMode ( FluidMethod mode, FluidGradient gradient )
MStatus getDensityMode ( FluidMethod &mode, FluidGradient &gradient )
MStatus setVelocityMode ( FluidMethod mode, FluidGradient gradient )
MStatus getVelocityMode ( FluidMethod &mode, FluidGradient &gradient )
MStatus setTemperatureMode ( FluidMethod mode, FluidGradient gradient )
MStatus getTemperatureMode ( FluidMethod &mode, FluidGradient &gradient )
MStatus setFuelMode ( FluidMethod mode, FluidGradient gradient )
MStatus getFuelMode ( FluidMethod &mode, FluidGradient &gradient )
MStatus setCoordinateMode ( CoordinateMethod mode )
MStatus getCoordinateMode ( CoordinateMethod & mode )
MStatus setColorMode ( ColorMethod mode )
MStatus getColorMode ( ColorMethod & mode )
MStatus getForceAtPoint (const MPointArray & point, const MVectorArray & velocity, const MDoubleArray & mass, MVectorArray & force, double deltaTime = 1.0 / 24.0 )
MStatus getForceAtPoint (const MVectorArray & point, const MVectorArray & velocity, const MDoubleArray & mass, MVectorArray & force, double deltaTime = 1.0 / 24.0 )
bool toGridIndex ( const MPoint & objectSpacePoint, int3& gridCoords, MStatus *status = NULL )
MStatus voxelCenterPosition (int xi, int yi, int zi, MPoint & objectSpacePoint)
MStatus updateGrid ()
void emitIntoArrays ( float val, int x, int y, int z, float density , float heat, float fuel , bool doColor, const MColor & emitColor )
int index ( int xi, int yi )
int index ( int xi, int yi, int zi )
void index ( int ai, int & xi, int & yi, int & zi )
int index ( int xi, int yi, int zi, int xres, int yres, int zres )
void index ( int ai, int xres, int yres, int zres, int & xi, int & yi, int & zi )

Inherited from MFnDagNode:

public members:

kNextPos
MObject create ( const MTypeId &typeId, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId &typeId, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
unsigned int parentCount ( MStatus * ReturnStatus = NULL ) const
MObject parent ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MStatus addChild ( MObject & child , unsigned int index = kNextPos , bool keepExistingParents = false )
MStatus removeChild ( MObject & child )
MStatus removeChildAt ( unsigned int index )
unsigned int childCount ( MStatus * ReturnStatus = NULL ) const
MObject child ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MObject dagRoot ( MStatus * ReturnStatus = NULL )
bool hasParent ( const MObject & node, MStatus * ReturnStatus = NULL ) const
bool hasChild (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isChildOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isParentOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool inUnderWorld ( MStatus * ReturnStatus = NULL ) const
bool inModel ( MStatus * ReturnStatus = NULL ) const
bool isInstanceable ( MStatus * ReturnStatus=NULL ) const
MStatus setInstanceable ( const bool how )
bool isInstanced ( bool indirect = true, MStatus * ReturnStatus = NULL ) const
bool isInstancedAttribute ( const MObject & attr, MStatus * ReturnStatus = NULL ) const
unsigned int instanceCount ( bool total, MStatus * ReturnStatus = NULL ) const
MObject duplicate ( bool instance = false, bool instanceLeaf = false, MStatus * ReturnStatus = NULL ) const
MStatus getPath ( MDagPath & path )
MStatus getAllPaths ( MDagPathArray & paths )
MString fullPathName ( MStatus *ReturnStatus = NULL)
MString partialPathName ( MStatus *ReturnStatus = NULL)
MMatrix transformationMatrix ( MStatus * ReturnStatus = NULL ) const
bool isIntermediateObject ( MStatus * ReturnStatus = NULL ) const
MStatus setIntermediateObject ( bool isIntermediate )
int objectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setObjectColor ( int color )
bool usingObjectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setUseObjectColor ( bool useObjectColor )
MBoundingBox boundingBox ( MStatus * ReturnStatus = NULL ) const
MDagPath dagPath ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MDagPath & path )
virtual MStatus setObject ( MObject & object )
MObject model ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MObject & object )

Inherited from MFnDependencyNode:

public members:

virtual MFn::Type type () const
enum MAttrClass
kGlobalDynamicAttr
kLocalDynamicAttr
MObject create ( const MTypeId & typeId , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId & typeId , const MString & name , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , const MString & name , MStatus * ReturnStatus = NULL )
MTypeId typeId ( MStatus * ReturnStatus = NULL ) const
MString typeName ( MStatus * ReturnStatus = NULL ) const
MString name ( MStatus * ReturnStatus = NULL ) const
MString setName ( const MString & name , MStatus * ReturnStatus = NULL )
MStatus getConnections ( MPlugArray & array ) const
unsigned int attributeCount ( MStatus * ReturnStatus=NULL) const
MObject attribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject reorderedAttribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject attribute ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MAttrClass attributeClass ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MStatus getAffectedAttributes ( const MObject & attr, MObjectArray & affectedAttributes ) const
MStatus getAffectedByAttributes ( const MObject & attr, MObjectArray & affectedByAttributes ) const
MPlug findPlug ( const MObject & attr, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MStatus addAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MStatus removeAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MPxNode * userNode ( MStatus * ReturnStatus=NULL ) const
bool isFromReferencedFile ( MStatus * ReturnStatus=NULL) const
bool isShared ( MStatus * ReturnStatus=NULL) const
bool hasUniqueName ( MStatus * ReturnStatus=NULL) const
MString parentNamespace ( MStatus * ReturnStatus=NULL) const
bool isLocked ( MStatus * ReturnStatus=NULL) const
MStatus setLocked ( bool locked )
static MString classification ( const MString & nodeTypeName )
bool isNewAttribute ( const MObject & attr, MStatus * ReturnStatus=NULL) const
static unsigned int allocateFlag ( const MString pluginName, MStatus * ReturnStatus=NULL )
static MStatus deallocateFlag (const MString pluginName, unsigned int flag)
static MStatus deallocateAllFlags (const MString pluginName)
MStatus setFlag (unsigned int flag, bool state)
bool isFlagSet (unsigned int flag, MStatus * ReturnStatus=NULL) const
bool isDefaultNode ( MStatus * ReturnStatus=NULL) const
MStatus setDoNotWrite ( bool flag )
bool canBeWritten ( MStatus * ReturnStatus=NULL) const
bool hasAttribute (const MString & name , MStatus * ReturnStatus=NULL) const
MObject getAliasAttr (bool force, MStatus * ReturnStatus=NULL)
bool setAlias (const MString & alias,const MString & name , const MPlug & plug, bool add=true, MStatus * ReturnStatus=NULL)
bool findAlias (const MString & alias, MObject & attrObj, MStatus * ReturnStatus=NULL) const
bool getAliasList ( MStringArray & strArray, MStatus * ReturnStatus=NULL)
MString plugsAlias (const MPlug & plug, MStatus * ReturnStatus=NULL)
public
bool getPlugsAlias (const MPlug & plug, MString & aliasName, MStatus * ReturnStatus=NULL)

Inherited from MFnBase:

public members:

virtual MFn::Type type () const
bool hasObj ( MFn::Type ) const
bool hasObj ( const MObject & ) const
MObject object ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( MObject & object )
virtual MStatus setObject ( const MObject & object )

Documentation

Description

This is the function set for fluid objects.

A fluid object is a node in the dependency graph that contains a grid which is made up of cells. Each cell has a variety of values assigned to it such as density, velocity, temperature, and color. The grid may be 2D or 3D. See the methods below for full details.

Fluid objects may be used for simulation purposes. This function set allows read and write access to the values in the cells of the fluid object.

Functions

MFnFluid:: MFnFluid ()

Description

Default class constructor. The function set is not attached to an MObject.

MFnFluid:: MFnFluid ( MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given MObject.

Arguments

  • object the MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnFluid:: MFnFluid ( const MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given constant MObject.

Arguments

  • object the const MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnFluid:: MFnFluid ( const MDagPath & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given constant MDagPath object.

Arguments

  • object the const MDagPath to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFn::Type MFnFluid:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kFluid

MFnFluid:: ~MFnFluid ()

Description

Destructor.

MObject MFnFluid:: create3D ( unsigned int Xres, unsigned int Yres, unsigned int Zres, double Xdim, double Ydim, double Zdim, MObject parent, MStatus * ReturnStatus )

Description

Creates a fluid object from the specified data and sets this function set to operate on the new fluid object.

The parent argument is used to specify the DAG parent of the new fluid. If parent is NULL then a new transform will be created and returned which will be the parent for the new fluid shape. The new transform will be added to the DAG.

If parent is a DAG node then the new fluid will be returned and the parent passed in will become the new node's parent.

Arguments

  • Xres number of fluid grid cells in the x dimension
  • Yres number of fluid grid cells in the y dimension
  • Zres number of fluid grid cells in the z dimension
  • Xdim object space size in the x dimension
  • Ydim object space size in the y dimension
  • Zdim object space size in the z dimension
  • parent specifies what to do with the new fluid object. If a DAG object or NULL is given then a transform will be created for the new fluid shape and placed under the specified (optional)parent.
  • ReturnStatus Status code

Return Value

  • If parent is NULL then the transform for this fluid shape is returned
  • If parent is a DAG object then the new fluid shape is returned

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kValueOutOfRange A grid cell resolution or dimension parameter is invalid.
  • MS::kFailure An object error has occurred.

MObject MFnFluid:: create2D ( unsigned int Xres, unsigned int Yres, double Xdim, double Ydim, MObject parent, MStatus * ReturnStatus )

Description

Creates a fluid object from the specified data and sets this function set to operate on the new fluid object.

The parent argument is used to specify the DAG parent of the new fluid. If parent is NULL then a new transform will be created and returned which will be the parent for the new fluid shape. The new transform will be added to the DAG.

If parent is a DAG node then the new fluid will be returned and the parent passed in will become the new node's parent.

Arguments

  • Xres number of fluid grid cells in the x dimension
  • Yres number of fluid grid cells in the y dimension
  • Xdim object space size in the x dimension
  • Ydim object space size in the y dimension
  • parent specifies what to do with the new fluid object. If a DAG object or NULL is given then a transform will be created for the new fluid shape and placed under the specified (optional)parent.
  • ReturnStatus Status code

Return Value

  • If parent is NULL then the transform for this fluid shape is returned
  • If parent is a DAG object then the new fluid shape is returned

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kValueOutOfRange A grid cell resolution or dimension parameter is invalid.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: getResolution ( unsigned int &Xres, unsigned int &Yres, unsigned int &Zres ) const

Description

Gets the resolution of the fluid. The resolution gives the number of cells in the fluid grid in each direction.

Arguments

  • Xres storage for returning the number of fluid grid cells in the x dimension
  • Yres storage for returning the number of fluid grid cells in the y dimension
  • Zres storage for returning the number of fluid grid cells in the z dimension

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: getResolution ( unsigned int &Xres, unsigned int &Yres ) const

Description

Gets the resolution of the fluid. The resolution gives the number of cells in the fluid grid in each direction.

Arguments

  • Xres storage for returning the number of fluid grid cells in the x dimension
  • Yres storage for returning the number of fluid grid cells in the y dimension

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: getDimensions ( double &Xdim, double &Ydim, double &Zdim) const

Description

Gets the dimensions of the fluid. The dimensions give the object space size of the fluid object in each direction.

Arguments

  • Xdim storage for returning the dimension of the fluid in x
  • Ydim storage for returning the dimension of the fluid in y
  • Zdim storage for returning the dimension of the fluid in z

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: setSize ( unsigned int Xres, unsigned int Yres, unsigned int Zres, double Xdim, double Ydim, double Zdim, bool resample )

Description

Sets the size and resolution of the grid. The resolution parameters control the number of cells in the fluid grid and the dimension parameters set the size of the fluid shape in object space.

Arguments

  • Xres number of fluid grid cells in the x dimension
  • Yres number of fluid grid cells in the y dimension
  • Zres number of fluid grid cells in the z dimension
  • Xdim object space size in the x dimension
  • Ydim object space size in the y dimension
  • Zdim object space size in the z dimension
  • resample true if the previous contents of the grid should be scaled to fit the new size by resampling the previous data at the new resolution

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kValueOutOfRange A grid cell resolution or dimension parameter is invalid.
  • MS::kFailure An object error has occurred. This can occur if this is called on a 2D fluid

MStatus MFnFluid:: setSize ( unsigned int Xres, unsigned int Yres, double Xdim, double Ydim, bool resample )

Description

Sets the size and resolution of the grid. The resolution parameters control the number of cells in the fluid grid and the dimension parameters set the size of the fluid shape in object space.

Arguments

  • Xres number of fluid grid cells in the x dimension
  • Yres number of fluid grid cells in the y dimension
  • Zres number of fluid grid cells in the z dimension
  • Xdim object space size in the x dimension
  • Ydim object space size in the y dimension
  • Zdim object space size in the z dimension

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kValueOutOfRange A grid cell resolution or dimension parameter is invalid.
  • MS::kFailure An object error has occurred. This can occur if this is called on a 2D fluid

unsigned int MFnFluid:: gridSize ( MStatus * ReturnStatus )

Description

Returns the number of elements in the grid. This is equal to (x resolution * y resolution * z resolution). This routine is provided as a convenience to be used with the methods that give direct access to the fluid data. This gives the upper bound on the arrays. This size applies to all grids except for the 3 velocity grids.

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: velocityGridSizes ( int & xsize, int & ysize, int & zsize )

Description

Returns the number of elements in the velocity grids. X velocity size = (x resolution+1 * y resolution * z resolution). Y velocity size = (x resolution * y resolution+1 * z resolution). Z velocity size = (x resolution * y resolution * z resolution+1).

This routine is provided as a convenience to be used with the methods that give direct access to the velocity grids.

Arguments

  • xi storage for the x velocity grid size
  • yi storage for the y velocity grid size
  • zi storage for the z velocity grid size

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.

float * MFnFluid:: falloff ( MStatus * ReturnStatus )

Description

This method returns a pointer to the storage for the falloff data in the fluid. The size of this array can be obtained using the "gridSize" call.

The returned pointer points to an array of float values, each one representing the falloff value in a cell of the fluid grid. To get the array index corresponding to a cell index (x,y,z), use the "index" helper method.

If you modify the data via the pointer returned, you must call the "updateGrid" call or you will not see your changes.

Values from the falloff grid are used when the fluid's Falloff Shape attribute is set to "Grid". This mode allows users to specify arbitrary falloff values between 0 and 1 at each grid cell. At render time, the shaded opacity values of the fluid will be multiplied by the interpolated falloff grid value raised to the power of 1/(1-ed), where "ed" is the value of the fluid's "edgeDropoff" attribute. When edgeDropoff=0, the opacity multiplier is 1, and when edgeDropoff is 1, the opacity multiplier is 0. Assuming that falloff grid values are in the range [0,1], raising the edge dropoff value from 0 to 1 will cause the fluid opacity to smoothly fall off towards complete transparency.

Arguments

  • ReturnStatus Status code

Return Value

  • pointer to the float data of the grid

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred. This may occur if the fluid's falloff mode is set to kNone

float * MFnFluid:: density ( MStatus * ReturnStatus )

Description

This method returns a pointer to the storage for the density data in the fluid. The size of this array can be obtained using the "gridSize" call.

The pointer returned points to an array of float values, each one representing the density value in a cell of the fluid grid. To get the index of in the array for a cell at a given (x, y, z) use the "index" helper method.

If you modify the data via the pointer returned, you must call the "updateGrid" call or you will not see your changes.

Arguments

  • ReturnStatus Status code

Return Value

  • pointer to the density data of the grid

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred. This may occur if the fluid's density mode is set to kNone

MStatus MFnFluid:: getVelocity ( float *& Xvel, float *& Yvel, float *& Zvel )

Description

This method returns pointers to the storage for the velocity data in the fluid. The size of these arrays can be obtained using the "gridSize" call.

Each of the pointers returned points to an array of float values, each value representing the velocity in a cell of the fluid grid . The three arrays contain the x components, y components, and z components of the velocity respectively.

The grid sizes are different for each of the velocity grids. The Xvel grid is one larger in X, the Yvel in Y, the Zvel in Z. This is because the velocity components are stored at the voxel face centers, not at the voxel centers. The index methods that specify the resolutions explicitly should be used for the velocity grids.

If you modify the data via the pointers returned, you must call the "updateGrid" call or you will not see your changes.

Arguments

  • Xvel storage for returning a pointer to the x components of the velocity values in the grid
  • Yvel storage for returning a pointer to the y components of the velocity values in the grid
  • Zvel storage for returning a pointer to the z components of the velocity values in the grid

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred. This may occur if the fluid's velocity mode is set to kNone

float * MFnFluid:: pressure ( MStatus * ReturnStatus )

Description

This method returns a pointer to the storage for the pressure data in the fluid. The size of this array can be obtained using the "gridSize" call. Note that the pressure data only exists if the velocity method is kStaticGrid or kDynamicGrid

The pointer returned points to an array of float values, each one representing the pressure value in a cell of the fluid grid. To get the index of in the array for a cell at a given (x, y, z) use the "index" helper method.

If you modify the data via the pointer returned, you must call the "updateGrid" call or you will not see your changes. Note that the pressure data is an output of the velocity calculation. if you modify the pressure grid and the velocity grid is dynamic, your changes will be replaced after the next fluid evaluation.

Arguments

  • ReturnStatus Status code

Return Value

  • pointer to the pressure data of the grid

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred. This may occur if the fluid's velocity mode is set to kNone or kGradient

float * MFnFluid:: temperature ( MStatus * ReturnStatus )

Description

This method returns a pointer to the storage for the temperature data in the fluid. The size of this array can be obtained using the "gridSize" call.

The pointer returned points to an array of float values, each one representing the temperature value in a cell of the fluid grid. To get the index of in the array for a cell at a given (x, y, z) use the "index" helper method.

If you modify the data via the pointer returned, you must call the "updateGrid" call or you will not see your changes.

Arguments

  • ReturnStatus Status code

Return Value

  • pointer to the temperature data of the grid

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred. This may occur if the fluid's temperature mode is set to kNone

float * MFnFluid:: fuel ( MStatus * ReturnStatus )

Description

This method returns a pointer to the storage for the fuel data in the fluid. The size of this array can be obtained using the "gridSize" call.

The pointer returned points to an array of float values, each one representing the fuel value in a cell of the fluid grid. To get the index of in the array for a cell at a given (x, y, z) use the "index" helper method.

If you modify the data via the pointer returned, you must call the "updateGrid" call or you will not see your changes.

Arguments

  • ReturnStatus Status code

Return Value

  • pointer to the fuel data of the grid

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred. This may occur if the fluid's fuel method is set to kNone

MStatus MFnFluid:: getCoordinates ( float *& u, float *& v, float *& w )

Description

This method returns pointers to the storage for the uvw coordinate data in the fluid. The size of these arrays can be obtained using the "gridSize" call. The uvw values supply the 3D texture mapping coordinates for each cell.

Each of the pointers returned points to an array of float values, each value representing the u, v, or w value in a cell of the fluid grid. To get the index of in the array for a cell at a given (x, y, z) use the "index" helper method. The three arrays contain the u values, v values, and w values of the texture coordinates respectively.

For a 2D fluid, a NULL pointer will be returned for the w array.

If you modify the data via the pointers returned, you must call the "updateGrid" call or you will not see your changes.

Arguments

  • u storage for returning a pointer to the u values in the grid
  • v storage for returning a pointer to the v values in the grid
  • w storage for returning a pointer to the w values in the grid

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: getColors ( float *& r, float *& g, float *& b )

Description

This method returns pointers to the storage for the color data in the fluid. The size of these arrays can be obtained using the "gridSize" call.

Each of the pointers returned points to an array of float values, each value representing the color in a cell of the fluid grid. To get the index of in the array for a cell at a given (x, y, z) use the "index" helper method. The three arrays contain the r components, g components, and b components of the color respectively.

If you modify the data via the pointers returned, you must call the "updateGrid" call or you will not see your changes.

Arguments

  • r storage for returning a pointer to the red components of the color values in the grid
  • g storage for returning a pointer to the green components of the color values in the grid
  • b storage for returning a pointer to the blue components of the color values in the grid

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred. This may occur if the fluid's color mode is set to kNone

MStatus MFnFluid:: setDensityMode ( MFnFluid::FluidMethod method, MFnFluid::FluidGradient gradient )

Description

Set the modes by which the density values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

The method parameter may have the following values:

  • kZero sets the density to zero across the volume
  • kStaticGrid values in the grid are static
  • kDynamicGrid values in the grid come from a dynamic solver
  • kGradient ramps the value based on the gradient setting (see below)

If the method is set to be kGradient, then the gradient argument is also used. This deterines how a gradient is applied to the volume. The possible values are as follows:

  • kConstant value is set to one across the volume
  • kXGradient ramp the value from zero to one along the X axis
  • kYGradient ramp the value from zero to one along the Y axis
  • kZGradient ramp the value from zero to one along the Z axis
  • kNegXGradient ramp the value from one to zero along the X axis
  • kNegYGradient ramp the value from one to zero along the Y axis
  • kNegZGradient ramp the value from one to zero along the Z axis
  • kCenterGradient ramps the value from one at the center to zero at the edges

Arguments

  • method method for determining the fluid density in the grid
  • gradient gradient type, only used if the method is kGradient

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter An enum value that was passed in is invalid
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: getDensityMode ( MFnFluid::FluidMethod &method, MFnFluid::FluidGradient &gradient )

Description

Get the modes by which the density values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

The method parameter may return the following values:

  • kZero sets the density to zero across the volume
  • kStaticGrid values in the grid are static
  • kDynamicGrid values in the grid come from a dynamic solver
  • kGradient ramps the value based on the gradient setting (see below)

If the method returns kGradient, then the gradient type is also returned. This deterines how a gradient is applied to the volume. The possible return values are as follows:

  • kConstant value is set to one across the volume
  • kXGradient ramp the value from zero to one along the X axis
  • kYGradient ramp the value from zero to one along the Y axis
  • kZGradient ramp the value from zero to one along the Z axis
  • kNegXGradient ramp the value from one to zero along the X axis
  • kNegYGradient ramp the value from one to zero along the Y axis
  • kNegZGradient ramp the value from one to zero along the Z axis
  • kCenterGradient ramps the value from one at the center to zero at the edges

Arguments

  • method storage for returning the method by which the fluid density in the grid is determined
  • gradient storage for returning the gradient type, which is only relevant if the method is kGradient

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: setVelocityMode ( MFnFluid::FluidMethod method, MFnFluid::FluidGradient gradient )

Description

Set the modes by which the velocity values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

The method parameter may have the following values:

  • kZero sets the velocity to zero across the volume
  • kStaticGrid values in the grid are static
  • kDynamicGrid values in the grid come from a dynamic solver
  • kGradient ramps the value based on the gradient setting (see below)

If the method is set to be kGradient, then the gradient argument is also used. This deterines how a gradient is applied to the volume. The possible values are as follows:

  • kConstant value is set to one across the volume
  • kXGradient ramp the value from zero to one along the X axis
  • kYGradient ramp the value from zero to one along the Y axis
  • kZGradient ramp the value from zero to one along the Z axis
  • kNegXGradient ramp the value from one to zero along the X axis
  • kNegYGradient ramp the value from one to zero along the Y axis
  • kNegZGradient ramp the value from one to zero along the Z axis
  • kCenterGradient ramps the value from one at the center to zero at the edges

Arguments

  • method method for determining the fluid velocity in the grid
  • gradient gradient type, only used if the method is kGradient

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter An enum value that was passed in is invalid
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: getVelocityMode ( MFnFluid::FluidMethod &method, MFnFluid::FluidGradient &gradient )

Description

Get the modes by which the velocity values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

The method parameter may return the following values:

  • kZero sets the velocity to zero across the volume
  • kStaticGrid values in the grid are static
  • kDynamicGrid values in the grid come from a dynamic solver
  • kGradient ramps the value based on the gradient setting (see below)

If the method returns kGradient, then the gradient type is also returned. This deterines how a gradient is applied to the volume. The possible return values are as follows:

  • kConstant value is set to one across the volume
  • kXGradient ramp the value from zero to one along the X axis
  • kYGradient ramp the value from zero to one along the Y axis
  • kZGradient ramp the value from zero to one along the Z axis
  • kNegXGradient ramp the value from one to zero along the X axis
  • kNegYGradient ramp the value from one to zero along the Y axis
  • kNegZGradient ramp the value from one to zero along the Z axis
  • kCenterGradient ramps the value from one at the center to zero at the edges

Arguments

  • method storage for returning the method by which the fluid velocity in the grid is determined
  • gradient storage for returning the gradient type, which is only relevant if the method is kGradient

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: setTemperatureMode ( MFnFluid::FluidMethod method, MFnFluid::FluidGradient gradient )

Description

Set the modes by which the temperature values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

The method parameter may have the following values:

  • kZero sets the temperature to zero across the volume
  • kStaticGrid values in the grid are static
  • kDynamicGrid values in the grid come from a dynamic solver
  • kGradient ramps the value based on the gradient setting (see below)

If the method is set to be kGradient, then the gradient argument is also used. This deterines how a gradient is applied to the volume. The possible values are as follows:

  • kConstant value is set to one across the volume
  • kXGradient ramp the value from zero to one along the X axis
  • kYGradient ramp the value from zero to one along the Y axis
  • kZGradient ramp the value from zero to one along the Z axis
  • kNegXGradient ramp the value from one to zero along the X axis
  • kNegYGradient ramp the value from one to zero along the Y axis
  • kNegZGradient ramp the value from one to zero along the Z axis
  • kCenterGradient ramps the value from one at the center to zero at the edges

Arguments

  • method method for determining the fluid temperature in the grid
  • gradient gradient type, only used if the method is kGradient

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter An enum value that was passed in is invalid
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: getTemperatureMode ( MFnFluid::FluidMethod &method, MFnFluid::FluidGradient &gradient )

Description

Get the modes by which the temperature values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

The method parameter may return the following values:

  • kZero sets the temperature to zero across the volume
  • kStaticGrid values in the grid are static
  • kDynamicGrid values in the grid come from a dynamic solver
  • kGradient ramps the value based on the gradient setting (see below)

If the method returns kGradient, then the gradient type is also returned. This deterines how a gradient is applied to the volume. The possible return values are as follows:

  • kConstant value is set to one across the volume
  • kXGradient ramp the value from zero to one along the X axis
  • kYGradient ramp the value from zero to one along the Y axis
  • kZGradient ramp the value from zero to one along the Z axis
  • kNegXGradient ramp the value from one to zero along the X axis
  • kNegYGradient ramp the value from one to zero along the Y axis
  • kNegZGradient ramp the value from one to zero along the Z axis
  • kCenterGradient ramps the value from one at the center to zero at the edges

Arguments

  • method storage for returning the method by which the fluid temperature in the grid is determined
  • gradient storage for returning the gradient type, which is only relevant if the method is kGradient

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: setFuelMode ( MFnFluid::FluidMethod method, MFnFluid::FluidGradient gradient )

Description

Set the modes by which the fuel values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation. The fuel value for a cell can be thought of as the amount of fuel contained in the cell that will be consumed during the simulation.

The method parameter may have the following values:

  • kZero sets the fuel to zero across the volume
  • kDynamicGrid values in the grid come from a dynamic solver
  • kGradient ramps the value based on the gradient setting (see below)

Note that kStatic is not an option for the fuel mode. A static grid of fuel values would not make sense as the solver needs to use up the fuel during the simulation.

If the method is set to be kGradient, then the gradient argument is also used. This deterines how a gradient is applied to the volume. The possible values are as follows:

  • kConstant value is set to one across the volume
  • kXGradient ramp the value from zero to one along the X axis
  • kYGradient ramp the value from zero to one along the Y axis
  • kZGradient ramp the value from zero to one along the Z axis
  • kNegXGradient ramp the value from one to zero along the X axis
  • kNegYGradient ramp the value from one to zero along the Y axis
  • kNegZGradient ramp the value from one to zero along the Z axis
  • kCenterGradient ramps the value from one at the center to zero at the edges

Arguments

  • method method for determining the fluid fuel in the grid
  • gradient gradient type, only used if the method is kGradient

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter An enum value that was passed in is invalid
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: getFuelMode ( MFnFluid::FluidMethod &method, MFnFluid::FluidGradient &gradient )

Description

Get the modes by which the fuel values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

The method parameter may return the following values:

  • kZero sets the fuel values to zero across the volume
  • kStaticGrid values in the grid are static
  • kDynamicGrid values in the grid come from a dynamic solver
  • kGradient ramps the value based on the gradient setting (see below)

If the method returns kGradient, then the gradient type is also returned. This deterines how a gradient is applied to the volume. The possible return values are as follows:

  • kConstant value is set to one across the volume
  • kXGradient ramp the value from zero to one along the X axis
  • kYGradient ramp the value from zero to one along the Y axis
  • kZGradient ramp the value from zero to one along the Z axis
  • kNegXGradient ramp the value from one to zero along the X axis
  • kNegYGradient ramp the value from one to zero along the Y axis
  • kNegZGradient ramp the value from one to zero along the Z axis
  • kCenterGradient ramps the value from one at the center to zero at the edges

Arguments

  • method storage for returning the method by which the fluid fuel values in the grid is determined
  • gradient storage for returning the gradient type, which is only relevant if the method is kGradient

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: setCoordinateMode ( MFnFluid::CoordinateMethod method )

Description

Set the modes by which the UVW coordinate values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

The method parameter may have the following values:

  • kFixed values are equal the object space coordinates
  • kGrid coordinate values will be moved using the current density solver

Arguments

  • method method for determining the fluid UVW coordinates in the grid

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter An enum value that was passed in is invalid
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: getCoordinateMode ( MFnFluid::CoordinateMethod & method )

Description

Get the modes by which the UVW coordinates values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

The method parameter may return the following values:

  • kFixed values are equal the object space coordinates
  • kGrid coordinate values will be moved using the current density solver

Arguments

  • method storage for returning the method by which the fluid coordinate values in the grid is determined

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: setColorMode ( MFnFluid::ColorMethod method )

Description

Set the modes by which the color values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

The method parameter may have the following values:

  • kZero the shaders color is used
  • kStaticGrid values in the grid are static
  • kDynamicGrid values in the grid come from a dynamic solver

Arguments

  • method method for determining the fluid color in the grid

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter An enum value that was passed in is invalid
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: getColorMode ( MFnFluid::ColorMethod & method )

Description

Get the modes by which the color values in the grid are determined. The values may be set by the user in various ways, or they may be computed as part of a simulation.

The method parameter may return the following values:

  • kZero the shaders color is used
  • kStaticGrid values in the grid are static
  • kDynamicGrid values in the grid come from a dynamic solver

Arguments

  • method storage for returning the method by which the fluid color in the grid is determined

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: setFalloffMode ( MFnFluid::FalloffMethod method )

Description

Set the modes by which the shader falloff values in the grid are determined. If the falloff grid is enabled, its values must be set by the user.

The method parameter may have the following values:

  • kNoFalloffGrid A constant value of 0.0 is used.
  • kStaticFalloffGrid Values in the grid are static

Arguments

  • method method for determining the falloff value in the grid

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kInvalidParameter An enum value that was passed in is invalid
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: getFalloffMode ( MFnFluid::FalloffMethod & method )

Description

Get the modes by which the falloff values in the grid are determined. If the falloff grid is enabled, its values must be set by the user.

The method parameter may return the following values:

  • kNoFalloffGrid the shaders color is used
  • kStaticFalloffGrid Values in the grid are static

Arguments

  • method storage for returning the method by which the falloff value in the grid is determined

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: getForceAtPoint (const MPointArray & point, const MVectorArray & velocity, const MDoubleArray & mass, MVectorArray & force, double deltaTime)

Description

Compute the force of the fluid as a field on an array of points, given their position, velocity, and mass.

This method uses MPointArray to represent the positions of points. If a point instance is in a rational form or a homogenous form, you should reset it to be in the cartesian form P(x, y, z, 1).

Arguments

  • point array of positions for each point.
  • velocity array of velocities for each point.
  • If the length of the velocity array is 0, a velocity of 0.0 is assumed for all the points.
  • mass array of mass values for each point.
  • If the length of the mass array is 0, a mass of 1.0 is assumed for all the points.
  • force output array of forces applied to each point.
  • If the length of the force array supplied is 0, the array is automatically resized. If the contents of the force array contains data, the computed force is added to the supplied data. This can be useful to accumulate forces of multiple fields.
  • deltaTime time increment in seconds
  • Default is (1.0 / 24.0 fps).

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: getForceAtPoint (const MVectorArray & point, const MVectorArray & velocity, const MDoubleArray & mass, MVectorArray & force, double deltaTime)

Description

Compute the force of a field on an array of points, given their position, velocity, and mass. Note that only the Air and Vortex fields require a time increment to compute forces, all other fields will igonore this argument.

This method uses MVectorArray to represent the positions of a point.

Arguments

  • point array of positions for each point.
  • velocity array of velocities for each point.
  • If the length of the velocity array is 0, a velocity of 0.0 is assumed for all the points. Note the velocity array is a requirement for the Air and Drag fields to compute forces.
  • mass array of mass values for each point.
  • If the length of the mass array is 0, a mass of 1.0 is assumed for all the points.
  • force output array of forces applied to each point.
  • If the length of the force array supplied is 0, the array is automatically resized. If the contents of the force array contains data, the computed force is added to the supplied data. This can be useful to accumulate forces of multiple fields.
  • deltaTime time increment in seconds for usage with the Air and Vortex fields.
  • Default is (1.0 / 24.0 fps).

Return Value

  • Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

bool MFnFluid:: toGridIndex ( const MPoint & objectSpacePoint, int3& gridCoords, MStatus *status )

Description

For the given point in object space, get the grid indices of the voxel that it happens to lie in. If the point is outside the fluid, the method returns false, and the indices should not be used.

Arguments

  • objectSpacePoint an object space location
  • gridCoords the voxel indices, if the point falls inside a voxel

Return Value

  • True if the point is inside the fluid, false otherwise

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

MStatus MFnFluid:: voxelCenterPosition (int xi, int yi, int zi, MPoint & objectSpacePoint)

Description

For the given voxel, get the location of the center in object space. If the voxel indices are not valid, the point may not be set to a valid point

Arguments

  • xi the voxel x index
  • yi the voxel y index
  • zi the voxel z index
  • objectSpacePoint the object space location

Return Value

  • Status

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure The voxel index was out of range, or an object error has occurred.

MStatus MFnFluid:: updateGrid ()

Description

Tells the fluid shape that the contents of the fluid grid has changed. It is necessary to call this routine after modifying internal fluid data via a pointer recieved from any of the access routines in this function set. Failure to call this will result in the fluid not drawing with your changes.

Return Value

  • ReturnStatus Status code

Status Codes

  • MS::kSuccess The method was successful.
  • MS::kFailure An object error has occurred.

void MFnFluid:: emitIntoArrays ( float val, int x, int y, int z, float density , float heat, float fuel , bool doColor, const MColor & emitColor )

Description

Use this method to add density, heat, fuel, and/or color to a particular voxel of a fluid.

Arguments

  • val multiplier applied to the specified density, heat, and fuel values.
  • x voxel index in x
  • y voxel index in y
  • z voxel index in z
  • density amount of density to add to the voxel
  • heat amount of heat to add to the voxel
  • fuel amount of fuel to add to the voxel
  • doColor if true, then color specified by "emitColor" will be blended into the voxel's current color, with the blend coefficients being determined by the amount of density that is being added to the voxel.
  • emitColor color to be blended into the voxel.

int MFnFluid:: index ( int xi, int yi )

Description

This is a utility routine for finding the index of a cell in an array of fluid data. The data in the fluid shape, such as color and density are passed back as single dimensional arrays of numeric values. This method converts three dimensional coordinates of a cell into the index value that refers the cell's value in the single dimensional array.

Note that no bounds checking is performed.

Arguments

  • xi index in x
  • yi index in y

Return Value

  • index in the single dimensional array

int MFnFluid:: index ( int xi, int yi, int zi )

Description

This is a utility routine for finding the index of a cell in an array of fluid data. The data in the fluid shape, such as color and density are passed back as single dimensional arrays of numeric values. This method converts three dimensional coordinates of a cell into the index value that refers the cell's value in the single dimensional array.

Note that no bounds checking is performed.

Arguments

  • xi index in x
  • yi index in y
  • zi index in z

Return Value

  • index in the single dimensional array

void MFnFluid:: index ( int index , int & xi, int & yi, int & zi )

Description

This is a utility routine for finding the coordinates of a cell in an array of fluid data given the index. The data in the fluid shape, such as color and density are passed back as single dimensional arrays of numeric values. This method converts the index value that refers to a cell's value in the single dimensional array into the three dimensional coordinates of the cell.

Note that no bounds checking is performed.

Arguments

  • index index to convert into coordinates
  • xi storage for the index in x
  • yi storage for the index in y
  • zi storage for the index in z

int MFnFluid:: index ( int xi, int yi, int zi, int xres, int yres, int )

Description

This is a utility routine for finding the index of a cell given the X, Y and Z resolutions. This is intended for use primarily with the velocity arrays, where the resolutions are different for each array. The X velocity array is one bigger in X, etc.

This method converts three dimensional coordinates of a cell into the index value that refers the cell's value in the single dimensional array.

Note that no bounds checking is performed.

Arguments

  • xi index in x
  • yi index in y
  • zi index in z
  • xres resolution in x
  • yres resolution in y
  • zres resolution in z

Return Value

  • index in the single dimensional array

void MFnFluid:: index ( int index , int xres, int yres, int , int & xi, int & yi, int & zi )

Description

This is a utility routine for finding the coordinates of a cell given the index, and the X, Y and Z resolutions. This is intended for use primarily with the velocity arrays, where the resolutions are different for each array. The X velocity array is one bigger in X, etc.

This method converts the index value that refers to a cell's value in the single dimensional array into the three dimensional coordinates of the cell.

Note that no bounds checking is performed.

Arguments

  • index index to convert into coordinates
  • xres resolution in x
  • yres resolution in y
  • zres resolution in z
  • xi storage for the index in x
  • yi storage for the index in y
  • zi storage for the index in z

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright