- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Static Public Attributes

# MPxFluidEmitterNode Class Reference
OpenMayaFX - API module for effects

This reference page is linked to from the following overview topics: Parent class descriptions, MPxNode and its derived classes, Removal of MStatus return codes from .NET API, Overview of example plug-ins, Example C++ plug-in descriptions.

Search for all occurrences

## Detailed Description

Base class for user defined particle emitters.

MPxFluidEmitterNode allows the creation and manipulation of dependency graph nodes representing fluid emitters.

Examples:

  simpleFluidEmitter.h.

`#include <MPxFluidEmitterNode.h>`

Inheritance diagram for MPxFluidEmitterNode:
[legend]

List of all members.

## Public Member Functions
| MPxFluidEmitterNode ()
| Class constructor.
virtual | ~MPxFluidEmitterNode ()
| The class destructor.
virtual MPxNode::Type | type () const
| This method returns the type of the node.
virtual MStatus | compute (const MPlug &plug, MDataBlock &dataBlock)
| This method should be overridden in user defined nodes.
virtual MStatus | fluidEmitter (const MObject &fluidObj, const MMatrix &worldMatrix, int plugIndex)
| This is the main method that plug-in fluid emitter nodes must override in order to emit into fluids.
double | fluidDensityEmission (MDataBlock &block)
| Intended to be called from within the emitter's compute() method, this method retrieves the "fluidDensityEmission" attribute value common to all fluid emitters.
double | fluidHeatEmission (MDataBlock &block)
| Intended to be called from within the emitter's compute() method, this method retrieves the "fluidHeatEmission" attribute value common to all fluid emitters.
double | fluidFuelEmission (MDataBlock &block)
| Intended to be called from within the emitter's compute() method, this method retrieves the "fluidFuelEmission" attribute value common to all fluid emitters.
bool | fluidEmitColor (MDataBlock &block)
| Intended to be called from within the emitter's compute() method, this method retrieves the "fluidEmitColor" attribute value common to all fluid emitters.
MColor | fluidColor (MDataBlock &block)
| Intended to be called from within the emitter's compute() method, this method retrieves the "fluidColor" attribute value common to all fluid emitters.
double | fluidDropoff (MDataBlock &block)
| Intended to be called from within the emitter's compute() method, this method retrieves the "fluidDropoff" attribute value common to all fluid emitters.
double | turbulence (MDataBlock &block)
| Intended to be called from within the emitter's compute() method, this method retrieves the "turbulence" attribute value common to all fluid emitters.
bool | fluidJitter (MDataBlock &block)
| Intended to be called from within the emitter's compute() method, this method retrieves the "fluidJitter" attribute value common to all fluid emitters.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.
## Static Public Attributes
static MObject | mFluidDensityEmission
| density emission rate attribute Search for all occurrences
static MObject | mFluidHeatEmission
| heat emission rate attribute Search for all occurrences
static MObject | mFluidFuelEmission
| fuel emission rate attribute Search for all occurrences
static MObject | mEmitFluidColor
| color emission toggle attribute Search for all occurrences
static MObject | mFluidColor
| emission color attribute Search for all occurrences
static MObject | mFluidColorR
| emission red color channel attribute Search for all occurrences
static MObject | mFluidColorG
| emission green color channel attribute Search for all occurrences
static MObject | mFluidColorB
| emission blue color channel attribute Search for all occurrences
static MObject | mFluidDropoff
| emission dropoff attribute Search for all occurrences
static MObject | mTurbulence
| emission turbulence attribute Search for all occurrences
static MObject | mFluidJitter
| emission jitter attribute Search for all occurrences
static MObject | mEmissionFunction
| emission function attribute Search for all occurrences

## Member Function Documentation

MPxNode::Type type | ( |  | ) | const`[virtual]`

Search for all occurrences

This method returns the type of the node.

It should not be overridden by the user. It will return MPxNode::kEmitterNode.

Returns:
  The type of node

Reimplemented from MPxEmitterNode.

MStatus compute | ( | const MPlug & | plug,
|  | MDataBlock & | dataBlock
| ) |  | `[virtual]`

Search for all occurrences

This method should be overridden in user defined nodes.

Recompute the given output based on the nodes inputs. The plug represents the data value that needs to be recomputed, and the data block holds the storage for all of the node's attributes.

The MDataBlock will provide smart handles for reading and writing this node's attribute values. Only these values should be used when performing computations.

When evaluating the dependency graph, Maya will first call the compute method for this node. If the plug that is provided to the compute indicates that that the attribute was defined by the Maya parent node, the compute method should return MS::kUnknownParameter. When this occurs, Maya will call the internal Maya node from which the user-defined node is derived to compute the plug's value.

This means that a user defined node does not need to be concerned with computing inherited output attributes. However, if desired, these can be safely recomputed by this method to change the behaviour of the node.

Parameters:

  [in] | plug | plug representing the attribute that needs to be recomputed
  [in] | dataBlock | data block containing storage for the node's attributes

Returns:
  Status code

Status Codes:
  - MS::kSuccess Compute was successful
  - MS::kFailure Compute failed

Reimplemented from MPxEmitterNode.

Examples:
  simpleFluidEmitter.h.

MStatus fluidEmitter | ( | const MObject & | fluidObj,
|  | const MMatrix & | worldMatrix,
|  | int | plugIndex
| ) |  | `[virtual]`

Search for all occurrences

This is the main method that plug-in fluid emitter nodes must override in order to emit into fluids.

When an emitter is attached to a fluid, at every evaluation step the fluid will call this method on the emitter. The method receives a fluid object into which to emit, the index of the fluid in the array of fluid targets for this emitter, and the worldspace matrix of the fluid. The emitter should query its attributes to determine how much density, heat, color, and/or fuel to emit into the fluid, then call the MFnFluid::emitIntoArrays() method to actually add the necessary quantities to the fluid.

Returning MS::kUnknownParameter from this method will cause Maya to execute the default fluid emitter's emission behavior.

Parameters:

  [in] | fluidObj | the fluid object into which the emitter is emitting.
  [in] | worldMatrix | object to world transformation matrix for the fluid
  [in] | plugIndex | the index of the fluid in the array of emission targets for this emitter. Pass this value to the random number stream generation routines in MPxEmitterNode.

Returns:
  Status code

Status Codes:
  - MS::kSuccess Return kSuccess to indicate that the plug-in node successfully performed the emission step.
  - MS::kUnknownParameter Return kUnknownParameter to tell Maya to execute the standard internal fluid emitter behavior for this time step.

Examples:
  simpleFluidEmitter.h.

double fluidDensityEmission | ( | MDataBlock & | block | ) |

Search for all occurrences

Intended to be called from within the emitter's compute() method, this method retrieves the "fluidDensityEmission" attribute value common to all fluid emitters.

This indicates the amount of fluid material to be emitted per second, and it is modulated by the emitter's "rate" attribute value.

Parameters:

  [in] | block | data block containing storage for the node's attributes

Returns:
  The fluid density emission rate for the fluid emitter.

double fluidHeatEmission | ( | MDataBlock & | block | ) |

Search for all occurrences

Intended to be called from within the emitter's compute() method, this method retrieves the "fluidHeatEmission" attribute value common to all fluid emitters.

This indicates the amount of heat to be emitted per second, and it is modulated by the emitter's "rate" attribute value.

Parameters:

  [in] | block | data block containing storage for the node's attributes

Returns:
  The fluid heat emission rate for the fluid emitter.

double fluidFuelEmission | ( | MDataBlock & | block | ) |

Search for all occurrences

Intended to be called from within the emitter's compute() method, this method retrieves the "fluidFuelEmission" attribute value common to all fluid emitters.

This indicates the amount of fuel to be emitted per second, and it is modulated by the emitter's "rate" attribute value.

Parameters:

  [in] | block | data block containing storage for the node's attributes

Returns:
  The fluid fuel emission rate for the fluid emitter.

bool fluidEmitColor | ( | MDataBlock & | block | ) |

Search for all occurrences

Intended to be called from within the emitter's compute() method, this method retrieves the "fluidEmitColor" attribute value common to all fluid emitters.

This indicates whether or not the emitter should emit color into the fluid.

Parameters:

  [in] | block | data block containing storage for the node's attributes

Returns:
  true if the emitter should emit color into the fluid, false otherwise.

MColor fluidColor | ( | MDataBlock & | block | ) |

Search for all occurrences

Intended to be called from within the emitter's compute() method, this method retrieves the "fluidColor" attribute value common to all fluid emitters.

This specifies the color to be added to the fluid.

Parameters:

  [in] | block | data block containing storage for the node's attributes

Returns:
  The color that should be emitted into the fluid.

double fluidDropoff | ( | MDataBlock & | block | ) |

Search for all occurrences

Intended to be called from within the emitter's compute() method, this method retrieves the "fluidDropoff" attribute value common to all fluid emitters.

This specifies the the speed with which fluid emission drops off with increasing distance from the emitter, with higher values meaning faster dropoff.

Parameters:

  [in] | block | data block containing storage for the node's attributes

Returns:
  The dropoff rate for the fluid emitter.

double turbulence | ( | MDataBlock & | block | ) |

Search for all occurrences

Intended to be called from within the emitter's compute() method, this method retrieves the "turbulence" attribute value common to all fluid emitters.

This specifies the amount of turbulence that should be applied to the emitter's output.

Parameters:

  [in] | block | data block containing storage for the node's attributes

Returns:
  The turbulence value for the fluid emitter.

bool fluidJitter | ( | MDataBlock & | block | ) |

Search for all occurrences

Intended to be called from within the emitter's compute() method, this method retrieves the "fluidJitter" attribute value common to all fluid emitters.

This specifies how the voxel grid should be sampled for emission. Without jitter, the grid is sampled only at voxel centers, but with jitter enabled, each voxel is sampled at a random location. The fluid emitter is responsible for implementing this behavior. It is recommended that the random stream methods on MPxEmitterNode be used to implement repeatable randomized behavior in this area.

Parameters:

  [in] | block | data block containing storage for the node's attributes

Returns:
  true if jitter should be applied to the emission behavior, false otherwise.

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  The name of this class.

Reimplemented from MPxEmitterNode.

MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode
MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode MPxFluidEmitterNode