class MPxSpringNode

Jump to documentation

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

Inheritance:

MPxSpringNode < MPxNode

public members:

MPxSpringNode ()
virtual ~MPxSpringNode ()
virtual MPxNode::Type type () const
virtual MStatus applySpringLaw ( double stiffness, double damping, double restLength, double endMass1, double endMass2, const MVector &endP1, const MVector &endP2, const MVector &endV1, const MVector &endV2, MVector &forceV1, MVector &forceV2 )
static MObject mEnd1Weight
from end weight attribute
static MObject mEnd2Weight
to end weight attribute
static MObject mDeltaTime
delta time attribute

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 spring law (OpenMayaFX) (OpenMayaMPx.py)
Description
MPxSpringNode allows the creation and manipulation of dependency graph nodes representing a spring law. The class is a DAG node and Maya manages the drawing, creation, and selection of springs.

A user defined spring node is a DAG node that can have attributes and a applySpringLaw() method. To derive the full benefit of the MPxSpringNode class, it is suggested that you do not write your own compute() method. Instead, write the applySpringLaw() method. All of the parameters passed into this method will be supplied by Maya.

To create a user defined spring node, derive from this class and override the applySpringLaw() method. The other methods of the parent class MPxNode may also be overridden to perform dependency node capabilities.

Functions

MPxSpringNode:: MPxSpringNode ()

Constructor

Class constructor.

MPxSpringNode:: ~MPxSpringNode ()
Destructor

Class destructor.

MPxNode::Type MPxSpringNode:: type () const

Description

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

Return Value

  • the type of node

Status Codes

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

MStatus MPxSpringNode:: applySpringLaw ( double stiffness, double damping, double restLength, double endMass1, double endMass2, const MVector &endP1, const MVector &endP2, const MVector &endV1, const MVector &endV2, MVector &forceV1, MVector &forceV2 )
Description

This method should be overridden in user defined nodes.

Arguments

  • stiffness The strength with which springs are trying to maintain their length.
  • damping How strongly the motion of springs are damped by the 'physical' properties of the springs. A larger value makes the springs converge faster to their rest length.
  • restLength The length at which springs try to stay.
  • endMass1 The mass value at one end of the spring.
  • endMass2 The mass value at the other end of the spring.
  • endP1 The position of one end of the spring.
  • endP2 The position of the other end of the spring.
  • endV1 The velocity of one end of the spring.
  • endV2 The velocity of the other end of the spring.
  • forceV1 The output force vector at one end of the spring.
  • forceV2 The output force vector at the other end of the spring.

Return Value

  • Status code

Status Codes

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

This class has no child classes.


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