class MPxFluidEmitterNode

Jump to documentation

: public MPxEmitterNode Base class for user defined particle emitters (OpenMayaFX) (OpenMayaMPx.py)

Inheritance:

MPxFluidEmitterNode < MPxEmitterNode < MPxNode

public members:

MPxFluidEmitterNode ()
virtual ~MPxFluidEmitterNode ()
virtual MPxNode::Type type () const
virtual MStatus compute (const MPlug & plug, MDataBlock & dataBlock)
virtual MStatus fluidEmitter ( const MObject & fluidObj, const MMatrix & worldMatrix, int plugIndex )
static MObject mFluidDensityEmission
density emission rate attribute
static MObject mFluidHeatEmission
heat emission rate attribute
static MObject mFluidFuelEmission
fuel emission rate attribute
static MObject mEmitFluidColor
color emission toggle attribute
static MObject mFluidColor
emission color attribute
static MObject mFluidColorR
emission red color channel attribute
static MObject mFluidColorG
emission green color channel attribute
static MObject mFluidColorB
emission blue color channel attribute
static MObject mFluidDropoff
emission dropoff attribute
static MObject mTurbulence
emission turbulence attribute
static MObject mFluidJitter
emission jitter attribute
static MObject mEmissionFunction
emission function attribute
double fluidDensityEmission ( MDataBlock & block )
double fluidHeatEmission ( MDataBlock & block )
double fluidFuelEmission ( MDataBlock & block )
bool fluidEmitColor ( MDataBlock & block )
MColor fluidColor ( MDataBlock & block )
double fluidDropoff ( MDataBlock & block )
double turbulence ( MDataBlock & block )
bool fluidJitter ( MDataBlock & block )

Inherited from MPxEmitterNode:

public members:

virtual MPxNode::Type type () const
virtual MStatus compute (const MPlug & plug, MDataBlock & dataBlock)
static MObject mEmitterType
enum MEmitterType
kDirectional
kOmni
kSurface
kCurve
kVolume
static MObject mRate
static MObject mSpeed
static MObject mDirection
static MObject mDirectionX
static MObject mDirectionY
static MObject mDirectionZ
static MObject mOwnerPosData
static MObject mOwnerVelData
static MObject mOwnerCentroid
static MObject mOwnerCentroidX
static MObject mOwnerCentroidY
static MObject mOwnerCentroidZ
static MObject mSweptGeometry
static MObject mWorldMatrix
static MObject mStartTime
static MObject mDeltaTime
static MObject mIsFull
static MObject mInheritFactor
static MObject mSeed
static MObject mRandState
static MObject mCurrentTime
static MObject mOutput
static MObject mMinDistance
static MObject mMaxDistance
MObject getOwnerShape ()
MTime getCurrentTime ( MDataBlock & block )
MTime getStartTime ( int plugIndex, MDataBlock & block )
MTime getDeltaTime ( int plugIndex, MDataBlock & block )
int getRandomSeed ( int plugIndex, MDataBlock & block )
void getRandomState ( int plugIndex, MDataBlock & block )
void setRandomState ( int plugIndex, MDataBlock & block )
void resetRandomState ( int plugIndex, MDataBlock & block )
double randgen ()
double getRate ( MDataBlock & block )
double getMinDistance ( MDataBlock & block )
double getMaxDistance ( MDataBlock & block )
MPoint getWorldPosition ()
MMatrix getWorldMatrix ()
bool volumePrimitiveBoundingBox ( MBoundingBox & box )
bool volumePrimitivePointInside ( const MPoint & worldPoint, const MMatrix & emitterWorldMatrix )
double volumePrimitiveDistanceFromAxis ( const MPoint & worldPoint, const MMatrix & emitterWorldMatrix )
bool hasValidEmission2dTexture ( const MObject & texAttr, MStatus *status = NULL )
MStatus evalEmission2dTexture ( const MObject & texAttr, MDoubleArray & uCoords, MDoubleArray & vCoords, MVectorArray * resultColors, MDoubleArray * resultAlphas )

Inherited from MPxNode:

public members:

enum Type
kDependNode
kLocatorNode
kDeformerNode
kManipContainer
kSurfaceShape
kFieldNode
kEmitterNode
kSpringNode
kIkSolverNode
kHardwareShader
Custom shader derived from MPxHardwareShader
kHwShaderNode
Custom shader derived from MPxHwShaderNode
kTransformNode
kObjectSet
kFluidEmitterNode
kImagePlaneNode
kParticleAttributeMapperNode
kConstraintNode
kLast
virtual void postConstructor ()
virtual MStatus compute ( const MPlug & plug, MDataBlock & dataBlock )
virtual bool getInternalValueInContext ( const MPlug & plug, MDataHandle & dataHandle, MDGContext & ctx)
virtual bool setInternalValueInContext ( const MPlug & plug, const MDataHandle & dataHandle, MDGContext & ctx)
virtual bool getInternalValue ( const MPlug & plug, MDataHandle & dataHandle)
virtual bool setInternalValue ( const MPlug & plug, const MDataHandle & dataHandle)
virtual int internalArrayCount ( const MPlug & plug, const MDGContext & ctx) const
virtual void copyInternalData ( MPxNode * )
virtual MStatus legalConnection ( const MPlug & plug, const MPlug & otherPlug, bool asSrc, bool& isLegal ) const
virtual MStatus legalDisconnection ( const MPlug & plug, const MPlug & otherPlug, bool asSrc, bool& isLegal ) const
virtual MStatus setDependentsDirty ( const MPlug & plug, MPlugArray & plugArray)
virtual MStatus connectionMade ( const MPlug & plug, const MPlug & otherPlug, bool asSrc )
virtual MStatus connectionBroken ( const MPlug & plug, const MPlug & otherPlug, bool asSrc )
virtual bool isPassiveOutput ( const MPlug & plug ) const
virtual MStatus shouldSave ( const MPlug & plug, bool& isSaving )
virtual MPlug passThroughToOne ( const MPlug & plug ) const
virtual bool passThroughToMany ( const MPlug & plug, MPlugArray & plugArray ) const
MTypeId typeId () const
MString typeName () const
MString name () const
virtual Type type () const
virtual bool isAbstractClass () const
MObject thisMObject () const
static MStatus addAttribute ( const MObject & attr )
static MStatus inheritAttributesFrom ( const MString & parentClassName )
static MStatus attributeAffects ( const MObject & whenChanges, const MObject & isAffected )
MStatus setExistWithoutInConnections ( bool flag )
bool existWithoutInConnections ( MStatus * ReturnStatus = NULL ) const
MStatus setExistWithoutOutConnections ( bool flag )
bool existWithoutOutConnections ( MStatus * ReturnStatus = NULL ) const
static MObject message
static MObject isHistoricallyInteresting
static MObject caching
static MObject state

protected members:

MDataBlock forceCache ( MDGContext & ctx= MDGContext::fsNormal )
void setMPSafe ( bool flag )
MStatus setDoNotWrite ( bool flag )
bool doNotWrite ( MStatus *ReturnStatus = NULL ) const

Documentation

Base class for user defined particle emitters (OpenMayaFX) (OpenMayaMPx.py)
Description
MPxFluidEmitterNode allows the creation and manipulation of dependency graph nodes representing fluid emitters.

Functions

MPxFluidEmitterNode:: MPxFluidEmitterNode ()

Constructor

Class constructor.

MPxFluidEmitterNode:: ~MPxFluidEmitterNode ()
Destructor

The class destructor.

MPxNode::Type MPxFluidEmitterNode:: type () const

Description

This method returns the type of the node. It should not be overridden by the user. It will return MPxNode::kEmitterNode.

Return Value

  • the type of node

MStatus MPxFluidEmitterNode:: compute ( const MPlug & plug, MDataBlock & dataBlock )
Description

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.

Arguments

  • plug plug representing the attribute that needs to be recomputed
  • block data block containing storage for the node's attributes

Return Value

  • Status code

Status Codes

  • MS::kSuccess Compute was successful
  • MS::kFailure Compute failed

MStatus MPxFluidEmitterNode:: fluidEmitter ( const MObject & fluidObj, const MMatrix & worldMatrix, int plugIndex )
Description

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.

Arguments

  • fluidObj the fluid object into which the emitter is emitting.
  • worldMatrix object to world transformation matrix for the fluid
  • 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.

Return Value

  • 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.

double MPxFluidEmitterNode:: fluidDensityEmission ( MDataBlock & block )

Description

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.

Arguments

  • block data block containing storage for the node's attributes

Return Value

  • the fluid density emission rate for the fluid emitter.

double MPxFluidEmitterNode:: fluidHeatEmission ( MDataBlock & block )

Description

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.

Arguments

  • block data block containing storage for the node's attributes

Return Value

  • the fluid heat emission rate for the fluid emitter.

double MPxFluidEmitterNode:: fluidFuelEmission ( MDataBlock & block )

Description

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.

Arguments

  • block data block containing storage for the node's attributes

Return Value

  • the fluid fuel emission rate for the fluid emitter.

bool MPxFluidEmitterNode:: fluidEmitColor ( MDataBlock & block )

Description

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.

Arguments

  • block data block containing storage for the node's attributes

Return Value

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

MColor MPxFluidEmitterNode:: fluidColor ( MDataBlock & block )

Description

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.

Arguments

  • block data block containing storage for the node's attributes

Return Value

  • the color that should be emitted into the fluid.

double MPxFluidEmitterNode:: fluidDropoff ( MDataBlock & block )

Description

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.

Arguments

  • block data block containing storage for the node's attributes

Return Value

  • the dropoff rate for the fluid emitter.

double MPxFluidEmitterNode:: turbulence ( MDataBlock & block )

Description

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.

Arguments

  • block data block containing storage for the node's attributes

Return Value

  • the turbulence value for the fluid emitter.

bool MPxFluidEmitterNode:: fluidJitter ( MDataBlock & block )

Description

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.

Arguments

  • block data block containing storage for the node's attributes

Return Value

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

This class has no child classes.


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