class MPxFieldNode

Jump to documentation

: public MPxNode Base class for user defined fields (OpenMayaFX) (OpenMayaMPx.py)

Inheritance:

MPxFieldNode < MPxNode

public members:

MPxFieldNode ()
virtual ~MPxFieldNode ()
virtual MPxNode::Type type () const
virtual MStatus compute ( const MPlug & plug, MDataBlock & dataBlock )
virtual MStatus getForceAtPoint (const MVectorArray & point, const MVectorArray & velocity, const MDoubleArray & mass, MVectorArray & force, double deltaTime)
virtual MStatus iconSizeAndOrigin ( GLuint& width, GLuint& height, GLuint& xbo, GLuint& ybo )
virtual MStatus iconBitmap (GLubyte* bitmap)
static MObject mMagnitude
magnitude attribute
static MObject mAttenuation
attenuation attribute
static MObject mMaxDistance
maximum distance attribute
static MObject mUseMaxDistance
flag for maximum distance attribute
static MObject mApplyPerVertex
flag for per vertex attribute
static MObject mInputData
input attribute compound, multi
static MObject mInputPositions
child attribute, multi
static MObject mInputVelocities
child attribute, multi
static MObject mInputMass
child attribute, multi
static MObject mDeltaTime
child attribute
static MObject mInputForce
forces input attribute, multi
static MObject mOutputForce
forces output attribute, multi
static MObject mOwnerCentroidX
X component of mOwnerCentroid
static MObject mOwnerCentroidY
Y component of mOwnerCentroid
static MObject mOwnerCentroidZ
Z component of mOwnerCentroid
static MObject mOwnerCentroid
owner centroid attribute
static MObject mOwnerPosData
owner position attribute, multi
static MObject mOwnerVelData
owner velocity attribute, multi
static MObject mWorldMatrix
world matrix attribute
static MObject mInputPPData
Attribute for input pp data from particleShape
static MObject mOwnerPPData
Attribute for input pp data from owner particleShape

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 fields (OpenMayaFX) (OpenMayaMPx.py)
Description
MPxFieldNode allows the creation and manipulation of dependency graph nodes representing fields. This is the top level of a hierarchy of field node function sets. It permits manipulation of the attributes common to all types of fields.

Functions

MPxFieldNode:: MPxFieldNode ()

Constructor

Class constructor.

MPxFieldNode:: ~MPxFieldNode ()
Destructor

The class destructor.

MPxNode::Type MPxFieldNode:: type () const

Description

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

Return Value

  • the type of node

Status Codes

  • MS::kSuccess The undo was successful
  • MS::kFailure This method is not undoable

MStatus MPxFieldNode:: 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 MPxFieldNode:: getForceAtPoint (const MVectorArray & point, const MVectorArray & velocity, const MDoubleArray & mass, MVectorArray & force, double deltaTime)

Description

This method is not required to be overridden, it is only necessary for compatibility with the MFnField function set.

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

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

Return Value

  • Status code

Status Codes

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

MStatus MPxFieldNode:: iconSizeAndOrigin (GLuint& width, GLuint& height, GLuint& xbo, GLuint& ybo )

Description

This method is not required to be overridden. The arguments have the same meaning as defined in OpenGL's glBitmap method.

Define the size and the origin for the icon.

Arguments

  • width the width of the icon in pixels. It needs to be a multiple of 32 on windows and a multiple of 16 on any other platform.
  • height the height of the icon in pixels. It needs to be a multiple of 32 on windows and a multiple of 16 on any other platform.
  • xbo the origin of the icon in x direction.
  • ybo the origin of the icon in y direction.

Return Value

  • Status code

Status Codes

  • MS::kSuccess has custom icon.
  • MS::kFailure no custom icon.

MStatus MPxFieldNode:: iconBitmap (GLubyte* bitmap )

Description

This method is not required to be overridden. The arguments have the same meaning as defined in OpenGL's glBitmap method.

Define the bitmap for the icon. The memory in bitmap has been allocated according to the width and height in iconSizeAndOrigin().

Arguments

  • bitmap bits used to define the bitmap.

Return Value

  • Status code

Status Codes

  • MS::kSuccess has custom icon.
  • MS::kFailure no custom icon.

void MPxFieldNode:: draw ( M3dView & view, const MDagPath & path, M3dView::DisplayStyle style, M3dView:: DisplayStatus )

Description

Overriding this method allows the drawing of custom geometry using standard OpenGL calls. The OpenGL state should be left in the same state that it was in previously. The OpenGL routine glPushAttrib may be used to make this easier.

When this routine is called, the following conditions may be assumed:

  • the correct transform matrix will be loaded for the node, so the geometry should be drawn in local space
  • the correct default color will be set for wire frame drawing given the object's state (eg active, dormant, etc.)
  • the object is not invisible or hidden
  • if the object has a bounding box, then the bounding box is at least partially in the frustum

As a convenience, this draw method will also be used by OpenGL's selection mechanism to determine whether this object gets selected by a particular mouse event. The user does not need to write a separate selection routine.

Arguments

  • view 3D view that is being drawn into
  • path to this node in the DAG
  • style style to draw object in
  • status selection status of object

double MPxFieldNode:: falloffCurve ( const double param, MStatus * ReturnStatus )

Description

Returns falloff given the param in [0,1]. This is enabled if the use the maximum distance is enabled.

Arguments

  • param Parameter
  • ReturnStatus Status code

Return Value

  • The falloff value given the param.

Status Codes

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

bool MPxFieldNode:: isFalloffCurveConstantOne ( MStatus * ReturnStatus )

Description

Returns true if falloffCurve is a constant one (default) or false if not.

Arguments

  • ReturnStatus Status code

Return Value

  • If falloff curve always returns a constant one

Status Codes

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

This class has no child classes.


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