C++ API Reference

Base class for user defined manipulator containers. More...

#include <MPxManipContainer.h>

+ Inheritance diagram for MPxManipContainer:

Public Types

enum  baseType {
  kFreePointTriadManip, kDirectionManip, kDistanceManip, kPointOnCurveManip,
  kPointOnSurfaceManip, kDiscManip, kCircleSweepManip, kToggleManip,
  kStateManip, kCurveSegmentManip, kCustomManip
}
 Built-in manipulator types. More...
 
typedef MManipData(MPxManipContainer::* plugToManipConversionCallback) (unsigned int manipIndex)
 Pointer to a plug-to-manip conversion callback function. More...
 
typedef MManipData(MPxManipContainer::* manipToPlugConversionCallback) (unsigned int plugIndex)
 Pointer to a manip-to-plug conversion callback function. More...
 
- Public Types inherited from MPxNode
enum  Type {
  kDependNode, kLocatorNode, kDeformerNode, kManipContainer,
  kSurfaceShape, kFieldNode, kEmitterNode, kSpringNode,
  kIkSolverNode, kHardwareShader, kHwShaderNode, kTransformNode,
  kObjectSet, kFluidEmitterNode, kImagePlaneNode, kParticleAttributeMapperNode,
  kCameraSetNode, kConstraintNode, kManipulatorNode, kMotionPathNode,
  kClientDeviceNode, kThreadedDeviceNode, kAssembly, kSkinCluster,
  kGeometryFilter, kBlendShape, kLast
}
 Defines the type of node. More...
 
enum  SchedulingType {
  kParallel, kSerial, kGloballySerial, kUntrusted ,
  kDefaultScheduling = kSerial, kSerialize = kSerial, kGloballySerialize = kGloballySerial
}
 Defines the degree of parallelism of a node. More...
 

Public Member Functions

 MPxManipContainer ()
 Constructor.
 
virtual ~MPxManipContainer ()
 Destructor.
 
virtual MPxNode::Type type () const
 This method returns the type of the node. More...
 
virtual void preDrawUI (const M3dView &view)
 This method is not available in Python. More...
 
virtual void drawUI (MHWRender::MUIDrawManager &drawManager, const MHWRender::MFrameContext &frameContext) const
 This method is not available in Python. More...
 
virtual void draw (M3dView &view, const MDagPath &path, M3dView::DisplayStyle style, M3dView::DisplayStatus status)
 This method can be overloaded to customize the drawing of the child manipulators. More...
 
virtual MStatus connectToDependNode (const MObject &dependNode)
 This method connects the manipulator to the dependency node. More...
 
virtual MStatus createChildren ()
 This method should be overridden in user defined manipulators. More...
 
MDagPath addFreePointTriadManip (const MString &manipName, const MString &pointName)
 This method creates a FreePointTriadManip and adds it to the MPxManipContainer container. More...
 
MDagPath addDirectionManip (const MString &manipName, const MString &directionName)
 This method creates a DirectionManip and adds it to the MPxManipContainer container. More...
 
MDagPath addDistanceManip (const MString &manipName, const MString &distanceName)
 This method creates a DistanceManip and adds it to the MPxManipContainer container. More...
 
MDagPath addPointOnCurveManip (const MString &manipName, const MString &paramName)
 This method creates a PointOnCurveManip and adds it to the MPxManipContainer container. More...
 
MDagPath addPointOnSurfaceManip (const MString &manipName, const MString &paramName)
 This method creates a PointOnSurfaceManip and adds it to the MPxManipContainer container. More...
 
MDagPath addDiscManip (const MString &manipName, const MString &angleName)
 This method creates a DiscManip and adds it to the MPxManipContainer container. More...
 
MDagPath addCircleSweepManip (const MString &manipName, const MString &angleName)
 This method creates a CircleSweepManip and adds it to the MPxManipContainer container. More...
 
MDagPath addToggleManip (const MString &manipName, const MString &toggleName)
 This method creates a ToggleManip and adds it to the MPxManipContainer container. More...
 
MDagPath addStateManip (const MString &manipName, const MString &stateName)
 This method creates a StateManip and adds it to the MPxManipContainer container. More...
 
MDagPath addCurveSegmentManip (const MString &manipName, const MString &startParamName, const MString &endParamName)
 This method creates a CurveSegmentManip and adds it to the MPxManipContainer container. More...
 
MDagPath addRotateManip (const MString &manipName, const MString &rotationName)
 This method creates a rotate manipulator and adds it to the MPxManipContainer container. More...
 
MDagPath addScaleManip (const MString &manipName, const MString &scaleName)
 This method creates a scale manipulator and adds it to the MPxManipContainer container. More...
 
MStatus addMPxManipulatorNode (const MString &manipTypeName, const MString &manipName, MPxManipulatorNode *&proxyManip)
 This method creates a custom MPxManipulatorNode and adds it to the MPxManipContainer container. More...
 
bool isManipActive (const MFn::Type &manipType, MObject &manipObject)
 This method determines if custom manip is active & gets the current manip object. More...
 
MStatus finishAddingManips ()
 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. More...
 
virtual MManipData plugToManipConversion (unsigned int manipIndex)
 This virtual method calculates and returns the requested manipulator value, based upon the values of plugs on the nodes being manipulated. More...
 
virtual MManipData manipToPlugConversion (unsigned int manipIndex)
 This virtual method calculates and returns the requested plug value, based upon the container's manipulator values. More...
 
void addPlugToManipConversion (unsigned int manipIndex)
 This method adds a plug to manipulator converter for the specified manipulator value (e.g. More...
 
unsigned int addManipToPlugConversion (MPlug &plug)
 This method adds a manipulator to plug converter for the specified plug. More...
 
void addPlugToInViewEditor (const MPlug &plug)
 Adds a plug to the In-View Editor. More...
 
void addPlugToManipConversionCallback (unsigned int manipIndex, plugToManipConversionCallback callback)
 NO SCRIPT SUPPORT. More...
 
unsigned int addManipToPlugConversionCallback (MPlug &plug, manipToPlugConversionCallback callback)
 NO SCRIPT SUPPORT. More...
 
MStatus getConverterManipValue (unsigned int manipIndex, unsigned int &value)
 This method retrieves the value of a converterManipValue of type unsigned int at a given index from the converter. More...
 
MStatus getConverterManipValue (unsigned int manipIndex, double &value)
 This method retrieves the value of a converterManipValue of type double at a given index from the converter. More...
 
MStatus getConverterManipValue (unsigned int manipIndex, double &x, double &y)
 This method retrieves the x and y values of a converterManipValue of type double at a given index from the converter. More...
 
MStatus getConverterManipValue (unsigned int manipIndex, MPoint &point)
 This method retrieves the value of a converterManipValue of type MPoint at a given index from the converter. More...
 
MStatus getConverterManipValue (unsigned int manipIndex, MVector &vector)
 This method retrieves the value of a converterManipValue of type MVector at a given index from the converter. More...
 
MStatus getConverterManipValue (unsigned int manipIndex, MMatrix &matrix)
 This method retrieves the value of a converterManipValue of type MMatrix at a given index from the converter. More...
 
MStatus getConverterManipValue (unsigned int manipIndex, MEulerRotation &rotation)
 This method retrieves the value of a converterManipValue of type MEulerRotation at a given index from the converter. More...
 
MStatus getConverterManipValue (unsigned int manipIndex, MTransformationMatrix &xform)
 This method retrieves the value of a converterManipValue of type MTransformationMatrix at a given index from the converter. More...
 
MStatus getConverterPlugValue (unsigned int plugIndex, double &value)
 This method retrieves the value of a converterPlugValue of type double at a given index from the converter. More...
 
MStatus getConverterPlugValue (unsigned int plugIndex, double &x, double &y)
 This method retrieves the x and y values of a converterPlugValue of type double at a given index from the converter. More...
 
MStatus getConverterPlugValue (unsigned int plugIndex, MPoint &point)
 This method retrieves the value of a converterPlugValue of type MPoint at a given index from the converter. More...
 
MStatus getConverterPlugValue (unsigned int plugIndex, MVector &vector)
 This method retrieves the value of a converterPlugValue of type MVector at a given index from the converter. More...
 
MStatus getConverterPlugValue (unsigned int plugIndex, MMatrix &matrix)
 This method retrieves the value of a converterPlugValue of type MMatrix at a given index from the converter. More...
 
MStatus getConverterPlugValue (unsigned int plugIndex, MEulerRotation &rotation)
 This method retrieves the value of a converterPlugValue of type MEulerRotation at a given index from the converter. More...
 
virtual MStatus doPress ()
 This method gets called when the manipulator receives a mouse down event. More...
 
virtual MStatus doDrag ()
 This method gets called when the manipulator receives a mouse drag event. More...
 
virtual MStatus doRelease ()
 This method gets called when the manipulator receives a mouse release event. More...
 
virtual MObject thisMObject () const
 Returns the MObject associated with this user defined node. More...
 
- Public Member Functions inherited from MPxNode
 MPxNode ()
 Constructor. More...
 
virtual ~MPxNode ()
 Destructor.
 
virtual void postConstructor ()
 Post constructor. More...
 
virtual MStatus compute (const MPlug &, MDataBlock &)
 This method should be overridden in user defined nodes. More...
 
virtual bool getInternalValue (const MPlug &, MDataHandle &)
 This method is overridden by nodes that store attribute data in some internal format. More...
 
virtual bool setInternalValue (const MPlug &, const MDataHandle &)
 This method is overridden by nodes that store attribute data in some internal format. More...
 
virtual int internalArrayCount (const MPlug &) const
 This method is overridden by nodes that have internal array attributes which are not stored in Maya's datablock. More...
 
virtual void copyInternalData (MPxNode *)
 This method is overridden by nodes that store attribute data in some internal format. More...
 
virtual MStatus legalConnection (const MPlug &, const MPlug &, bool asSrc, bool &isLegal) const
 This method allows you to check for legal connections being made to attributes of this node. More...
 
virtual MStatus legalDisconnection (const MPlug &, const MPlug &, bool asSrc, bool &isLegal) const
 This method allows you to check for legal disconnections being made to attributes of this node. More...
 
virtual MStatus setDependentsDirty (const MPlug &plug, MPlugArray &plugArray)
 This method can be overridden in user defined nodes to specify which plugs should be set dirty based upon an input plug {plugBeingDirtied} which Maya is marking dirty. More...
 
virtual MStatus preEvaluation (const MDGContext &context, const MEvaluationNode &evaluationNode)
 Prepare a node's internal state for threaded evaluation. More...
 
virtual MStatus postEvaluation (const MDGContext &context, const MEvaluationNode &evaluationNode, PostEvaluationType evalType)
 Clean up node's internal state after threaded evaluation. More...
 
virtual SchedulingType schedulingType () const
 When overridden this method controls the degree of parallelism supported by the node during threaded evaluation. More...
 
virtual void getCacheSetup (const MEvaluationNode &, MNodeCacheDisablingInfo &, MNodeCacheSetupInfo &, MObjectArray &) const
 Provide node-specific setup info for the Cached Playback system. More...
 
virtual void configCache (const MEvaluationNode &, MCacheSchema &) const
 Defines the node's behavior when participating in Cached Playback. More...
 
virtual MTimeRange transformInvalidationRange (const MPlug &source, const MTimeRange &input) const
 Override this method to register this node as an Invalidation-Range-Transformation kernel (IRT kernel) An IRT kernel node will change the invalidation time range for its downstream nodes For example, Dynamics-solver will transform invalidation time range [a,b] to [a,+inf) And Clip-Time-Editor will send out the invalidation range for each of the clip [a,b] to ( [t0+a,t0+b] U [t1+a,t1+b] U [t2+a,t2+b] U ... More...
 
bool hasInvalidationRangeTransformation () const
 Checks if this MPxNode derived node overrides the MPxNode::transformInvalidationRange method.
 
virtual MStatus connectionMade (const MPlug &, const MPlug &, bool asSrc)
 This method gets called when connections are made to attributes of this node. More...
 
virtual MStatus connectionBroken (const MPlug &, const MPlug &, bool asSrc)
 This method gets called when connections are broken with attributes of this node. More...
 
virtual MStatus dependsOn (const MPlug &, const MPlug &, bool &depends) const
 This method may be overridden by the user defined node. More...
 
virtual bool isPassiveOutput (const MPlug &) const
 This method may be overridden by the user defined node if it wants to provide output attributes which do not prevent value modifications to the destination attribute. More...
 
virtual MStatus shouldSave (const MPlug &, bool &isSaving)
 This method may be overridden by the user defined node. More...
 
virtual MPlug passThroughToOne (const MPlug &) const
 This method may be overridden by nodes that have a one-to-one relationship between an input attribute and a corresponding output attribute. More...
 
virtual bool passThroughToMany (const MPlug &, MPlugArray &) const
 This method is overridden by nodes that want to control the traversal behavior of some Maya search algorithms which traverse the history/future of shape nodes looking for directly related nodes. More...
 
virtual bool isAbstractClass () const
 Override this class to return true if this node is an abstract node. More...
 
virtual bool isTrackingTopology () const
 Override this class to return true if this node wants to track topology. More...
 
virtual MStringArray getFilesToArchive (bool shortName=false, bool unresolvedName=false, bool markCouldBeImageSequence=false) const
 Use this method to return all external files used by this node. More...
 
virtual void getExternalContent (MExternalContentInfoTable &table) const
 Returns the external content (files) that this node depends on. More...
 
bool addExternalContentForFileAttr (MExternalContentInfoTable &, const MObject &attr) const
 Adds content info to the specified table from a file path attribute. More...
 
bool setExternalContentForFileAttr (const MObject &attr, const MExternalContentLocationTable &)
 Sets content info in the specified attribute from the table. More...
 
virtual void setExternalContent (const MExternalContentLocationTable &)
 Changes the location of external content in batch. More...
 
virtual MTypeId typeId () const
 Returns the TYPEID of this node. More...
 
virtual MString typeName () const
 Returns the type name of this node. More...
 
virtual MString name () const
 Returns the name of this particular instance of this class. More...
 
virtual MStatus setExistWithoutInConnections (bool flag)
 This method specifies whether or not the node can exist without input connections. More...
 
virtual bool existWithoutInConnections (MStatus *ReturnStatus=NULL) const
 Determines whether or not this node can exist without input connections. More...
 
virtual MStatus setExistWithoutOutConnections (bool flag)
 This method specifies whether or not the node can exist without output connections. More...
 
virtual bool existWithoutOutConnections (MStatus *ReturnStatus=NULL) const
 Determines whether or not this node can exist without output connections. More...
 
void _setMPSafe (bool isMPSafe)
 This method is obsolete. More...
 
MDataBlock _forceCache (const MDGContext &)
 This method is obsolete. More...
 
virtual bool getInternalValueInContext (const MPlug &, MDataHandle &, MDGContext &)
 This method is obsolete. More...
 
virtual bool setInternalValueInContext (const MPlug &, const MDataHandle &, MDGContext &)
 This method is obsolete. More...
 
virtual int internalArrayCount (const MPlug &, const MDGContext &) const
 This method is obsolete. More...
 

Static Public Member Functions

static MStatus initialize ()
 This method initializes the manipulator, and should be overriden in user-defined manipulators. More...
 
static MPxManipContainernewManipulator (const MString &manipName, MObject &manipObject, MStatus *ReturnStatus=NULL)
 This static function is used to create a user-defined manipulator. More...
 
static MStatus addToManipConnectTable (MTypeId &)
 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. More...
 
static MStatus removeFromManipConnectTable (MTypeId &)
 This method removes the user defined node entry from the manipConnectTable. More...
 
static const char * className ()
 Returns the name of this class. More...
 
- Static Public Member Functions inherited from MPxNode
static MStatus addAttribute (const MObject &attr)
 This method adds a new attribute to a user defined node type during the type's initialization. More...
 
static MStatus inheritAttributesFrom (const MString &parentClassName)
 This method allows a class of plugin node to inherit all of the attributes of a second class of plugin node. More...
 
static MStatus attributeAffects (const MObject &whenChanges, const MObject &isAffected)
 This method specifies that a particular input attribute affects a specific output attribute. More...
 
static MStatus attributeAffects (const MObject &whenChanges, const MObject &isAffected, bool affectsTopology)
 This method is an extension to the other version of the attributeAffects method. More...
 
static const char * className ()
 Returns the name of this class. More...
 

Additional Inherited Members

- Static Public Attributes inherited from MPxNode
static MObject message
 message attribute
 
static MObject isHistoricallyInteresting
 is historically interesting attribute
 
static MObject caching
 caching attribute
 
static MObject state
 state attribute
 
static MObject frozen
 frozen attribute
 
- Protected Member Functions inherited from MPxNode
virtual MDataBlock forceCache ()
 USE _forceCache() IN SCRIPT. More...
 
virtual MStatus setDoNotWrite (bool flag)
 USE _setDoNotWrite() IN SCRIPT. More...
 
virtual bool doNotWrite (MStatus *ReturnStatus=NULL) const
 USE _doNotWrite() IN SCRIPT. More...
 
virtual void setMPSafe (bool isMPSafe)
 This method is obsolete. More...
 
virtual MDataBlock forceCache (const MDGContext &)
 This method is obsolete. More...
 

Detailed Description

Base class for user defined manipulator containers.

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 Viewport 2.0, all child manipulators will draw automatically. However for custom drawing (things done in the draw() method for the default viewport), the plugin must also implement preDrawUI() and drawUI(). Note that selection relies on the default viewport draw pass so the draw() method must still be implemented even if the manipulator is not intended for use in the default viewport.

preDrawUI() is called before drawUI() and should be used to prepare and cache data which will be needed to perform the custom drawing in drawUI().

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

Examples:
componentScaleManip/componentScaleManip.cpp, customAttrManip/customAttrManip.cpp, footPrintManip/footPrintManip.cpp, lineManipContainer/lineManipContainer.h, manipOverride/customTriadManip.h, manipOverride/manipOverride.cpp, moveManip/moveManip.cpp, rotateManip/rotateManip.cpp, surfaceBumpManip/surfaceBumpManip.cpp, and swissArmyManip/swissArmyManip.cpp.

Member Typedef Documentation

typedef MManipData(MPxManipContainer::* plugToManipConversionCallback) (unsigned int manipIndex)

Pointer to a plug-to-manip conversion callback function.

Parameters
[in]manipIndexIndex of the manipulator value to be calculated.
typedef MManipData(MPxManipContainer::* manipToPlugConversionCallback) (unsigned int plugIndex)

Pointer to a manip-to-plug conversion callback function.

Parameters
[in]plugIndexIndex of the plug value to be calculated.

Member Enumeration Documentation

enum baseType

Built-in manipulator types.

Enumerator
kFreePointTriadManip 

 

kDirectionManip 

 

kDistanceManip 

 

kPointOnCurveManip 

 

kPointOnSurfaceManip 

 

kDiscManip 

 

kCircleSweepManip 

 

kToggleManip 

 

kStateManip 

 

kCurveSegmentManip 

 

kCustomManip 

 

Member Function Documentation

MPxNode::Type type ( ) const
virtual

This method returns the type of the node.

Returns
MPxNode::kManipContainer

Reimplemented from MPxNode.

MPxManipContainer * newManipulator ( const MString manipName,
MObject manipObject,
MStatus ReturnStatus = NULL 
)
static

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.

Parameters
[in]manipNamemanipulator name
[out]manipObjectmanipulator object
[out]ReturnStatusStatus code.
Returns
The new manipulator
void preDrawUI ( const M3dView view)
virtual

This method is not available in Python.

This function is used to setup some drawing data for drawing the manipulator in Viewport 2.0 .

The data updated and cached in this function will be used later during 'drawUI()'.

This method is only called when the manipulator needs to be drawn in Viewport 2.0.

This method needs only be overridden if custom data is needed for drawing in drawUI(). If no such data is needed, this method may be left unimplemented.

This function is empty in this base class.

Parameters
[in]viewthe view in which to draw
Examples:
footPrintManip/footPrintManip.cpp, and swissArmyManip/swissArmyManip.cpp.
void drawUI ( MHWRender::MUIDrawManager drawManager,
const MHWRender::MFrameContext frameContext 
) const
virtual

This method is not available in Python.

This is the primary method for doing custom drawing for the manipulator in Viewport 2.0.

All drawing should occur using the MUIDrawManager and any data cached in preDrawUI(). Raw OpenGL calls are not supported and if used behaviour will be undefined. Selection must still be handled in the draw() method, this method is only for display.

This method is only called when the manipulator needs to be drawn in Viewport 2.0.

We only need to override this function when we have some custom elements to draw other than the child manipulators in Viewport 2.0.

This function is empty in this base class.

Parameters
[in]drawManagerThe draw manager interface for drawing some simple UI
[in]frameContextFrame level context information
Examples:
footPrintManip/footPrintManip.cpp, moveManip/moveManip.cpp, and swissArmyManip/swissArmyManip.cpp.
void draw ( M3dView view,
const MDagPath path,
M3dView::DisplayStyle  style,
M3dView::DisplayStatus  status 
)
virtual

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.

Parameters
[in]viewthe view in which to draw
[in]paththe current path
[in]stylethe display appearance
[in]statusthe display status
Examples:
componentScaleManip/componentScaleManip.cpp, customAttrManip/customAttrManip.cpp, and surfaceBumpManip/surfaceBumpManip.cpp.
MStatus connectToDependNode ( const MObject node)
virtual

This method connects the manipulator to the dependency node.

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

Parameters
[in]nodethe node to which the manipulator should be connected
Returns
MS::kSuccess if successful, an error status otherwise. The base class returns MS::kFailure if there are no connections between manip values and plug values.
Examples:
componentScaleManip/componentScaleManip.cpp, customAttrManip/customAttrManip.cpp, footPrintManip/footPrintManip.cpp, lineManipContainer/lineManipContainer.h, manipOverride/customTriadManip.cpp, manipOverride/customTriadManip.h, manipOverride/manipOverride.cpp, moveManip/moveManip.cpp, rotateManip/rotateManip.cpp, surfaceBumpManip/surfaceBumpManip.cpp, and swissArmyManip/swissArmyManip.cpp.
MDagPath addFreePointTriadManip ( const MString manipName,
const MString pointName 
)

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

Parameters
[in]manipNamemanipulator name
[in]pointNamepoint name
Returns
New FreePointTriadManip
MDagPath addDirectionManip ( const MString manipName,
const MString directionName 
)

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

Parameters
[in]manipNamemanipulator name
[in]directionNamedirection name
Returns
New DirectionManip
MDagPath addDistanceManip ( const MString manipName,
const MString distanceName 
)

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

Parameters
[in]manipNamemanipulator name
[in]distanceNamedistance name
Returns
New DistanceManip
MDagPath addPointOnCurveManip ( const MString manipName,
const MString paramName 
)

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

Parameters
[in]manipNamemanipulator name
[in]paramNameparameter name
Returns
New PointOnCurveManip
MDagPath addPointOnSurfaceManip ( const MString manipName,
const MString paramName 
)

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

Parameters
[in]manipNamemanipulator name
[in]paramNameparameter name
Returns
New PointOnSurfaceManip
MDagPath addDiscManip ( const MString manipName,
const MString angleName 
)

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

Parameters
[in]manipNamemanipulator name
[in]angleNameangle name
Returns
New DiscManip
MDagPath addCircleSweepManip ( const MString manipName,
const MString angleName 
)

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

Parameters
[in]manipNamemanipulator name
[in]angleNameangle name
Returns
New CircleSweepManip
MDagPath addToggleManip ( const MString manipName,
const MString toggleName 
)

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

Parameters
[in]manipNamemanipulator name
[in]toggleNametoggle name
Returns
New ToggleManip
MDagPath addStateManip ( const MString manipName,
const MString stateName 
)

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

Parameters
[in]manipNamemanipulator name
[in]stateNamestate name
Returns
New StateManip
MDagPath addCurveSegmentManip ( const MString manipName,
const MString startParamName,
const MString endParamName 
)

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

Parameters
[in]manipNamemanipulator name
[in]startParamNamestart parameter name
[in]endParamNameend parameter name
Returns
New CurveSegmentManip
MDagPath addRotateManip ( const MString manipName,
const MString rotationName 
)

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

Parameters
[in]manipNamemanipulator name
[in]rotationNamename of the rotation vector
Returns
Dag path to the new rotate manipulator
MDagPath addScaleManip ( const MString manipName,
const MString scaleName 
)

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

Parameters
[in]manipNamemanipulator name
[in]scaleNamename of the scale vector
Returns
Dag path to the new scale manipulator
MStatus addMPxManipulatorNode ( const MString manipTypeName,
const MString manipName,
MPxManipulatorNode *&  proxyManip 
)

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

Parameters
[in]manipTypeNamemanipulator name
[in]manipNamename of the manip
[out]proxyManipreturns a pointer to the new manipulator
Returns
  • MS::kSuccess operation successful
  • MS::kFailure failed to make new manipulator
bool isManipActive ( const MFn::Type manipType,
MObject manipObject 
)

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

Parameters
[in]manipTypethe type of the custom manip
[in]manipObjectmanipulator object
Returns
  • true custom manip is active
  • false custom manip is inactive
MStatus finishAddingManips ( )

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.

Returns
  • MS::kSuccess Operation was successful.
  • MS::kFailure There are no connections between manip values and plug valules.
MStatus addToManipConnectTable ( MTypeId mid)
static

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".

Parameters
[in]midid of the user defined node
Returns
MS::kSuccess if the node has been successfully added to the table.
Examples:
footPrintManip/footPrintManip.cpp, manipOverride/manipOverride.cpp, and swissArmyManip/swissArmyManip.cpp.
MStatus removeFromManipConnectTable ( MTypeId id)
static

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

Parameters
[in]idid of the user defined node
Returns
MS::kSuccess if the node has been successfully removed from the table.
Examples:
manipOverride/manipOverride.cpp.
MManipData plugToManipConversion ( unsigned int  manipIndex)
virtual

This virtual method calculates and returns the requested manipulator value, based upon the values of plugs on the nodes being manipulated.

To use, call addPlugToManipConversion() for each manipulator value (e.g. the start point of a distance manip) you want this method to calculate, then implement this method to calculate those manipulator values. Each manipulator value is identified by the unique index returned by the corresponding method of its functionset (e.g. MFnDistanceManip::startPointIndex).

Parameters
[in]manipIndexthe index of the manipulator value to be calculated
Returns
New manipulator value.
Examples:
componentScaleManip/componentScaleManip.cpp.
MManipData manipToPlugConversion ( unsigned int  plugIndex)
virtual

This virtual method calculates and returns the requested plug value, based upon the container's manipulator values.

To use, call addManipToPlugConversion() for each plug whose value you want this method to calculate then implement this method to calculate those plug values. Each plug is identified by the unique index returned by the addManipToPlugConversion() call.

Parameters
[in]plugIndexthe index of the plug value to be calculated
Returns
New plug value.
Examples:
componentScaleManip/componentScaleManip.cpp.
void addPlugToManipConversion ( unsigned int  manipIndex)

This method adds a plug to manipulator converter for the specified manipulator value (e.g.

the start point of a distance manip). 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()

Parameters
[in]manipIndexthe index of the manipulator value for which the converter is being requested. The index is determined by calling the appropriate method of the manipulator's functionset (e.g. MFnDistanceManip::startPointIndex).
unsigned int addManipToPlugConversion ( MPlug plug)

This method adds a manipulator to plug converter for the specified plug.

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()

Parameters
[in]plugthe plug for which the converter is being requested.
Returns
Index used to identify the plug inside the manipToPlugConversion() method.
void addPlugToInViewEditor ( const MPlug plug)

Adds a plug to the In-View Editor.

The first such call will cause the In-View Editor to be displayed automatically with the custom manip.

Should be called from connectToDependNode().

Parameters
[in]plugThe plug that the slider should control
void addPlugToManipConversionCallback ( unsigned int  manipIndex,
plugToManipConversionCallback  callback 
)

NO SCRIPT SUPPORT.

This method adds a callback which calculates the specified manipulator value (e.g.

the start point of a distance manip) based on the plug values of the nodes being manipulated.

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()

Parameters
[in]manipIndexthe index of the manipulator value for which the callback will be registered. The index is determined by calling the appropriate method of the manipulator's functionset (e.g. MFnDistanceManip::startPointIndex).
[in]callbackthe callback that calculates a converterManipValue at the specified index from converterPlugValues
unsigned int addManipToPlugConversionCallback ( MPlug plug,
manipToPlugConversionCallback  callback 
)

NO SCRIPT SUPPORT.

This method adds a callback that calculates the specified plug value based on the container's manipulator values.

If the same callback is used to calculate several different plug values then the indices returned by this method can be used to distinguish between them.

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()

Parameters
[in]plugthe plug for which the callback will be registered
[in]callbackthe callback that calculates a converterPlugValue for the specified plug from converterManipValues
Returns
Index used to identify the plug in calls to the callback.
MStatus getConverterManipValue ( unsigned int  manipIndex,
unsigned int &  value 
)

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

Parameters
[in]manipIndexthe index of the converterManipValue
[out]valuethe value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getConverterManipValue ( unsigned int  manipIndex,
double &  value 
)

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

Parameters
[in]manipIndexthe index of the converterManipValue
[out]valuethe value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getConverterManipValue ( unsigned int  manipIndex,
double &  x,
double &  y 
)

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

Parameters
[in]manipIndexthe index of the converterManipValue
[out]xthe x value at the specified index
[out]ythe y value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getConverterManipValue ( unsigned int  manipIndex,
MPoint point 
)

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

Parameters
[in]manipIndexthe index of the converterManipValue
[out]pointthe value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getConverterManipValue ( unsigned int  manipIndex,
MVector vector 
)

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

Parameters
[in]manipIndexthe index of the converterManipValue
[out]vectorthe value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getConverterManipValue ( unsigned int  manipIndex,
MMatrix matrix 
)

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

Parameters
[in]manipIndexthe index of the converterManipValue
[out]matrixthe value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getConverterManipValue ( unsigned int  manipIndex,
MEulerRotation rotation 
)

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

Parameters
[in]manipIndexthe index of the converterManipValue
[out]rotationthe value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getConverterManipValue ( unsigned int  manipIndex,
MTransformationMatrix xform 
)

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

Parameters
[in]manipIndexthe index of the converterManipValue
[out]xformthe value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getConverterPlugValue ( unsigned int  plugIndex,
double &  value 
)

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

Parameters
[in]plugIndexthe index of the converterPlugValue
[out]valuethe value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getConverterPlugValue ( unsigned int  plugIndex,
double &  x,
double &  y 
)

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

Parameters
[in]plugIndexthe index of the converterPlugValue
[out]xthe x value at the specified index
[out]ythe y value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getConverterPlugValue ( unsigned int  plugIndex,
MPoint point 
)

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

Parameters
[in]plugIndexthe index of the converterPlugValue
[out]pointthe value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getConverterPlugValue ( unsigned int  plugIndex,
MVector vector 
)

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

Parameters
[in]plugIndexthe index of the converterPlugValue
[out]vectorthe value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getConverterPlugValue ( unsigned int  plugIndex,
MMatrix matrix 
)

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

Parameters
[in]plugIndexthe index of the converterPlugValue
[out]matrixthe value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus getConverterPlugValue ( unsigned int  plugIndex,
MEulerRotation rotation 
)

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

Parameters
[in]plugIndexthe index of the converterPlugValue
[out]rotationthe value at the specified index
Returns
  • MS::kSuccess operation successful
  • MS::kFailure operation failed
MStatus doPress ( )
virtual

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

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

Returns
  • MS::kSuccess Operation successful
  • MS::kUnknownParameter Allow Maya to process event
Examples:
customAttrManip/customAttrManip.cpp.
MStatus doDrag ( )
virtual

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

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

Returns
  • MS::kSuccess Operation successful
  • MS::kUnknownParameter Allow Maya to process event
Examples:
customAttrManip/customAttrManip.cpp.
MStatus doRelease ( )
virtual

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

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

Returns
  • MS::kSuccess Operation successful
  • MS::kUnknownParameter Allow Maya to process event
Examples:
customAttrManip/customAttrManip.cpp.
const char * className ( )
static

Returns the name of this class.

Returns
The name of this class.
MObject thisMObject ( ) const
virtual

Returns the MObject associated with this user defined node.

This makes it possible to use MFnDependencyNode or to construct plugs to this node's attributes.

It is not necessary to override this method.

Returns
MObject handle for this node

Reimplemented from MPxNode.


The documentation for this class was generated from the following files: