class MPxComponentShape

Jump to documentation

: public MPxSurfaceShape Component helper class for surface shapes. (OpenMaya) (OpenMayaMPx.py)

Inheritance:

MPxComponentShape < MPxSurfaceShape < MPxNode

public members:

virtual void transformUsing ( const MMatrix & matrix, const MObjectArray & componentList )
virtual void transformUsing ( const MMatrix & mat, const MObjectArray & componentList, MPxSurfaceShape::MVertexCachingMode cachingMode, MPointArray * pointCache)
virtual void componentToPlugs ( MObject & component, MSelectionList & list ) const
virtual bool match ( const MSelectionMask & mask, const MObjectArray & componentList ) const
virtual MObject createFullVertexGroup () const
virtual MObject localShapeInAttr () const
MVectorArray * getControlPoints ()
MStatus setControlPoints ( MVectorArray * cps )

Inherited from MPxSurfaceShape:

public members:

virtual MPxNode::Type type () const
virtual bool isBounded () const
virtual MBoundingBox boundingBox () const
enum MVertexCachingMode
kNoPointCaching
no point caching
kSavePoints
points should be saved for undo in the point cache
kRestorePoints
points should be restored from the point cache
kUpdatePoints
update the points
virtual void transformUsing ( const MMatrix & mat, const MObjectArray & componentList )
virtual void transformUsing ( const MMatrix & mat, const MObjectArray & componentList, MVertexCachingMode cachingMode, MPointArray * pointCache)
virtual void tweakUsing ( const MMatrix & mat, const MObjectArray & componentList, MVertexCachingMode cachingMode, MPointArray * pointCache, MArrayDataHandle & handle )
bool convertToTweakNodePlug ( MPlug & plug) const
enum MVertexOffsetMode
kNormal
move in normal direction
kUTangent
move in u tangent direction
kVTangent
move in v tangent direction
kUVNTriad
calculate u, v, and normal offsets
virtual bool vertexOffsetDirection ( MObject & component, MVectorArray & direction, MVertexOffsetMode mode, bool normalize )
virtual MObject newControlPointComponent ( ) const
virtual void componentToPlugs ( MObject & component, MSelectionList & selectionList ) const
virtual bool match ( const MSelectionMask & mask, const MObjectArray & componentList ) const
enum MatchResult
kMatchOk
kMatchNone
kMatchTooMany
kMatchInvalidName
kMatchInvalidAttribute
kMatchInvalidAttributeIndex
kMatchInvalidAttributeRange
kMatchInvalidAttributeDim
virtual MatchResult matchComponent ( const MSelectionList & item, const MAttributeSpecArray & spec, MSelectionList & list )
virtual MObject createFullVertexGroup () const
virtual bool deleteComponents ( const MObjectArray & componentList, MDoubleArray & undoInfo )
virtual bool undeleteComponents ( const MObjectArray & componentList, MDoubleArray & undoInfo )
virtual MObject localShapeInAttr () const
virtual MObject localShapeOutAttr () const
virtual MObject worldShapeOutAttr () const
virtual MObject cachedShapeAttr () const
virtual MObject geometryData () const
virtual void closestPoint ( const MPoint & toThisPoint, MPoint & theClosestPoint, double tolerance )
virtual bool pointAtParm ( const MPoint & atThisParm, MPoint & evaluatedPoint )
virtual MPxGeometryIterator * geometryIteratorSetup ( MObjectArray &, MObject &, bool forReadOnly = false )
virtual bool acceptsGeometryIterator ( bool writeable=true )
virtual bool acceptsGeometryIterator ( MObject &, bool writeable=true, bool forReadOnly = false)
MObjectArray activeComponents () const
bool hasActiveComponents () const
enum MChildChanged
kObjectChanged
kBoundingBoxChanged
void childChanged ( MChildChanged = kObjectChanged )
bool isRenderable () const
void setRenderable ( bool )
MMatrix getWorldMatrix ( MDataBlock &, unsigned int ) const
static MObject mHasHistoryOnCreate
static MObject mControlPoints
static MObject mControlValueX
static MObject mControlValueY
static MObject mControlValueZ
static MObject nodeBoundingBox
static MObject nodeBoundingBoxMin
static MObject nodeBoundingBoxMinX
static MObject nodeBoundingBoxMinY
static MObject nodeBoundingBoxMinZ
static MObject nodeBoundingBoxMax
static MObject nodeBoundingBoxMaxX
static MObject nodeBoundingBoxMaxY
static MObject nodeBoundingBoxMaxZ
static MObject nodeBoundingBoxSize
static MObject nodeBoundingBoxSizeX
static MObject nodeBoundingBoxSizeY
static MObject nodeBoundingBoxSizeZ
static MObject center
static MObject boundingBoxCenterX
static MObject boundingBoxCenterY
static MObject boundingBoxCenterZ
static MObject matrix
static MObject inverseMatrix
static MObject worldMatrix
static MObject worldInverseMatrix
static MObject parentMatrix
static MObject parentInverseMatrix
static MObject visibility
static MObject intermediateObject
static MObject isTemplated
static MObject instObjGroups
static MObject objectGroups
static MObject objectGrpCompList
static MObject objectGroupId
static MObject objectGroupColor
static MObject useObjectColor
static MObject objectColor

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

Component helper class for surface shapes. (OpenMaya) (OpenMayaMPx.py)
Description

MPxComponentShape allows the implementation of new user defined shapes using components. User defined shapes are dependency nodes (and DAG nodes) which contain overridable drawing, selection, and component methods. This class provides enhanced functionality for working with components. As a result, it is a better starting point than MPxSurfaceShape for writing surface shape components.

This class provides methods to manipulate and select the components that make up the shape.

The UI dependent aspects of the shape should be implemented in a class derived from MPxSurfaceShapeUI. This includes the drawing and interactive selection of the shape.

Functions

void MPxComponentShape:: transformUsing ( const MMatrix & matrix, const MObjectArray & componentList )

Description

Transform the given components using the specified transformation matrix. This method should be overridden if the shape supports components that can be transformed using maya's move, scale, and rotate tools.

Arguments

  • matrix the matrix representing the transformation that is to be applied to the components
  • componentList a list of components to be tranformed

void MPxComponentShape:: transformUsing ( const MMatrix & mat, const MObjectArray & componentList, MPxSurfaceShape::MVertexCachingMode cachingMode, MPointArray * pointCache)

Description

Transform the given components using the specified transformation matrix. This method should be overridden if the shape supports components that can be transformed using maya's move, scale, and rotate tools.

Arguments

  • mat the matrix representing the transformation that is to be applied to the components
  • componentList a list of components to be tranformed. If the list is empty, it indicates that every point in the geometry should be transformed.
  • cachingMode whether the points should be cached in the pointCache argument, or restored from the pointCache.
  • pointCache used to store for undo and restore points during undo

void MPxComponentShape:: componentToPlugs ( MObject & component, MSelectionList & list ) const

Description

Converts the given component into a selection list of plugs. This method is used to associate a shapes components into the corresponding attributes (plugs) within the shape.

Arguments

  • component the component to be converted
  • list a selection list where the plug should be added

bool MPxComponentShape:: match ( const MSelectionMask & mask, const MObjectArray & componentList ) const

Description

This method is used to check for matches between a selection type (or mask) and a given component. This method is used to match up your components with selection masks.

This is used by sets and deformers to make sure that the selected components fall into the "vertex only" category. This is useful when you want to make sure that only a particular component can be deformed.

Arguments

  • mask the selection mask to test against
  • componentList a list of components to be tested

Return Value

  • true the match was successfull
  • false the match failed

MObject MPxComponentShape:: createFullVertexGroup () const

Description

This method is used to create a component containing every vertex/CV in the object.

This method is supposed to return non-NULL only if the dag object contains vertices/CVs (control points), so derived classes that do should override this method.

Eg: use MFnSingleIndexedComponent::setCompleteData( numVertices ) to specify that a component represents all the vertices of the shape.

Return Value

  • A component containing all of the vertices in the shape.

MObject MPxComponentShape:: localShapeInAttr () const

Description

Returns the input attribute of the shape, which are the control points.

Return Value

  • the input attribute

MVectorArray * MPxComponentShape:: getControlPoints ()

Description

Extract the control points from the data block and store them locally.

Return Value

  • the contol points

MStatus MPxComponentShape:: setControlPoints ( MVectorArray * cps )

Description

Push the given control points into the node's data block

Arguments

  • cps the control points to use

This class has no child classes.


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