#include
<MFnRotateManip.h>
This class provides access to the built-in Maya rotate manipulator. The manipulator consists of three constrained-axis rotation rings, a view rotation ring, as well as an invisible trackball that allows the user to rotate in arbitrary directions on the sphere.
The manipulator provides data to the plugin through the rotation manipVal. The rotation value is a vector consisting of x, y, and z rotations. Rotations are measured from the initial rotation (usually <0,0,0>) of the manipulator.
The manipulator can be configured either to display with an object (which must be a DAG node) or to display at an arbitrary point using the rotationCenter manipVal.
Public Types |
|
enum | RotateMode { kObjectSpace = 0, kWorldSpace, kGimbal } |
Manipulator rotation modes. More... |
|
Public Member Functions |
|
virtual MFn::Type | type () const |
Function set type. |
|
virtual | ~MFnRotateManip () |
Destructor. |
|
MFnRotateManip () | |
Default constructor. |
|
MFnRotateManip (MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. |
|
MFnRotateManip (const MDagPath &object, MStatus *ret=NULL) | |
Constructor. |
|
MObject | create (MStatus *ReturnStatus=NULL) |
MObject | create (const MString &manipName, const MString &rotationName, MStatus *ReturnStatus=NULL) |
MStatus | connectToRotationPlug (const MPlug &rotationPlug) |
MStatus | connectToRotationCenterPlug (const MPlug &rotationCenterPlug) |
MStatus | setInitialRotation (const MEulerRotation &rotation) |
MStatus | displayWithNode (const MObject &node) |
MStatus | setRotateMode (RotateMode mode) |
RotateMode | rotateMode () const |
MStatus | setSnapMode (bool snapEnabled) |
bool | isSnapModeOn () const |
MStatus | setSnapIncrement (double snapInc) |
double | snapIncrement () const |
unsigned int | rotationIndex (MStatus *ReturnStatus=NULL) const |
unsigned int | rotationCenterIndex (MStatus *ReturnStatus=NULL) const |
MFnRotateManip (const MObject &object, MStatus *ret=NULL) | |
Constructor. |
|
Protected Member Functions |
|
virtual const char * | className () const |
Class name. |
MFnRotateManip::~MFnRotateManip | ( | ) | [virtual] |
Destructor.
Class destructor.
Constructor.
Class constructor that initializes the function set to the given MObject.
[in] | object | The MObject to attach the function set to |
[out] | ReturnStatus | the return status |
Constructor.
Class constructor that initializes the function set to the given constant MDagPath object.
[in] | object | The const MDagPath to attach the function set to |
[out] | ReturnStatus | The return status |
Constructor.
Class constructor that initializes the function set to the given MObject.
[in] | object | The MObject to attach the function set to |
[out] | ReturnStatus | the return status |
MFn::Type MFnRotateManip::type | ( | ) | const [virtual] |
const char * MFnRotateManip::className | ( | ) | const [protected, virtual] |
Creates a new RotateManip, and attaches this function set to the new manipulator.
This method should only be used to create a non-composite manipulator, meaning that the manipulator is standalone and not part of a container.
When the manipulator is being used, the feedback line will display a string including "Rotation", indicating that this manipulator is in use.
[in] | ReturnStatus | return status |
MObject MFnRotateManip::create | ( | const MString & | manipName, | |
const MString & | rotationName, | |||
MStatus * | ReturnStatus =
NULL |
|||
) |
Creates a new RotateManip, and attaches this function set to the new manipulator.
This method should only be used to create a non-composite manipulator, meaning that the manipulator is standalone and not part of a container.
When the manipulator is being used, the feedback line will display a string including rotationName, indicating that this manipulator is in use.
[in] | manipName | The name for the manipulator |
[in] | rotationName | The string that displays in the feedback line while the rotation is being changed |
[out] | ReturnStatus | return status |
Reimplemented from MFnDependencyNode.
Create a 1-1 connection from the rotation manipVal to the rotationPlug parameter. Any changes to the rotation manipVal will be immediately reflected in the connected plug. Connecting to the "rotation" plug on a transform node will produce similar behavior to the built-in rotate manipulator.
The plug must have a data type of MFnNumericData::k3Double.
[in] | rotationPlug | The plug to connect the rotation value to |
Create a 1-1 association of the rotation center on the manipulator and the rotationCenterPlug parameter. When both the rotation center is attached to a plug and the displayWithNode() method has been called, the manipulator will display with the node regardless of the connection made to the rotation center.
The plug must have a data type of MFnNumericData::k3Double.
[in] | rotationCenterPlug | The plug to connect the rotation center to |
MStatus MFnRotateManip::setInitialRotation | ( | const MEulerRotation & | rotation | ) |
Sets the initial rotation for the rotate manipulator. Setting the initial rotation will prevent the manipulator from jumping back to the default rotation when there is already an existing rotation on the target plug.
[in] | rotation | The initial rotation |
Configures the manipulator to display with the node, causing the position of the manipulator to follow the position of the node whenever the node is moved. The node must be a DAG object.
[in] | node | The node the manipulator should display with |
MStatus MFnRotateManip::setRotateMode | ( | RotateMode | mode | ) |
Sets the mode for the rotation manipulator. The manipulator mode controls the appearance of the manipulator when is it used.
Modes
The following modes are supported for the rotation manipulator:
[in] | mode | The new manipulator mode |
MFnRotateManip::RotateMode MFnRotateManip::rotateMode | ( | ) | const |
Returns the current rotation mode.
MStatus MFnRotateManip::setSnapMode | ( | bool | snapEnabled | ) |
Sets the snap mode. The snap modes can be either on (true) or off (false). When snap mode is on, rotation manip values will snap to the values within some increment apart.
[in] | snapEnabled | The new snap mode |
bool MFnRotateManip::isSnapModeOn | ( | ) | const |
Returns true when snap mode is on.
MStatus MFnRotateManip::setSnapIncrement | ( | double | snapInc | ) |
Sets the snap increment. The snap increment is specified in degrees. Manipulator values will snap to the next rotation at an angle of snapInc from the original rotation. Note that snap rotate does not apply to the trackball rotations (when dragging between the rotate discs).
[in] | snapInc | The new snap increment in degrees |
double MFnRotateManip::snapIncrement | ( | ) | const |
Returns the snapping increment in degrees.
unsigned int MFnRotateManip::rotationIndex | ( | MStatus * | ReturnStatus =
NULL |
) | const |
Returns the index of the rotation manipVal for the manipulator. When plugToManip conversion functions are used to produce the rotation manipVal, the manipulator data must be of the type MFnNumericData::k3Double, with X,Y, and Z rotations given in radians. This is easily accomplished by using the MEulerRotation class to manage the rotations.
[out] | ReturnStatus | return status |
unsigned int MFnRotateManip::rotationCenterIndex | ( | MStatus * | ReturnStatus =
NULL |
) | const |
Returns the index of the rotation center for the manipulator.
Note that the rotation center is only used for positioning the display of the manipulator, and has no effect on the rotation values generated by the manipulator.
[out] | ReturnStatus | return status |
Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |