class MPxManipContainer

Jump to documentation

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

Inheritance:

MPxManipContainer < MPxNode

public members:

enum baseType
kFreePointTriadManip
kDirectionManip
kDistanceManip
kPointOnCurveManip
kPointOnSurfaceManip
kDiscManip
kCircleSweepManip
kToggleManip
kStateManip
kCurveSegmentManip
MPxManipContainer ()
virtual ~MPxManipContainer ()
virtual MPxNode::Type type () const
static MStatus initialize ()
static MPxManipContainer * newManipulator (const MString &manipName, MObject &manipObject, MStatus *ReturnStatus = NULL)
virtual void draw ( M3dView &view, const MDagPath &path, M3dView::DisplayStyle style, M3dView::DisplayStatus status)
virtual MStatus connectToDependNode (const MObject &dependNode)
virtual MStatus createChildren ()
MDagPath addFreePointTriadManip (const MString &manipName, const MString &pointName)
MDagPath addDirectionManip (const MString &manipName, const MString &directionName)
MDagPath addDistanceManip (const MString &manipName, const MString &distanceName)
MDagPath addPointOnCurveManip (const MString &manipName, const MString &paramName)
MDagPath addPointOnSurfaceManip (const MString &manipName, const MString &paramName)
MDagPath addDiscManip (const MString &manipName, const MString &angleName)
MDagPath addCircleSweepManip (const MString &manipName, const MString &angleName)
MDagPath addToggleManip (const MString &manipName, const MString &toggleName)
MDagPath addStateManip (const MString &manipName, const MString &stateName)
MDagPath addCurveSegmentManip (const MString &manipName, const MString &startParamName, const MString &endParamName)
MDagPath addRotateManip (const MString &manipName, const MString &rotationName)
MDagPath addScaleManip (const MString &manipName, const MString &scaleName)
bool isManipActive (const MFn::Type & manipType, MObject &manipObject)
MStatus finishAddingManips ()
static MStatus addToManipConnectTable ( MTypeId &)
static MStatus removeFromManipConnectTable ( MTypeId &)
virtual MManipData plugToManipConversion ( unsigned int manipIndex )
virtual MManipData manipToPlugConversion ( unsigned int manipIndex )
void addPlugToManipConversion ( unsigned int manipIndex )
unsigned int addManipToPlugConversion ( MPlug &plug )
void addPlugToManipConversionCallback ( unsigned int manipIndex, plugToManipConversionCallback callback)
NO SCRIPT SUPPORT
unsigned int addManipToPlugConversionCallback ( MPlug &plug, manipToPlugConversionCallback callback)
NO SCRIPT SUPPORT
MStatus getConverterManipValue (unsigned int manipIndex, unsigned int &value)
MStatus getConverterManipValue (unsigned int manipIndex, double &value)
MStatus getConverterManipValue (unsigned int manipIndex, double &x, double &y)
MStatus getConverterManipValue (unsigned int manipIndex, MPoint &point)
MStatus getConverterManipValue (unsigned int manipIndex, MVector &vector)
MStatus getConverterManipValue (unsigned int manipIndex, MMatrix &matrix)
MStatus getConverterManipValue (unsigned int manipIndex, MEulerRotation &rotation)
MStatus getConverterManipValue (unsigned int manipIndex, MTransformationMatrix &xform)
MStatus getConverterPlugValue (unsigned int plugIndex, double &value)
MStatus getConverterPlugValue (unsigned int plugIndex, double &x, double &y)
MStatus getConverterPlugValue (unsigned int plugIndex, MPoint &point)
MStatus getConverterPlugValue (unsigned int plugIndex, MVector &vector)
MStatus getConverterPlugValue (unsigned int plugIndex, MMatrix &matrix)
MStatus getConverterPlugValue (unsigned int plugIndex, MEulerRotation &rotation)
virtual MStatus doPress ()
virtual MStatus doDrag ()
virtual MStatus doRelease ()

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

MPxManipContainer is the base class for user defined manipulator containers.
Description

MPxManipContainer is the base class for user-defined container manipulators. This class is derived from MPxNode since manipulators in Maya are dependency nodes.

MPxManipContainer is a container manipulator that has at least one base manipulator. MPxManipContainer has methods for adding the following base manipulators types to the container: FreePointTriadManip, DirectionManip, DistanceManip, PointOnCurveManip, PointOnSurfaceManip, DiscManip, CircleSweepManip, ToggleManip, StateManip, and CurveSegmentManip.

A container manipulator has one converter which is the interface between the container's children manipulators and the node plugs they affect. The values on the converter that are related to children manipulators are called converterManipValues, and the values on the converter that are related to the node plugs are called converterPlugValues.

The conversion between converterManipValues and converterPlugValues are performed through conversion callback methods, except when there is a one-to-one connection between a converterManipValue and a converterPlugValue.

There are two kinds of conversion callback methods: manipToPlug and plugToManip. A plugToManipConversionCallback is used to calculate a converterManipValue from various converterPlugValues. This callback has access to all the converterPlugValues and returns the value of a converterManipValue. A manipToPlugConversionCallback is used to calculate a converterPlugValue from various converterManipValues. This callback has access to all the converterManipValues and returns the value of a converterPlugValue.

In order for an MPxManipContainer to be able to run, the manipulator needs to know that the initialization is finished through the finishAddingManips method.

Functions

MPxManipContainer:: MPxManipContainer ()

Description

Constructor.

MPxManipContainer:: ~MPxManipContainer ()

Description

Destructor.

MPxNode::Type MPxManipContainer:: type () const

Description

This method returns the type of the node.

Return Value

  • MPxNode::kManipContainer

MStatus MPxManipContainer:: initialize ()

Description

This method initializes the manipulator, and should be overriden in user-defined manipulators.

Return Value

  • MS::kSuccess operation successful

MPxManipContainer *MPxManipContainer:: newManipulator ( const MString &manipName, MObject &manipObject, MStatus *ReturnStatus)

Description

This static function is used to create a user-defined manipulator. The manipObject argument is set to the new manipulator node. Note that the manipName argument must be the name of a manipulator derived from MPxManipContainer. Also note that this method creates the newManipulator, but doesn't add it to the DAG. The primary use of this method is in conjunction with MPxSelectionContext::addManipulator, to add user-defined manipulators to a context.

Arguments

  • manipName manipulator name
  • manipObject manipulator object

Return Value

  • the new manipulator

MDagPath MPxManipContainer:: addFreePointTriadManip (const MString &manipName, const MString &pointName)

Description

This method creates a FreePointTriadManip and adds it to the MPxManipContainer container.

Arguments

  • manipName manipulator name
  • pointName point name

Return Value

  • new FreePointTriadManip

MDagPath MPxManipContainer:: addDirectionManip (const MString &manipName, const MString &directionName)

Description

This method creates a DirectionManip and adds it to the MPxManipContainer container.

Arguments

  • manipName manipulator name
  • directionName direction name

Return Value

  • new DirectionManip

MDagPath MPxManipContainer:: addDistanceManip (const MString &manipName, const MString &distanceName)

Description

This method creates a DistanceManip and adds it to the MPxManipContainer container.

Arguments

  • manipName manipulator name
  • distanceName distance name

Return Value

  • new DistanceManip

MDagPath MPxManipContainer:: addPointOnCurveManip (const MString &manipName, const MString &paramName)

Description

This method creates a PointOnCurveManip and adds it to the MPxManipContainer container.

Arguments

  • manipName manipulator name
  • paramName parameter name

Return Value

  • new PointOnCurveManip

MDagPath MPxManipContainer:: addPointOnSurfaceManip (const MString &manipName, const MString &paramName)

Description

This method creates a PointOnSurfaceManip and adds it to the MPxManipContainer container.

Arguments

  • manipName manipulator name
  • paramName parameter name

Return Value

  • new PointOnSurfaceManip

MDagPath MPxManipContainer:: addDiscManip (const MString &manipName, const MString &angleName)

Description

This method creates a DiscManip and adds it to the MPxManipContainer container.

Arguments

  • manipName manipulator name
  • angleName angle name

Return Value

  • new DiscManip

MDagPath MPxManipContainer:: addCircleSweepManip (const MString &manipName, const MString &angleName)

Description

This method creates a CircleSweepManip and adds it to the MPxManipContainer container.

Arguments

  • manipName manipulator name
  • angleName angle name

Return Value

  • new CircleSweepManip

MDagPath MPxManipContainer:: addToggleManip (const MString &manipName, const MString &toggleName)

Description

This method creates a ToggleManip and adds it to the MPxManipContainer container.

Arguments

  • manipName manipulator name
  • toggleName toggle name

Return Value

  • new ToggleManip

MDagPath MPxManipContainer:: addStateManip (const MString &manipName, const MString &stateName)

Description

This method creates a StateManip and adds it to the MPxManipContainer container.

Arguments

  • manipName manipulator name
  • stateName state name

Return Value

  • new StateManip

MDagPath MPxManipContainer:: addCurveSegmentManip (const MString &manipName, const MString &startParamName, const MString &endParamName)

Description

This method creates a CurveSegmentManip and adds it to the MPxManipContainer container.

Arguments

  • manipName manipulator name
  • startParamName start parameter name
  • endParamName end parameter name

Return Value

  • new CurveSegmentManip

MDagPath MPxManipContainer:: addRotateManip (const MString &manipName, const MString &rotationName)

Description

This method creates a rotate manipulator and adds it to the MPxManipContainer container.

Arguments

  • manipName manipulator name
  • rotationName name of the rotation vector

Return Value

  • Dag path to the new rotate manipulator

MDagPath MPxManipContainer:: addScaleManip (const MString &manipName, const MString &scaleName)

Description

This method creates a scale manipulator and adds it to the MPxManipContainer container.

Arguments

  • manipName manipulator name
  • rotationName name of the scale vector

Return Value

  • Dag path to the new scale manipulator

MStatus MPxManipContainer:: finishAddingManips ()

Description

This method should be called from the user-defined manipulator plug-in near the end of the connectToDependNode method so that the converter in the manipulator can be initialized. The converter cannot be initialized until all the connections from the manip values to the plug values have been specified.

Return Value

  • MS::kSuccess operation successful

MStatus MPxManipContainer:: createChildren ()

Description

This method should be overridden in user defined manipulators. This method is called after the user node derived from MPxManipContainer is set up.

MStatus MPxManipContainer:: connectToDependNode (const MObject &node)

Description

This method connects the manipulator to the dependency node. This is a virtual method and needs to be overridden from the plug-in.

Arguments

  • node the node to which the manipulator should be connected

Return Value

  • MS::kSuccess operation successful

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

Description

This method can be overloaded to customize the drawing of the child manipulators. If the default draw is also required, this method should be called from the derived method.

Arguments

  • view the view in which to draw
  • path the current path
  • style the display appearance
  • status the display status

MStatus MPxManipContainer:: addToManipConnectTable ( MTypeId &mid)

Description

This method adds the user defined node as an entry in the manipConnectTable so that when this node is selected the user can use the show manip tool to get the user defined manipulator associated with this node. Note that the name of the manipulator node has to be the name of the plug-in node appended with "Manip".

Arguments

  • mid id of the user defined node

Return Value

  • MS::kSuccess node has been successfully added to the table

MStatus MPxManipContainer:: removeFromManipConnectTable ( MTypeId &id)

Description

This method removes the user defined node entry from the manipConnectTable.

Arguments

  • id id of the user defined node

Return Value

  • MS::kSuccess node has been successfully removed from the table

MManipData MPxManipContainer:: plugToManipConversion ( unsigned int manipIndex )

Description

This virtual method works in conjunction with the addPlugToManipConversion() method. If addPlugToManipConversion() is called successfully, then this method or handler will be invoked to handle the conversion.

Implement this method to handle the the plug to manipulator conversions.

Arguments

  • manipIndex the index of the manipulator component that is being converted. For example scaleCenterIndex of the MFnScaleManip function set.

Return Value

  • MManipData calculated manipulator data

MManipData MPxManipContainer:: manipToPlugConversion ( unsigned int manipIndex )

Description

This virtual method works in conjunction with the addManipToPlugConversion() method. If addManipToPlugConversion() is called successfully, then this method or handler will be invoked to handle the conversion.

Implement this method to handle the the plug to manipulator conversions.

Arguments

  • manipIndex the index of the plug to be converted.

Return Value

  • MManipData calculated manipulator data

void MPxManipContainer:: addPlugToManipConversion ( unsigned int manipIndex )

Description

This method adds a plug to manipulator converter. The converter must be implemented in the plugToManipConversion() virtual method of this class.

NOTE: The conversion methods and callback methods of this class should not be mixed. The conversion methods are: addManipToPlugConversion(), addManipToPlugConversion() The callback methods are: addPlugToManipConversionCallback() addManipToPlugConversionCallback()

Arguments

  • manipIndex the index of the manipulator component that will be converted

unsigned int MPxManipContainer:: addManipToPlugConversion ( MPlug &plug )

Description

This method adds a manipulator to plug converter. The converter must be implemented in the manipToPlugConversion() virtual method of this class.

NOTE: The conversion methods and callback methods of this class should not be mixed. The conversion methods are: addManipToPlugConversion(), addManipToPlugConversion() The callback methods are: addPlugToManipConversionCallback() addManipToPlugConversionCallback()

Arguments

  • plug the plug that is to be converted

Return Value

  • index The index of the plug to be manipulated

void MPxManipContainer:: addPlugToManipConversionCallback ( unsigned int manipIndex, plugToManipConversionCallback callback)

Description

This method adds a callback that calculates a converterManipValue from converterPlugValues. The callback accesses converterPlugValues and returns the value of a converterManipValue.

NOTE: The conversion methods and callback methods of this class should not be mixed. The conversion methods are: addManipToPlugConversion(), addManipToPlugConversion() The callback methods are: addPlugToManipConversionCallback() addManipToPlugConversionCallback()

Arguments

  • manipIndex the index of the converterManipValue for which the callback will be registered
  • callback the callback that calculates a converterManipValue at the specified index from converterPlugValues

unsigned int MPxManipContainer:: addManipToPlugConversionCallback ( MPlug &plug, manipToPlugConversionCallback callback)

Description

This method adds a callback that calculates a converterPlugValue from converterManipValues. The callback accesses converterManipValues and returns the value of a converterPlugValue.

NOTE: The conversion methods and callback methods of this class should not be mixed. The conversion methods are: addManipToPlugConversion(), addManipToPlugConversion() The callback methods are: addPlugToManipConversionCallback() addManipToPlugConversionCallback()

Arguments

  • plug the plug for which the callback will be registered
  • callback the callback that calculates a converterPlugValue for the specified plug from converterManipValues

Return Value

  • plugIndex the index of the converterPlugValue that corresponds to the plug for which the callback was registered

MStatus MPxManipContainer:: getConverterManipValue (unsigned int manipIndex, unsigned int &value)

Description

This method retrieves the value of a converterManipValue of type unsigned int at a given index from the converter.

Arguments

  • manipIndex the index of the converterManipValue
  • value the value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxManipContainer:: getConverterManipValue (unsigned int manipIndex, double &value)

Description

This method retrieves the value of a converterManipValue of type double at a given index from the converter.

Arguments

  • manipIndex the index of the converterManipValue
  • value the value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxManipContainer:: getConverterManipValue (unsigned int manipIndex, double &x, double &y)

Description

This method retrieves the x and y values of a converterManipValue of type double at a given index from the converter.

Arguments

  • manipIndex the index of the converterManipValue
  • x the x value at the specified index
  • y the y value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxManipContainer:: getConverterManipValue (unsigned int manipIndex, MPoint &point)

Description

This method retrieves the value of a converterManipValue of type MPoint at a given index from the converter.

Arguments

  • manipIndex the index of the converterManipValue
  • point the value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxManipContainer:: getConverterManipValue (unsigned int manipIndex, MVector &vector)

Description

This method retrieves the value of a converterManipValue of type MVector at a given index from the converter.

Arguments

  • manipIndex the index of the converterManipValue
  • vector the value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxManipContainer:: getConverterManipValue (unsigned int manipIndex, MMatrix &matrix)

Description

This method retrieves the value of a converterManipValue of type MMatrix at a given index from the converter.

Arguments

  • manipIndex the index of the converterManipValue
  • matrix the value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxManipContainer:: getConverterManipValue (unsigned int manipIndex, MEulerRotation &rotation)

Description

This method retrieves the value of a converterManipValue of type MEulerRotation at a given index from the converter.

Arguments

  • manipIndex the index of the converterManipValue
  • rotation the value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxManipContainer:: getConverterManipValue (unsigned int manipIndex, MTransformationMatrix &xform)

Description

This method retrieves the value of a converterManipValue of type MTransformationMatrix at a given index from the converter.

Arguments

  • manipIndex the index of the converterManipValue
  • xform the value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxManipContainer:: getConverterPlugValue (unsigned int plugIndex, double &value)

Description

This method retrieves the value of a converterPlugValue of type double at a given index from the converter.

Arguments

  • plugIndex the index of the converterPlugValue
  • value the value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxManipContainer:: getConverterPlugValue (unsigned int plugIndex, double &x, double &y)

Description

This method retrieves the x and y values of a converterPlugValue of type double at a given index from the converter.

Arguments

  • plugIndex the index of the converterPlugValue
  • x the x value at the specified index
  • y the y value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxManipContainer:: getConverterPlugValue (unsigned int plugIndex, MPoint &point)

Description

This method retrieves the value of a converterPlugValue of type MPoint at a given index from the converter.

Arguments

  • plugIndex the index of the converterPlugValue
  • point the value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxManipContainer:: getConverterPlugValue (unsigned int plugIndex, MVector &vector)

Description

This method retrieves the value of a converterPlugValue of type MVector at a given index from the converter.

Arguments

  • plugIndex the index of the converterPlugValue
  • vector the value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxManipContainer:: getConverterPlugValue (unsigned int plugIndex, MMatrix &matrix)

Description

This method retrieves the value of a converterPlugValue of type MMatrix at a given index from the converter.

Arguments

  • plugIndex the index of the converterPlugValue
  • matrix the value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

MStatus MPxManipContainer:: getConverterPlugValue (unsigned int plugIndex, MEulerRotation &rotation)

Description

This method retrieves the value of a converterPlugValue of type MEulerRotation at a given index from the converter.

Arguments

  • plugIndex the index of the converterPlugValue
  • rotation the value at the specified index

Return Value

  • MS::kSuccess operation successful
  • MS::kFailure operation failed

bool MPxManipContainer:: isManipActive (const MFn::Type & manipType, MObject &manipObject)

Description

This method determines if custom manip is active & gets the current manip object.

Arguments

  • manipType the type of the custom manip
  • manipObject manupulator object

Return Value

  • true custom manip is active
  • false custom manip is inactive

MStatus MPxManipContainer:: doPress ()

Description

This method gets called when the manipulator recieves a mouse down event.

You should return kUnkownParameter to specify that maya should handle this connection or if you want maya to process the connection as well.

Return Value

  • Status code

Status Codes

  • MS::kSuccess Operation successful
  • MS::kUnknownParameter Allow Maya to process event

MStatus MPxManipContainer:: doDrag ()

Description

This method gets called when the manipulator recieves a mouse drag event.

You should return kUnkownParameter to specify that maya should handle this connection or if you want maya to process the connection as well.

Return Value

  • Status code

Status Codes

  • MS::kSuccess Operation successful
  • MS::kUnknownParameter Allow Maya to process event

MStatus MPxManipContainer:: doRelease ()

Description

This method gets called when the manipulator recieves a mouse release event.

You should return kUnkownParameter to specify that maya should handle this connection or if you want maya to process the connection as well.

Return Value

  • Status code

Status Codes

  • MS::kSuccess Operation successful
  • MS::kUnknownParameter Allow Maya to process event

This class has no child classes.


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