class MPxLocatorNode

Jump to documentation

: public MPxNode Base class for user defined locators (OpenMayaUI) (OpenMayaMPx.py)

Inheritance:

MPxLocatorNode < MPxNode

public members:

MPxLocatorNode ()
virtual ~MPxLocatorNode ()
virtual MPxNode::Type type () const
virtual void draw ( M3dView & view, const MDagPath & path, M3dView::DisplayStyle style, M3dView:: DisplayStatus )
virtual bool isBounded () const
virtual MBoundingBox boundingBox () const
unsigned int color ( M3dView::DisplayStatus displayStatus )
MColor colorRGB ( M3dView::DisplayStatus displayStatus )
virtual bool excludeAsLocator () const
virtual bool isTransparent () const
virtual bool drawLast () const
static MObject underWorldObject
under world attribute
static MObject localPosition
local position attribute
static MObject localPositionX
X component of localPosition
static MObject localPositionY
Y component of localPosition
static MObject localPositionZ
Z component of localPosition
static MObject worldPosition
world position attribute
static MObject worldPositionX
X component of worldPosition
static MObject worldPositionY
Y component of worldPosition
static MObject worldPositionZ
Z component of worldPosition
static MObject localScale
local scale attribute
static MObject localScaleX
X component of localScale
static MObject localScaleY
Y component of localScale
static MObject localScaleZ
Z component of localScale
static MObject nodeBoundingBox
bounding box attribute
static MObject nodeBoundingBoxMin
bounding box minimum point
static MObject nodeBoundingBoxMinX
X component of boundingBoxMin
static MObject nodeBoundingBoxMinY
Y component of boundingBoxMin
static MObject nodeBoundingBoxMinZ
Z component of boundingBoxMin
static MObject nodeBoundingBoxMax
bounding box maximum point
static MObject nodeBoundingBoxMaxX
X component of boundingBoxMax
static MObject nodeBoundingBoxMaxY
Y component of boundingBoxMax
static MObject nodeBoundingBoxMaxZ
Z component of boundingBoxMax
static MObject nodeBoundingBoxSize
bounding box size vector
static MObject nodeBoundingBoxSizeX
X component of boundingBoxSize
static MObject nodeBoundingBoxSizeY
Y component of boundingBoxSize
static MObject nodeBoundingBoxSizeZ
Z component of boundingBoxSize
static MObject center
object center attribute
static MObject boundingBoxCenterX
X component of boundingBoxCenter
static MObject boundingBoxCenterY
Y component of boundingBoxCenter
static MObject boundingBoxCenterZ
Z component of boundingBoxCenter
static MObject matrix
matrix attribute
static MObject inverseMatrix
inverse matrix attribute
static MObject worldMatrix
world matrix attribute
static MObject worldInverseMatrix
inverse world matrix attribute
static MObject parentMatrix
parent matrix attribute
static MObject parentInverseMatrix
inverse parent matrix attribute
static MObject visibility
visibility attribute
static MObject intermediateObject
intermediate object attribute
static MObject isTemplated
template attribute
static MObject instObjGroups
instances object group info attribute
static MObject objectGroups
object groups attributes
static MObject objectGrpCompList
component in object groups attribute
static MObject objectGroupId
group id attribute
static MObject objectGroupColor
group id attribute
static MObject useObjectColor
controls choice of wireframe dormant object color
static MObject objectColor
the per object dormant wireframe color

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

Create user defined locators.
Description

MPxLocatorNode allows the creation of user-defined locators. A locator is a DAG shaped that is drawn on the screen, but that has is not rendered. Locators are full dependency nodes and can have attributes and a compute method.

To create a locator, derive off of this class and override the draw method. The draw method can be overridden to draw custom geometry using standard OpenGL calls. The other methods of the parent class MPxNode may also be overridden to perform dependency node capabilities as well.

Functions

MPxLocatorNode:: MPxLocatorNode ()
Constructor

Class constructor.

MPxLocatorNode:: ~MPxLocatorNode ()
Destructor

Class destructor.

MPxNode::Type MPxLocatorNode:: type () const

Description

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

Return Value

  • the type of node

Status Codes

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

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

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 locator, 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 locator in the DAG
  • style style to draw object in
  • status selection status of object

bool MPxLocatorNode:: isBounded () const

Description

This method should be overridden to return true if the user supplies a bounding box routine. Supplying a bounding box routine makes refresh and selection more efficient.

Return Value

  • a boolean value indicating whether a bounding box routine has been supplied

MBoundingBox MPxLocatorNode:: boundingBox () const

Description

This method should be overridden to return a bounding box for the locator. If this method is overridden, then MPxLocatorNode::isBounded should also be overridden to return true.

Return Value

  • the bounding box of the locator

unsigned int MPxLocatorNode:: color ( M3dView::DisplayStatus displayStatus )

Description

This method returns the index of the color that is the default draw color for the given display status. The index should be used with the methods of M3dView. The value is not an index into the OpenGL color table.

The index that is returned will be into the active, dormant, or template color tables depending on the display status passed in.

Arguments

  • displayStatus display status

Return Value

  • the index of the color

MColor MPxLocatorNode:: colorRGB ( M3dView::DisplayStatus displayStatus )

Description

This method returns the RGB values of the default draw color for the given display status.

Arguments

  • displayStatus display status

Return Value

  • the color

bool MPxLocatorNode:: isTransparent () const

Description

Indicates that this locator uses transparency during ::draw method calls. Objects with transparency must be drawn in a special queue, i.e. after all opaque objects are drawn.

The default return value is false.

Return Value

  • true, the locator draw method will be called during the transparency pass.

bool MPxLocatorNode:: drawLast () const

Description

Indicates that this locator should be the last item draw in a given refresh cycle. Objects drawn out-of-order will not preserve the proper transparency sorting. Conflicts among multiple objects with the drawLast indicator set to TRUE will be resolved by their order in the Outliner, where they will be drawn top-to-bottom.

The default return value is false.

Return Value

  • true, the locator will be drawn after all other objects in the scene.

bool MPxLocatorNode:: excludeAsLocator () const

Description

When the modelPanel is set to not draw locators, returing true will also not draw the custom locator. If false is returned, the custom locator will also be drawn.

The default return value is true.

Return Value

  • true if the custom locator should be treated like a standard maya locator.

This class has no child classes.


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