C++ API Reference
|
Fluid node function set. More...
#include <MFnFluid.h>
Public Member Functions | |
virtual MFn::Type | type () const |
Function set type. More... | |
virtual | ~MFnFluid () |
Destructor. | |
MFnFluid () | |
Default constructor. | |
MFnFluid (MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. More... | |
MFnFluid (const MDagPath &object, MStatus *ret=NULL) | |
Constructor. More... | |
MObject | create3D (unsigned int Xres, unsigned int Yres, unsigned int Zres, double Xdim, double Ydim, double Zdim, MObject parentOrOwner=MObject::kNullObj, MStatus *ReturnStatus=NULL) |
Creates a fluid object from the specified data and sets this function set to operate on the new fluid object. More... | |
MObject | create2D (unsigned int Xres, unsigned int Yres, double Xdim, double Ydim, MObject parentOrOwner=MObject::kNullObj, MStatus *ReturnStatus=NULL) |
Creates a fluid object from the specified data and sets this function set to operate on the new fluid object. More... | |
MStatus | getResolution (unsigned int &Xres, unsigned int &Yres, unsigned int &Zres) const |
Gets the resolution of the fluid. More... | |
MStatus | getResolution (unsigned int &Xres, unsigned int &Yres) const |
Gets the resolution of the fluid. More... | |
MStatus | getDimensions (double &Xdim, double &Ydim, double &Zdim) const |
Gets the dimensions of the fluid. More... | |
MStatus | setSize (unsigned int Xres, unsigned int Yres, unsigned int Zres, double Xdim, double Ydim, double Zdim, bool resample) |
Sets the size and resolution of the grid. More... | |
MStatus | setSize (unsigned int Xres, unsigned int Yres, double Xdim, double Ydim, bool resample) |
Sets the size and resolution of the grid. More... | |
unsigned int | gridSize (MStatus *ReturnStatus=NULL) |
Returns the number of elements in the grid. More... | |
MStatus | velocityGridSizes (int &xsize, int &ysize, int &zsize) |
Returns the number of elements in the velocity grids. More... | |
float * | falloff (MStatus *ReturnStatus=NULL) |
This method returns a pointer to the storage for the falloff data in the fluid. More... | |
float * | density (MStatus *ReturnStatus=NULL) |
This method returns a pointer to the storage for the density data in the fluid. More... | |
MStatus | getVelocity (float *&Xvel, float *&Yvel, float *&Zvel) |
This method returns pointers to the storage for the velocity data in the fluid. More... | |
float * | pressure (MStatus *ReturnStatus=NULL) |
This method returns a pointer to the storage for the pressure data in the fluid. More... | |
float * | temperature (MStatus *ReturnStatus=NULL) |
This method returns a pointer to the storage for the temperature data in the fluid. More... | |
float * | fuel (MStatus *ReturnStatus=NULL) |
This method returns a pointer to the storage for the fuel data in the fluid. More... | |
MStatus | getCoordinates (float *&u, float *&v, float *&w) |
This method returns pointers to the storage for the uvw coordinate data in the fluid. More... | |
MStatus | getColors (float *&r, float *&g, float *&b) |
This method returns pointers to the storage for the color data in the fluid. More... | |
MStatus | setFalloffMode (FalloffMethod mode) |
Set the modes by which the shader falloff values in the grid are determined. More... | |
MStatus | getFalloffMode (FalloffMethod &mode) |
Get the modes by which the falloff values in the grid are determined. More... | |
MStatus | setDensityMode (FluidMethod mode, FluidGradient gradient) |
Set the modes by which the density values in the grid are determined. More... | |
MStatus | getDensityMode (FluidMethod &mode, FluidGradient &gradient) |
Get the modes by which the density values in the grid are determined. More... | |
MStatus | setVelocityMode (FluidMethod mode, FluidGradient gradient) |
Set the modes by which the velocity values in the grid are determined. More... | |
MStatus | getVelocityMode (FluidMethod &mode, FluidGradient &gradient) |
Get the modes by which the velocity values in the grid are determined. More... | |
MStatus | setTemperatureMode (FluidMethod mode, FluidGradient gradient) |
Set the modes by which the temperature values in the grid are determined. More... | |
MStatus | getTemperatureMode (FluidMethod &mode, FluidGradient &gradient) |
Get the modes by which the temperature values in the grid are determined. More... | |
MStatus | setFuelMode (FluidMethod mode, FluidGradient gradient) |
Set the modes by which the fuel values in the grid are determined. More... | |
MStatus | getFuelMode (FluidMethod &mode, FluidGradient &gradient) |
Get the modes by which the fuel values in the grid are determined. More... | |
MStatus | setCoordinateMode (CoordinateMethod mode) |
Set the modes by which the UVW coordinate values in the grid are determined. More... | |
MStatus | getCoordinateMode (CoordinateMethod &mode) |
Get the modes by which the UVW coordinates values in the grid are determined. More... | |
MStatus | setColorMode (ColorMethod mode) |
Set the modes by which the color values in the grid are determined. More... | |
MStatus | getColorMode (ColorMethod &mode) |
Get the modes by which the color values in the grid are determined. More... | |
MStatus | getForceAtPoint (const MPointArray &point, const MVectorArray &velocity, const MDoubleArray &mass, MVectorArray &force, double deltaTime=1.0/24.0) |
Compute the force of the fluid as a field on an array of points, given their position, velocity, and mass. More... | |
MStatus | getForceAtPoint (const MVectorArray &point, const MVectorArray &velocity, const MDoubleArray &mass, MVectorArray &force, double deltaTime=1.0/24.0) |
Compute the force of a field on an array of points, given their position, velocity, and mass. More... | |
bool | toGridIndex (const MPoint &objectSpacePoint, int3 &gridCoords, MStatus *status=NULL) |
For the given point in object space, get the grid indices of the voxel that it happens to lie in. More... | |
MStatus | voxelCenterPosition (int xi, int yi, int zi, MPoint &objectSpacePoint) |
For the given voxel, get the location of the center in object space. More... | |
MStatus | updateGrid () |
Tells the fluid shape that the contents of the fluid grid has changed. More... | |
void | emitIntoArrays (float val, int x, int y, int z, float density, float heat, float fuel, bool doColor, const MColor &emitColor) |
Use this method to add density, heat, fuel, and/or color to a particular voxel of a fluid. More... | |
int | index (int xi, int yi) |
This is a utility routine for finding the index of a cell in an array of fluid data. More... | |
int | index (int xi, int yi, int zi) |
This is a utility routine for finding the index of a cell in an array of fluid data. More... | |
void | index (int ai, int &xi, int &yi, int &zi) |
This is a utility routine for finding the coordinates of a cell in an array of fluid data given the index. More... | |
int | index (int xi, int yi, int zi, int xres, int yres, int zres) |
This is a utility routine for finding the index of a cell given the X, Y and Z resolutions. More... | |
void | index (int ai, int xres, int yres, int zres, int &xi, int &yi, int &zi) |
This is a utility routine for finding the coordinates of a cell given the index, and the X, Y and Z resolutions. More... | |
bool | isAutoResize () |
Is this an autoresize fluid? More... | |
bool | isResizeToEmitter () |
If this is an autoresize fluid, should it also resize to the emitter. More... | |
MStatus | expandToInclude (const MPoint &min, const MPoint &max) |
Tells the fluid shape to autoresize to include these two points This would normally be used in a fluid emitter node if the fluid had resizeToEmitter turned on. More... | |
MFnFluid (const MObject &object, MStatus *ret=NULL) | |
Constructor. More... | |
Public Member Functions inherited from MFnDagNode | |
virtual | ~MFnDagNode () |
Destructor. More... | |
MFnDagNode () | |
Class Constructor. More... | |
MFnDagNode (MObject &object, MStatus *ret=NULL) | |
Not available in Python. More... | |
MFnDagNode (const MDagPath &object, MStatus *ret=NULL) | |
Class Constructor. More... | |
MObject | create (const MTypeId &typeId, MObject &parent=MObject::kNullObj, MStatus *ReturnStatus=NULL) |
Creates a new DAG node with the given type tag. More... | |
MObject | create (const MTypeId &typeId, const MString &name, MObject &parent=MObject::kNullObj, MStatus *ReturnStatus=NULL) |
Creates a new DAG node with the given type tag. More... | |
MObject | create (const MString &type, MObject &parent=MObject::kNullObj, MStatus *ReturnStatus=NULL) |
Creates a new DAG node with the given type tag. More... | |
MObject | create (const MString &type, const MString &name, MObject &parent=MObject::kNullObj, MStatus *ReturnStatus=NULL) |
Creates a new DAG node with the given type tag. More... | |
unsigned int | parentCount (MStatus *ReturnStatus=NULL) const |
Determines the number of parent Nodes of the Node. More... | |
MObject | parent (unsigned int i, MStatus *ReturnStatus=NULL) const |
Queries the DAG Node attached to the Function Set for the parent Node corresponding to the given index. More... | |
MStatus | addChild (MObject &child, unsigned int index=kNextPos, bool keepExistingParents=false) |
Makes the given DAG Node a child of the DAG Node to which this instance of the Function Set is attached. More... | |
MStatus | removeChild (MObject &child) |
Removes the given DAG Node from the parent. More... | |
MStatus | removeChildAt (unsigned int index) |
Removes the child at the given index from the parent. More... | |
unsigned int | childCount (MStatus *ReturnStatus=NULL) const |
Determines the number of child Nodes of the Node. More... | |
MObject | child (unsigned int i, MStatus *ReturnStatus=NULL) const |
Queries the DAG Node attached to the Function Set for the child Node corresponding to the given index. More... | |
MObject | dagRoot (MStatus *ReturnStatus=NULL) |
Determines the root of the first DAG Path to the DAG Node attached to the Function Set. More... | |
bool | hasParent (const MObject &node, MStatus *ReturnStatus=NULL) const |
Determines whether or not the given Node is a parent of the DAG Node attached to the Function Set. More... | |
bool | hasChild (const MObject &node, MStatus *ReturnStatus=NULL) const |
Determines whether or not the given Node is a child of the DAG Node attached to the Function Set. More... | |
bool | isChildOf (const MObject &node, MStatus *ReturnStatus=NULL) const |
Determines whether or not the DAG Node attached to the Function Set is a child of the given node. More... | |
bool | isParentOf (const MObject &node, MStatus *ReturnStatus=NULL) const |
Determines whether or not the DAG Node attached to the Function Set is a parent of the given node. More... | |
bool | inUnderWorld (MStatus *ReturnStatus=NULL) const |
Determines whether or not the DAG Node is an underworld node. More... | |
bool | inModel (MStatus *ReturnStatus=NULL) const |
Determines whether or not the DAG Node is in the model. More... | |
bool | isInstanceable (MStatus *ReturnStatus=NULL) const |
Returns true if the DAG node can be instanced, and false otherwise. More... | |
MStatus | setInstanceable (const bool how) |
Sets whether or not the DAG node is instanceable. More... | |
bool | isInstanced (bool indirect=true, MStatus *ReturnStatus=NULL) const |
Determines whether the DAG Node attached to the Function Set is directly or indirectly instanced. More... | |
bool | isInstancedAttribute (const MObject &attr, MStatus *ReturnStatus=NULL) const |
Returns true if the specified attribute is instanced. More... | |
unsigned int | instanceCount (bool total, MStatus *ReturnStatus=NULL) const |
Determines the number of times the Node attached to the Function Set is instanced. More... | |
MObject | duplicate (bool instance=false, bool instanceLeaf=false, MStatus *ReturnStatus=NULL) const |
This method duplicates the DAG hierarchy rooted at the current node. More... | |
MStatus | getPath (MDagPath &path) const |
Returns a DAG Path to the DAG Node attached to the Function Set. More... | |
MStatus | getAllPaths (MDagPathArray &paths) const |
Determines all DAG Paths to the DAG Node attached to the Function Set. More... | |
MString | fullPathName (MStatus *ReturnStatus=NULL) const |
Return a string representing the full path from the root of the dag to this object. More... | |
MString | partialPathName (MStatus *ReturnStatus=NULL) const |
Return a string representing the partial path from the root of the dag to this object. More... | |
MMatrix | transformationMatrix (MStatus *ReturnStatus=NULL) const |
Returns the object space transformation matrix for this DAG node. More... | |
bool | isIntermediateObject (MStatus *ReturnStatus=NULL) const |
Returns true if this object is an intermediate in a geometry calculation. More... | |
MStatus | setIntermediateObject (bool isIntermediate) |
Sets whether this object is an intermediate in a geometry calculation. More... | |
int | objectColor (MStatus *ReturnStatus=NULL) const |
Deprecated in 2016.0 More... | |
MStatus | setObjectColor (int color) |
Sets the index for the current user defined inactive color used by the node. More... | |
bool | usingObjectColor (MStatus *ReturnStatus=NULL) const |
Deprecated in 2016.0 More... | |
MStatus | setUseObjectColor (bool useObjectColor) |
Deprecated in 2016.0 More... | |
MObjectColorType | objectColorType (MStatus *ReturnStatus=NULL) const |
Determines whether or not the user defined inactive color will be used for the node, or whether the default inactive color will be used. More... | |
MStatus | setObjectColorType (MObjectColorType type) |
Sets whether or not the user defined inactive object color will be used. More... | |
MStatus | setObjectColor (const MColor &color) |
Sets the color value for the current user defined inactive color used by the node. More... | |
MColor | objectColorRGB (MStatus *ReturnStatus=NULL) const |
Determines the RGB color for the current user defined inactive color used by the node. More... | |
int | objectColorIndex (MStatus *ReturnStatus=NULL) const |
Determines the index for the current user defined inactive color used by the node. More... | |
MColor | hiliteColor (MStatus *ReturnStatus=NULL) const |
Determines the current hilite color used by the node. More... | |
bool | usingHiliteColor (MStatus *ReturnStatus=NULL) const |
Determines whether or not the hilite color will be used for the node. More... | |
MColor | dormantColor (MStatus *ReturnStatus=NULL) const |
Determines the dormant color used by this node. More... | |
MColor | activeColor (MStatus *ReturnStatus=NULL) const |
Determines the active color used by this node. More... | |
bool | drawOverrideEnabled (MStatus *ReturnStatus=NULL) const |
Determines whether or not draw override is turned on for this node. More... | |
bool | drawOverrideIsReference (MStatus *ReturnStatus=NULL) const |
Determines whether or not Display Type of the draw override is Reference for this node. More... | |
bool | drawOverrideIsTemplate (MStatus *ReturnStatus=NULL) const |
Determines whether or not Display Type of the draw override is Template for this node. More... | |
bool | drawOverrideColor (MColor &color, MStatus *ReturnStatus=NULL) const |
Determines the draw override color used by this node. More... | |
MStatus | getConnectedSetsAndMembers (unsigned int instanceNumber, MObjectArray &sets, MObjectArray &comps, bool renderableSetsOnly) const |
Returns all the sets connected to the specified instance of this DAG object. More... | |
MBoundingBox | boundingBox (MStatus *ReturnStatus=NULL) const |
Returns the bounding box for the dag node in object space. More... | |
MDagPath | dagPath (MStatus *ReturnStatus=NULL) const |
Returns the DagPath to which the Function Set is attached. More... | |
virtual MStatus | setObject (const MDagPath &path) |
Attaches Function Set to the DAG Node that has the given DAG Path. More... | |
MStatus | setObject (MObject &object) override |
Attaches Function Set to given DAG Node. More... | |
MObject | model (MStatus *ReturnStatus=NULL) const |
Deprecated in 2016.0 More... | |
MFnDagNode (const MObject &object, MStatus *ret=NULL) | |
No script support. More... | |
MStatus | setObject (const MObject &object) override |
No script support. More... | |
Public Member Functions inherited from MFnDependencyNode | |
virtual | ~MFnDependencyNode () |
Destructor. | |
MFnDependencyNode () | |
Default constructor. | |
MFnDependencyNode (MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. More... | |
MObject | create (const MTypeId &typeId, MStatus *ReturnStatus=NULL) |
Creates a new dependency node with the given type tag. More... | |
MObject | create (const MTypeId &typeId, const MString &name, MStatus *ReturnStatus=NULL) |
Creates a new dependency node with the given type tag. More... | |
MObject | create (const MString &type, MStatus *ReturnStatus=NULL) |
Creates a new dependency node with the given type. More... | |
MObject | create (const MString &type, const MString &name, MStatus *ReturnStatus=NULL) |
Creates a new dependency node with the given type. More... | |
MTypeId | typeId (MStatus *ReturnStatus=NULL) const |
Returns the type id of this node. More... | |
MString | typeName (MStatus *ReturnStatus=NULL) const |
Returns the type name of this node. More... | |
MString | name (MStatus *ReturnStatus=NULL) const |
Returns the name of this node. More... | |
MString | absoluteName (MStatus *ReturnStatus=NULL) const |
Returns the absolute name of this node. More... | |
MString | uniqueName (MStatus *ReturnStatus=NULL) const |
Introduced in 2023.0 More... | |
MString | pluginName (MStatus *ReturnStatus=NULL) const |
Returns the name of the plug-in this MFnDependendencyNode was defined in. More... | |
MString | setName (const MString &name, bool createNamespace=false, MStatus *ReturnStatus=NULL) |
Sets the name of this node. More... | |
MUuid | uuid (MStatus *ReturnStatus=NULL) const |
Returns the node's UUID. More... | |
void | setUuid (const MUuid &uuid, MStatus *ReturnStatus=NULL) |
Sets the node's UUID. More... | |
MStatus | getConnections (MPlugArray &array) const |
Get all of the current connections to this node as an array of plugs. More... | |
unsigned int | attributeCount (MStatus *ReturnStatus=NULL) const |
Returns the number of attributes that this node has. More... | |
MObject | attribute (unsigned int index, MStatus *ReturnStatus=NULL) const |
Finds the attribute of this node at the given index. More... | |
MObject | reorderedAttribute (unsigned int index, MStatus *ReturnStatus=NULL) const |
Some nodes, such as the various animCurve nodes, require that their attributes be set in a specific order for proper operation. More... | |
MObject | attribute (const MString &attrName, MStatus *ReturnStatus=NULL) const |
Finds the attribute of this node that has the given name. More... | |
MAttrClass | attributeClass (const MObject &attr, MStatus *ReturnStatus=NULL) const |
Returns the class (normal, dynamic, extension) of the specified attribute. More... | |
MStatus | getAffectedAttributes (const MObject &attr, MObjectArray &affectedAttributes) const |
Returns an array of attributes that are affected by the attribute passed in. More... | |
MStatus | getAffectedByAttributes (const MObject &attr, MObjectArray &affectedByAttributes) const |
Returns an array of attributes that affect the attribute passed in, attr. More... | |
MPlug | findPlug (const MObject &attr, bool wantNetworkedPlug, MStatus *ReturnStatus=NULL) const |
Attempt to find a plug for the given attribute. More... | |
MPlug | findPlug (const MString &attrName, bool wantNetworkedPlug, MStatus *ReturnStatus=NULL) const |
Attempt to find a plug for the given attribute. More... | |
MPlug | findPlug (const MObject &attr, MStatus *ReturnStatus=NULL) const |
Deprecated in 2019.0 More... | |
MPlug | findPlug (const MString &attrName, MStatus *ReturnStatus=NULL) const |
Deprecated in 2019.0 More... | |
MStatus | addAttribute (const MObject &attr) |
Add a new dynamic attibute to this node. More... | |
MStatus | removeAttribute (const MObject &attr) |
Remove a dynamic attribute from a node. More... | |
MPxNode * | userNode (MStatus *ReturnStatus=NULL) const |
If the function set's node is a plug-in node, then this method will extract the MPxNode pointer from it. More... | |
bool | isFromReferencedFile (MStatus *ReturnStatus=NULL) const |
Indicates whether or not this node came from a referenced file. More... | |
bool | isShared (MStatus *ReturnStatus=NULL) const |
Indicates whether or not this node is shared. More... | |
bool | isTrackingEdits (MStatus *ReturnStatus=NULL) const |
Returns whether or not edits on the given node are being tracked by the generalized edit system. More... | |
bool | hasUniqueName (MStatus *ReturnStatus=NULL) const |
Indicates whether or not this node's name is unique within the scene. More... | |
MString | parentNamespace (MStatus *ReturnStatus=NULL) const |
Returns the name of the namespace in which this node resides. More... | |
bool | isLocked (MStatus *ReturnStatus=NULL) const |
Indicates whether or not this node is locked. More... | |
MStatus | setLocked (bool locked) |
Locks or unlocks this node. More... | |
bool | isNewAttribute (const MObject &attr, MStatus *ReturnStatus=NULL) const |
Indicates whether or not the specified attribute was added to this node within the current scene. More... | |
MStatus | setFlag (unsigned int flag, bool state) |
Sets the state of the specified flag for the node. More... | |
bool | isFlagSet (unsigned int flag, MStatus *ReturnStatus=NULL) const |
Retrieves the current state of the specified flag for a node. More... | |
bool | isDefaultNode (MStatus *ReturnStatus=NULL) const |
Returns true if the node is a default node. More... | |
MStatus | setDoNotWrite (bool flag) |
Use this method to mark the "do not write" state of this node. More... | |
bool | canBeWritten (MStatus *ReturnStatus=NULL) const |
Returns the do not write state of the node. More... | |
bool | hasAttribute (const MString &name, MStatus *ReturnStatus=NULL) const |
Returns true if the node already has an attribute with the given name. More... | |
MObject | getAliasAttr (bool force, MStatus *ReturnStatus=NULL) |
Returns the node's alias attribute, which is a special attribute used to store information about the node's attribute aliases. More... | |
bool | setAlias (const MString &alias, const MString &name, const MPlug &plug, bool add=true, MStatus *ReturnStatus=NULL) |
Sets or removes an alias (i.e. More... | |
bool | findAlias (const MString &alias, MObject &attrObj, MStatus *ReturnStatus=NULL) const |
Retrieves the attribute with the given alias. More... | |
bool | getAliasList (MStringArray &strArray, MStatus *ReturnStatus=NULL) |
Returns a list of all attribute aliases for this node. More... | |
MString | plugsAlias (const MPlug &plug, MStatus *ReturnStatus=NULL) |
Returns the alias for the plug's attribute or the empty string if that attribute has no alias. More... | |
MStatus | setIcon (const MString &filename) |
Associates a custom icon with the node for display in the Maya UI. More... | |
MString | icon (MStatus *ReturnStatus=NULL) const |
Returns the custom icon filename associated with the node. More... | |
MStatus | getExternalContent (MExternalContentInfoTable &table) const |
Returns the external content (files) that this node depends on. More... | |
MStatus | addExternalContentForFileAttr (MExternalContentInfoTable &table, const MObject &attr) const |
Adds content info to the specified table from a file path attribute. More... | |
MStatus | setExternalContentForFileAttr (const MObject &attr, const MExternalContentLocationTable &table) |
Sets content info in the specified attribute from the table. More... | |
MStatus | setExternalContent (const MExternalContentLocationTable &table) |
Changes the location of external content. More... | |
bool | affectsAnimation (MStatus *ReturnStatus=NULL) const |
Introduced in 2019.0 More... | |
MStatus | setAffectsAnimation () |
Introduced in 2019.0 More... | |
MString | setName (const MString &name, MStatus *ReturnStatus) |
Deprecated in 2019.0 More... | |
MFnDependencyNode (const MObject &object, MStatus *ReturnStatus=NULL) | |
Not available in Python. More... | |
bool | getPlugsAlias (const MPlug &plug, MString &aliasName, MStatus *ReturnStatus=NULL) |
Not available in Python. More... | |
virtual const adsk::Data::Associations * | metadata (MStatus *ReturnStatus=NULL) const |
Not available in Python. More... | |
virtual MStatus | setMetadata (const adsk::Data::Associations &) |
Not available in Python. More... | |
virtual MStatus | deleteMetadata () |
Not available in Python. More... | |
virtual MStatus | validateMetadata (MString &errors) const |
Not available in Python. More... | |
MStatus | dgTimerOn () |
Indicates that this node should collect DG timing data whenever DG timing is enabled. More... | |
MStatus | dgTimerOff () |
Indicates that this node should no longer collect DG timing data when DG timing is enabled. More... | |
MdgTimerState | dgTimerQueryState (MStatus *ReturnStatus=NULL) |
The function returns the current on/off state of the node's timer. More... | |
MStatus | dgTimerReset () |
The function resets the dependency graph timers and counters for this node to zero. More... | |
double | dgTimer (const MdgTimerMetric timerMetric, const MdgTimerType timerType, MStatus *ReturnStatus=NULL) const |
The function returns the specified timer value for the current node. More... | |
MStatus | dgCallbacks (const MdgTimerType type, MStringArray &callbackName, MDoubleArray &value) |
Node callbacks that occur when timing is enabled get logged with the node and can be queried via this method. More... | |
MStatus | dgCallbackIds (const MdgTimerType type, const MString &callbackName, MCallbackIdArray &callbackId, MDoubleArray &value) |
This method provides a further breakdown of the per-callback time returned via dgCallbacks() by returning the data on a per-callbackId basis. More... | |
MStatus | addAttribute (const MObject &attr, MAttrClass type) |
Deprecated in 2019.0 More... | |
MStatus | removeAttribute (const MObject &attr, MAttrClass type) |
Deprecated in 2019.0 More... | |
Public Member Functions inherited from MFnBase | |
virtual | ~MFnBase () |
Class Destructor. More... | |
bool | hasObj (MFn::Type) const |
Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system. More... | |
bool | hasObj (const MObject &) const |
Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system. More... | |
MObject | object (MStatus *ReturnStatus=nullptr) const |
Returns the MObject that is attached to the Function Set. More... | |
Static Public Member Functions | |
static const char * | className () |
Returns the name of this class. More... | |
Static Public Member Functions inherited from MFnDagNode | |
static const char * | className () |
Returns the name of this class. More... | |
Static Public Member Functions inherited from MFnDependencyNode | |
static const char * | className () |
Returns the name of this class. More... | |
static MString | classification (const MString &nodeTypeName) |
Retrieves the classification string for a node type. More... | |
static unsigned int | allocateFlag (const MString pluginName, MStatus *ReturnStatus=NULL) |
Allocates a node flag for sole use by the caller. More... | |
static MStatus | deallocateFlag (const MString pluginName, unsigned int flag) |
Deallocates a node flag which was previously allocated by a call to allocateFlag. More... | |
static MStatus | deallocateAllFlags (const MString pluginName) |
Deallocates all of the node flags which are currently allocated to the specified plugin. More... | |
static void | enableDGTiming (bool enable) |
Globally enables or disables the DG node timing mechanism. More... | |
Static Public Member Functions inherited from MFnBase | |
static const char * | className () |
Returns the name of this class. More... | |
static const char * | typeString (MFn::Type) |
Introduced in 2020.0 More... | |
static bool | isValid (MFn::Type) |
Introduced in 2020.0 More... | |
Fluid node function set.
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.
enum FluidMethod |
enum FluidGradient |
Defines the orientation of the gradient.
enum FalloffMethod |
enum ColorMethod |
enum CoordinateMethod |
|
virtual |
Function set type.
Return the class type : MFn::kFluid.
Reimplemented from MFnDagNode.
|
static |
Returns the name of this class.
Return the class name : "MFnFluid".
MObject create3D | ( | unsigned int | Xres, |
unsigned int | Yres, | ||
unsigned int | Zres, | ||
double | Xdim, | ||
double | Ydim, | ||
double | Zdim, | ||
MObject | parent = MObject::kNullObj , |
||
MStatus * | ReturnStatus = NULL |
||
) |
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.
[in] | Xres | number of fluid grid cells in the x dimension |
[in] | Yres | number of fluid grid cells in the y dimension |
[in] | Zres | number of fluid grid cells in the z dimension |
[in] | Xdim | object space size in the x dimension |
[in] | Ydim | object space size in the y dimension |
[in] | Zdim | object space size in the z dimension |
[in] | 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. |
[out] | ReturnStatus | Status code |
MObject create2D | ( | unsigned int | Xres, |
unsigned int | Yres, | ||
double | Xdim, | ||
double | Ydim, | ||
MObject | parent = MObject::kNullObj , |
||
MStatus * | ReturnStatus = NULL |
||
) |
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.
[in] | Xres | number of fluid grid cells in the x dimension |
[in] | Yres | number of fluid grid cells in the y dimension |
[in] | Xdim | object space size in the x dimension |
[in] | Ydim | object space size in the y dimension |
[in] | 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. |
[out] | ReturnStatus | Status code |
MStatus getResolution | ( | unsigned int & | Xres, |
unsigned int & | Yres, | ||
unsigned int & | Zres | ||
) | const |
Gets the resolution of the fluid.
The resolution gives the number of cells in the fluid grid in each direction.
[out] | Xres | storage for returning the number of fluid grid cells in the x dimension |
[out] | Yres | storage for returning the number of fluid grid cells in the y dimension |
[out] | Zres | storage for returning the number of fluid grid cells in the z dimension |
MStatus getResolution | ( | unsigned int & | Xres, |
unsigned int & | Yres | ||
) | const |
Gets the resolution of the fluid.
The resolution gives the number of cells in the fluid grid in each direction.
[out] | Xres | storage for returning the number of fluid grid cells in the x dimension |
[out] | Yres | storage for returning the number of fluid grid cells in the y dimension |
MStatus getDimensions | ( | double & | Xdim, |
double & | Ydim, | ||
double & | Zdim | ||
) | const |
Gets the dimensions of the fluid.
The dimensions give the object space size of the fluid object in each direction.
[out] | Xdim | storage for returning the dimension of the fluid in x |
[out] | Ydim | storage for returning the dimension of the fluid in y |
[out] | Zdim | storage for returning the dimension of the fluid in z |
MStatus setSize | ( | unsigned int | Xres, |
unsigned int | Yres, | ||
unsigned int | Zres, | ||
double | Xdim, | ||
double | Ydim, | ||
double | Zdim, | ||
bool | resample | ||
) |
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.
[in] | Xres | number of fluid grid cells in the x dimension |
[in] | Yres | number of fluid grid cells in the y dimension |
[in] | Zres | number of fluid grid cells in the z dimension |
[in] | Xdim | object space size in the x dimension |
[in] | Ydim | object space size in the y dimension |
[in] | Zdim | object space size in the z dimension |
[in] | 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 |
MStatus setSize | ( | unsigned int | Xres, |
unsigned int | Yres, | ||
double | Xdim, | ||
double | Ydim, | ||
bool | resample | ||
) |
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.
[in] | Xres | number of fluid grid cells in the x dimension |
[in] | Yres | number of fluid grid cells in the y dimension |
[in] | Xdim | object space size in the x dimension |
[in] | Ydim | object space size in the y dimension |
[in] | 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 |
unsigned int gridSize | ( | MStatus * | ReturnStatus = NULL | ) |
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.
[out] | ReturnStatus | Status code. |
MStatus velocityGridSizes | ( | int & | xsize, |
int & | ysize, | ||
int & | zsize | ||
) |
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.
[out] | xsize | storage for the x velocity grid size |
[out] | ysize | storage for the y velocity grid size |
[out] | zsize | storage for the z velocity grid size |
float * falloff | ( | MStatus * | ReturnStatus = NULL | ) |
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.
[out] | ReturnStatus | Status code |
float * density | ( | MStatus * | ReturnStatus = NULL | ) |
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.
[out] | ReturnStatus | Status code |
MStatus getVelocity | ( | float *& | Xvel, |
float *& | Yvel, | ||
float *& | Zvel | ||
) |
This method returns pointers to the storage for the velocity data in the fluid.
The size of these arrays can be obtained using the "velocityGridSizes" 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.
[out] | Xvel | storage for returning a pointer to the x components of the velocity values in the grid |
[out] | Yvel | storage for returning a pointer to the y components of the velocity values in the grid |
[out] | Zvel | storage for returning a pointer to the z components of the velocity values in the grid |
float * pressure | ( | MStatus * | ReturnStatus = NULL | ) |
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.
[out] | ReturnStatus | Status code |
float * temperature | ( | MStatus * | ReturnStatus = NULL | ) |
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.
[out] | ReturnStatus | Status code |
float * fuel | ( | MStatus * | ReturnStatus = NULL | ) |
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.
[out] | ReturnStatus | Status code |
MStatus getCoordinates | ( | float *& | u, |
float *& | v, | ||
float *& | w | ||
) |
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.
[out] | u | storage for returning a pointer to the u values in the grid |
[out] | v | storage for returning a pointer to the v values in the grid |
[out] | w | storage for returning a pointer to the w values in the grid |
MStatus getColors | ( | float *& | r, |
float *& | g, | ||
float *& | b | ||
) |
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.
[out] | r | storage for returning a pointer to the red components of the color values in the grid |
[out] | g | storage for returning a pointer to the green components of the color values in the grid |
[out] | b | storage for returning a pointer to the blue components of the color values in the grid |
MStatus setFalloffMode | ( | MFnFluid::FalloffMethod | method | ) |
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:
[in] | method | method for determining the falloff value in the grid |
MStatus getFalloffMode | ( | MFnFluid::FalloffMethod & | method | ) |
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:
[out] | method | storage for returning the method by which the falloff value in the grid is determined |
MStatus setDensityMode | ( | MFnFluid::FluidMethod | method, |
MFnFluid::FluidGradient | gradient | ||
) |
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:
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:
[in] | method | method for determining the fluid density in the grid |
[in] | gradient | gradient type, only used if the method is kGradient |
MStatus getDensityMode | ( | MFnFluid::FluidMethod & | method, |
MFnFluid::FluidGradient & | gradient | ||
) |
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:
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:
[out] | method | storage for returning the method by which the fluid density in the grid is determined |
[out] | gradient | storage for returning the gradient type, which is only relevant if the method is kGradient |
MStatus setVelocityMode | ( | MFnFluid::FluidMethod | method, |
MFnFluid::FluidGradient | gradient | ||
) |
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:
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:
[in] | method | method for determining the fluid velocity in the grid |
[in] | gradient | gradient type, only used if the method is kGradient |
MStatus getVelocityMode | ( | MFnFluid::FluidMethod & | method, |
MFnFluid::FluidGradient & | gradient | ||
) |
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:
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:
[out] | method | storage for returning the method by which the fluid velocity in the grid is determined |
[out] | gradient | storage for returning the gradient type, which is only relevant if the method is kGradient |
MStatus setTemperatureMode | ( | MFnFluid::FluidMethod | method, |
MFnFluid::FluidGradient | gradient | ||
) |
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:
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:
[in] | method | method for determining the fluid temperature in the grid |
[in] | gradient | gradient type, only used if the method is kGradient |
MStatus getTemperatureMode | ( | MFnFluid::FluidMethod & | method, |
MFnFluid::FluidGradient & | gradient | ||
) |
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:
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:
[out] | method | storage for returning the method by which the fluid temperature in the grid is determined |
[out] | gradient | storage for returning the gradient type, which is only relevant if the method is kGradient |
MStatus setFuelMode | ( | MFnFluid::FluidMethod | method, |
MFnFluid::FluidGradient | gradient | ||
) |
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:
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:
[in] | method | method for determining the fluid fuel in the grid |
[in] | gradient | gradient type, only used if the method is kGradient |
MStatus getFuelMode | ( | MFnFluid::FluidMethod & | method, |
MFnFluid::FluidGradient & | gradient | ||
) |
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:
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:
[out] | method | storage for returning the method by which the fluid fuel values in the grid is determined |
[out] | gradient | storage for returning the gradient type, which is only relevant if the method is kGradient |
MStatus setCoordinateMode | ( | MFnFluid::CoordinateMethod | method | ) |
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:
[in] | method | method for determining the fluid UVW coordinates in the grid |
MStatus getCoordinateMode | ( | MFnFluid::CoordinateMethod & | method | ) |
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:
[out] | method | storage for returning the method by which the fluid coordinate values in the grid is determined |
MStatus setColorMode | ( | MFnFluid::ColorMethod | method | ) |
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:
[in] | method | method for determining the fluid color in the grid |
MStatus getColorMode | ( | MFnFluid::ColorMethod & | method | ) |
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:
[out] | method | storage for returning the method by which the fluid color in the grid is determined |
MStatus getForceAtPoint | ( | const MPointArray & | point, |
const MVectorArray & | velocity, | ||
const MDoubleArray & | mass, | ||
MVectorArray & | force, | ||
double | deltaTime = 1.0 / 24.0 |
||
) |
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).
[in] | point | array of positions for each point. |
[in] | 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. |
[in] | 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. |
[out] | 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. |
[in] | deltaTime | time increment in seconds. Default is (1.0 / 24.0 fps). |
MStatus getForceAtPoint | ( | const MVectorArray & | point, |
const MVectorArray & | velocity, | ||
const MDoubleArray & | mass, | ||
MVectorArray & | force, | ||
double | deltaTime = 1.0 / 24.0 |
||
) |
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.
[in] | point | array of positions for each point. |
[in] | 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. |
[in] | 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. |
[out] | 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. |
[in] | deltaTime | time increment in seconds for usage with the Air and Vortex fields. Default is (1.0 / 24.0 fps). |
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.
[in] | objectSpacePoint | an object space location |
[out] | gridCoords | the voxel indices, if the point falls inside a voxel |
[out] | status | Status code |
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
[in] | xi | the voxel x index |
[in] | yi | the voxel y index |
[in] | zi | the voxel z index |
[out] | objectSpacePoint | the object space location |
MStatus updateGrid | ( | ) |
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.
void emitIntoArrays | ( | float | val, |
int | x, | ||
int | y, | ||
int | z, | ||
float | density, | ||
float | heat, | ||
float | fuel, | ||
bool | doColor, | ||
const MColor & | emitColor | ||
) |
Use this method to add density, heat, fuel, and/or color to a particular voxel of a fluid.
[in] | val | multiplier applied to the specified density, heat, and fuel values. |
[in] | x | voxel index in x |
[in] | y | voxel index in y |
[in] | z | voxel index in z |
[in] | density | amount of density to add to the voxel |
[in] | heat | amount of heat to add to the voxel |
[in] | fuel | amount of fuel to add to the voxel |
[in] | 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. |
[in] | emitColor | color to be blended into the voxel. |
int index | ( | int | xi, |
int | yi | ||
) |
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.
[in] | xi | index in x |
[in] | yi | index in y |
int index | ( | int | xi, |
int | yi, | ||
int | zi | ||
) |
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.
[in] | xi | index in x |
[in] | yi | index in y |
[in] | zi | index in z |
void index | ( | int | index, |
int & | xi, | ||
int & | yi, | ||
int & | zi | ||
) |
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.
[in] | index | index to convert into coordinates |
[out] | xi | storage for the index in x |
[out] | yi | storage for the index in y |
[out] | zi | storage for the index in z |
int index | ( | int | xi, |
int | yi, | ||
int | zi, | ||
int | xres, | ||
int | yres, | ||
int | zres | ||
) |
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.
[in] | xi | index in x |
[in] | yi | index in y |
[in] | zi | index in z |
[in] | xres | resolution in x |
[in] | yres | resolution in y |
[in] | zres | resolution in z |
void index | ( | int | index, |
int | xres, | ||
int | yres, | ||
int | zres, | ||
int & | xi, | ||
int & | yi, | ||
int & | zi | ||
) |
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.
[in] | index | index to convert into coordinates |
[in] | xres | resolution in x |
[in] | yres | resolution in y |
[in] | zres | resolution in z |
[out] | xi | storage for the index in x |
[out] | yi | storage for the index in y |
[out] | zi | storage for the index in z |
bool isAutoResize | ( | ) |
Is this an autoresize fluid?
bool isResizeToEmitter | ( | ) |
If this is an autoresize fluid, should it also resize to the emitter.
Tells the fluid shape to autoresize to include these two points This would normally be used in a fluid emitter node if the fluid had resizeToEmitter turned on.
This may fail if the fluid is not autoRise and resizeToEmitter, or if the fluid has reached its maxResolution
[in] | min | point at lower corner of bounding box |
[in] | max | point at upper corner of boinding box |