OpenMayaUI.MPxLocatorNode Class Reference

Class Description

Base class for user defined locators.

Method resolution order:
-   MPxLocatorNode
-   OpenMaya.MPxNode
-   __builtin__.object
+ Inheritance diagram for OpenMayaUI.MPxLocatorNode:

Public Member Functions

__init__ ()
 
boundingBox ()
 
closestPoint ()
 
color ()
 
colorRGB ()
 
draw ()
 
drawLast ()
 
excludeAsLocator ()
 
getShapeSelectionMask ()
 
isBounded ()
 
isTransparent ()
 
useClosestPointForSelection ()
 
__init__ ()
 
boundingBox ()
 
closestPoint ()
 
color ()
 
colorRGB ()
 
draw ()
 
drawLast ()
 
excludeAsLocator ()
 
getShapeSelectionMask ()
 
isBounded ()
 
isTransparent ()
 
useClosestPointForSelection ()
 
- Public Member Functions inherited from OpenMaya.MPxNode
__init__ ()
 
addExternalContentForFileAttr ()
 
compute ()
 
connectionBroken ()
 
connectionMade ()
 
copyInternalData ()
 
dependsOn ()
 
doNotWrite ()
 
forceCache ()
 
getExternalContent ()
 
getFilesToArchive ()
 
getInternalValue ()
 
getInternalValueInContext ()
 
internalArrayCount ()
 
isAbstractClass ()
 
isPassiveOutput ()
 
legalConnection ()
 
legalDisconnection ()
 
name ()
 
passThroughToMany ()
 
passThroughToOne ()
 
postConstructor ()
 
postEvaluation ()
 
preEvaluation ()
 
setDependentsDirty ()
 
setDoNotWrite ()
 
setExternalContent ()
 
setExternalContentForFileAttr ()
 
setInternalValue ()
 
setInternalValueInContext ()
 
setMPSafe ()
 
shouldSave ()
 
thisMObject ()
 
type ()
 
typeId ()
 
typeName ()
 

Static Public Attributes

 boundingBoxCenterX = <OpenMaya.MObjectobject>
 
 boundingBoxCenterY = <OpenMaya.MObjectobject>
 
 boundingBoxCenterZ = <OpenMaya.MObjectobject>
 
 center = <OpenMaya.MObjectobject>
 
 instObjGroups = <OpenMaya.MObjectobject>
 
 intermediateObject = <OpenMaya.MObjectobject>
 
 inverseMatrix = <OpenMaya.MObjectobject>
 
 isTemplated = <OpenMaya.MObjectobject>
 
 localPosition = <OpenMaya.MObjectobject>
 
 localPositionX = <OpenMaya.MObjectobject>
 
 localPositionY = <OpenMaya.MObjectobject>
 
 localPositionZ = <OpenMaya.MObjectobject>
 
 localScale = <OpenMaya.MObjectobject>
 
 localScaleX = <OpenMaya.MObjectobject>
 
 localScaleY = <OpenMaya.MObjectobject>
 
 localScaleZ = <OpenMaya.MObjectobject>
 
 matrix = <OpenMaya.MObjectobject>
 
 nodeBoundingBox = <OpenMaya.MObjectobject>
 
 nodeBoundingBoxMax = <OpenMaya.MObjectobject>
 
 nodeBoundingBoxMaxX = <OpenMaya.MObjectobject>
 
 nodeBoundingBoxMaxY = <OpenMaya.MObjectobject>
 
 nodeBoundingBoxMaxZ = <OpenMaya.MObjectobject>
 
 nodeBoundingBoxMin = <OpenMaya.MObjectobject>
 
 nodeBoundingBoxMinX = <OpenMaya.MObjectobject>
 
 nodeBoundingBoxMinY = <OpenMaya.MObjectobject>
 
 nodeBoundingBoxMinZ = <OpenMaya.MObjectobject>
 
 nodeBoundingBoxSize = <OpenMaya.MObjectobject>
 
 nodeBoundingBoxSizeX = <OpenMaya.MObjectobject>
 
 nodeBoundingBoxSizeY = <OpenMaya.MObjectobject>
 
 nodeBoundingBoxSizeZ = <OpenMaya.MObjectobject>
 
 objectColor = <OpenMaya.MObjectobject>
 
 objectGroupColor = <OpenMaya.MObjectobject>
 
 objectGroupId = <OpenMaya.MObjectobject>
 
 objectGroups = <OpenMaya.MObjectobject>
 
 objectGrpCompList = <OpenMaya.MObjectobject>
 
 parentInverseMatrix = <OpenMaya.MObjectobject>
 
 parentMatrix = <OpenMaya.MObjectobject>
 
 underWorldObject = <OpenMaya.MObjectobject>
 
 useObjectColor = <OpenMaya.MObjectobject>
 
 visibility = <OpenMaya.MObjectobject>
 
 worldInverseMatrix = <OpenMaya.MObjectobject>
 
 worldMatrix = <OpenMaya.MObjectobject>
 
 worldPosition = <OpenMaya.MObjectobject>
 
 worldPositionX = <OpenMaya.MObjectobject>
 
 worldPositionY = <OpenMaya.MObjectobject>
 
 worldPositionZ = <OpenMaya.MObjectobject>
 
- Static Public Attributes inherited from OpenMaya.MPxNode
int kAssembly = 22
 
int kBlendShape = 25
 
int kCameraSetNode = 16
 
int kClientDeviceNode = 20
 
int kConstraintNode = 17
 
int kDeformerNode = 2
 
int kDependNode = 0
 
int kEmitterNode = 6
 
int kEvaluatedDirectly = 1
 
int kEvaluatedIndirectly = 0
 
int kFieldNode = 5
 
int kFluidEmitterNode = 13
 
int kGeometryFilter = 24
 
int kHardwareShader = 9
 
int kHwShaderNode = 10
 
int kIkSolverNode = 8
 
int kImagePlaneNode = 14
 
int kLast = 26
 
int kLeaveDirty = 2
 
int kLocatorNode = 1
 
int kManipContainer = 3
 
int kManipulatorNode = 18
 
int kMotionPathNode = 19
 
int kObjectSet = 12
 
int kParticleAttributeMapperNode = 15
 
int kPostEvaluationTypeLast = 3
 
int kSkinCluster = 23
 
int kSpringNode = 7
 
int kSurfaceShape = 4
 
int kThreadedDeviceNode = 21
 
int kTransformNode = 11
 

Additional Inherited Members

- Static Public Member Functions inherited from OpenMaya.MPxNode
addAttribute ()
 
attributeAffects ()
 
inheritAttributesFrom ()
 

Constructor & Destructor Documentation

OpenMayaUI.MPxLocatorNode.__init__ ( )
x.__init__(...) initializes x; see help(type(x)) for signature
OpenMayaUI.MPxLocatorNode.__init__ ( )
x.__init__(...) initializes x; see help(type(x)) for signature

Member Function Documentation

OpenMayaUI.MPxLocatorNode.boundingBox ( )
boundingBox() -> MBoundingBox

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.
OpenMayaUI.MPxLocatorNode.boundingBox ( )
boundingBox() -> MBoundingBox

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.
OpenMayaUI.MPxLocatorNode.closestPoint ( )
closestPoint(rayPoint, rayDir) -> MPoint

Returns the point on the locator, in the locator's local space, which is closest along the specified ray.

By default, the locator's origin (0, 0, 0) is returned.

This is currently only used by Maya during single selection. See useClosestPointForSelection() for further details on that.

* rayPoint (MPoint) - The base point defining the ray in space
* rayDir (MVector) - The ray direction in space
OpenMayaUI.MPxLocatorNode.closestPoint ( )
closestPoint(rayPoint, rayDir) -> MPoint

Returns the point on the locator, in the locator's local space, which is closest along the specified ray.

By default, the locator's origin (0, 0, 0) is returned.

This is currently only used by Maya during single selection. See useClosestPointForSelection() for further details on that.

* rayPoint (MPoint) - The base point defining the ray in space
* rayDir (MVector) - The ray direction in space
OpenMayaUI.MPxLocatorNode.color ( )
color(status) -> int

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.

* displayStatus (int) - display status. See M3dView.displayStatus() for a list of valid status.
OpenMayaUI.MPxLocatorNode.color ( )
color(status) -> int

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.

* displayStatus (int) - display status. See M3dView.displayStatus() for a list of valid status.
OpenMayaUI.MPxLocatorNode.colorRGB ( )
colorRGB(status) -> MColor

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

* displayStatus (int) - display status. See M3dView.displayStatus() for a list of valid status.
OpenMayaUI.MPxLocatorNode.colorRGB ( )
colorRGB(status) -> MColor

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

* displayStatus (int) - display status. See M3dView.displayStatus() for a list of valid status.
OpenMayaUI.MPxLocatorNode.draw ( )
draw(view, path, style, status) -> self

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.

* view (M3dView) - 3D view that is being drawn into.
* path (MDagPath) - to the parent (transform node) of this locator in the DAG.
If there is a shape node parented directly beneath the transform node, you can access it 
by calling MDagPath.extendToShape(). 
* style (int) - style to draw object in. See M3dView.displayStyle() for a list of valid styles.
* status (int) - selection status of object. See M3dView.displayStatus() for a list of valid status.
OpenMayaUI.MPxLocatorNode.draw ( )
draw(view, path, style, status) -> self

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.

* view (M3dView) - 3D view that is being drawn into.
* path (MDagPath) - to the parent (transform node) of this locator in the DAG.
If there is a shape node parented directly beneath the transform node, you can access it 
by calling MDagPath.extendToShape(). 
* style (int) - style to draw object in. See M3dView.displayStyle() for a list of valid styles.
* status (int) - selection status of object. See M3dView.displayStatus() for a list of valid status.
OpenMayaUI.MPxLocatorNode.drawLast ( )
drawLast() -> bool

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 True.
OpenMayaUI.MPxLocatorNode.drawLast ( )
drawLast() -> bool

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 True.
OpenMayaUI.MPxLocatorNode.excludeAsLocator ( )
excludeAsLocator() -> bool

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.
OpenMayaUI.MPxLocatorNode.excludeAsLocator ( )
excludeAsLocator() -> bool

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.
OpenMayaUI.MPxLocatorNode.getShapeSelectionMask ( )
getShapeSelectionMask() -> MSelectionMask

This routine can be overridden to provide information aboutthe selection mask of the locator. By default the selection maskfor locators is returned.
OpenMayaUI.MPxLocatorNode.getShapeSelectionMask ( )
getShapeSelectionMask() -> MSelectionMask

This routine can be overridden to provide information aboutthe selection mask of the locator. By default the selection maskfor locators is returned.
OpenMayaUI.MPxLocatorNode.isBounded ( )
isBounded() -> bool

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.
OpenMayaUI.MPxLocatorNode.isBounded ( )
isBounded() -> bool

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.
OpenMayaUI.MPxLocatorNode.isTransparent ( )
isTransparent() -> bool

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.
OpenMayaUI.MPxLocatorNode.isTransparent ( )
isTransparent() -> bool

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.
OpenMayaUI.MPxLocatorNode.useClosestPointForSelection ( )
useClosestPointForSelection() -> bool

Determines whether Maya should call closestPoint() when doing single selection.

When doing single selection Maya generally chooses the object closest to the selection ray. For locators it first does a hit test by calling the locator's draw method to determine if any part of it lies within the selection box. If the hit test succeeds Maya will add the locator to the list of objects being considered for selection and will use the center of the locator (i.e. its local origin) in determining its distance from the selection ray. This works well for locators which mark a single point in space, with no offset, but may not work as well for more complex locators.

If this method is overridden to return True, then rather than using the locator's center to determine its distance from the selection ray, Maya will pass the ray to the closestPoint() method and use the point it returns. Note that you will have override closestPoint() as well to provide an appropriate point.
OpenMayaUI.MPxLocatorNode.useClosestPointForSelection ( )
useClosestPointForSelection() -> bool

Determines whether Maya should call closestPoint() when doing single selection.

When doing single selection Maya generally chooses the object closest to the selection ray. For locators it first does a hit test by calling the locator's draw method to determine if any part of it lies within the selection box. If the hit test succeeds Maya will add the locator to the list of objects being considered for selection and will use the center of the locator (i.e. its local origin) in determining its distance from the selection ray. This works well for locators which mark a single point in space, with no offset, but may not work as well for more complex locators.

If this method is overridden to return True, then rather than using the locator's center to determine its distance from the selection ray, Maya will pass the ray to the closestPoint() method and use the point it returns. Note that you will have override closestPoint() as well to provide an appropriate point.