class MFnRotateManip

Jump to documentation

: public MFnManip3D RotateManip function set (OpenMayaUI) (OpenMayaUI.py)

Inheritance:

MFnRotateManip < MFnManip3D < MFnTransform < MFnDagNode < MFnDependencyNode < MFnBase

public members:

MFnRotateManip ( const MObject & object, MStatus * ReturnStatus = NULL )
enum RotateMode
kObjectSpace
Object Space (default)
kWorldSpace
World Space
kGimbal
Gimbal
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

Inherited from MFnManip3D:

public members:

bool isVisible ( MStatus *ReturnStatus) const
MStatus setVisible (bool isVisible )
float manipScale ( MStatus *ReturnStatus) const
MStatus setManipScale (float size)
bool isOptimizePlaybackOn ( MStatus *ReturnStatus) const
MStatus setOptimizePlayback (bool optimizePlayback)
static float globalSize ()
static void setGlobalSize (float size)
static float handleSize ()
static void setHandleSize (float size)
static float lineSize ()
static void setLineSize (float size)
static MStatus deleteManipulator ( MObject & manip)
MEulerRotation rotateXYZValue (const unsigned int valIndex, MStatus *ReturnStatus = NULL)

Inherited from MFnTransform:

public members:

MObject create ( MObject parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MTransformationMatrix transformation ( MStatus * ReturnStatus = NULL ) const
MStatus set ( const MTransformationMatrix & transform )
MStatus getScale ( double scale[3] ) const
MStatus setScale ( const double scale[3] )
MStatus scaleBy ( const double scale[3] )
MStatus getShear ( double scale[3] ) const
MStatus setShear ( const double shear[3] )
MStatus shearBy ( const double shear[3] )
MStatus getRotation ( MQuaternion &quaternion, MSpace::Space = MSpace::kTransform ) const
MStatus setRotation ( const MQuaternion &quaternion, MSpace::Space = MSpace::kTransform )
MStatus rotateBy ( const MQuaternion &quaternion, MSpace::Space = MSpace::kTransform )
MStatus getRotation ( MEulerRotation &rotation ) const
MStatus setRotation ( const MEulerRotation &rotation )
MStatus rotateBy ( const MEulerRotation &rotation, MSpace::Space = MSpace::kTransform )
MStatus getRotationQuaternion ( double &x, double &y, double &z, double &w, MSpace::Space = MSpace::kTransform ) const
MStatus setRotationQuaternion ( double x, double y, double z, double w, MSpace::Space = MSpace::kTransform )
MStatus rotateByQuaternion ( double x, double y, double z, double w, MSpace::Space = MSpace::kTransform )
MStatus getRotation ( double rotation[3], MTransformationMatrix::RotationOrder & order ) const
MStatus setRotation ( const double rotation[3], MTransformationMatrix::RotationOrder order )
MStatus rotateBy ( const double rotation[3], MTransformationMatrix::RotationOrder order, MSpace::Space = MSpace::kTransform )
MVector getTranslation ( MSpace::Space space, MStatus * ReturnStatus = NULL ) const
MStatus setTranslation ( const MVector & vec, MSpace::Space space )
MStatus translateBy ( const MVector & vec, MSpace::Space space )
MPoint scalePivot ( MSpace::Space space, MStatus * ReturnStatus = NULL ) const
MStatus setScalePivot ( const MPoint & point, MSpace::Space space, bool balance )
MVector scalePivotTranslation ( MSpace::Space space , MStatus * ReturnStatus = NULL ) const
MStatus setScalePivotTranslation ( const MVector & vec, MSpace::Space space )
MPoint rotatePivot ( MSpace::Space space , MStatus * ReturnStatus = NULL ) const
MStatus setRotatePivot ( const MPoint & point, MSpace::Space space, bool balance )
MVector rotatePivotTranslation ( MSpace::Space space, MStatus * ReturnStatus = NULL ) const
MStatus setRotatePivotTranslation ( const MVector & vec, MSpace::Space space )
MQuaternion rotateOrientation ( MSpace::Space space , MStatus * ReturnStatus = NULL ) const
MStatus setRotateOrientation ( const MQuaternion & quat, MSpace::Space space, bool balance )
MTransformationMatrix::RotationOrder rotationOrder ( MStatus * ReturnStatus = NULL ) const
MStatus setRotationOrder ( MTransformationMatrix::RotationOrder order, bool reorder )
MTransformationMatrix restPosition ( MStatus * ReturnStatus) const
MStatus setRestPosition ( const MTransformationMatrix & matrix )
MStatus resetFromRestPosition ()
MStatus clearRestPosition ()
MStatus getRotation ( double rotation[3], MTransformationMatrix::RotationOrder & order, MSpace::Space ) const
MStatus setRotation (const double rotation[3], MTransformationMatrix::RotationOrder order, MSpace::Space )
MVector translation ( MSpace::Space space, MStatus * ReturnStatus = NULL ) const
enum LimitType
kScaleMinX
kScaleMaxX
kScaleMinY
kScaleMaxY
kScaleMinZ
kScaleMaxZ
kShearMinXY
kShearMaxXY
kShearMinXZ
kShearMaxXZ
kShearMinYZ
kShearMaxYZ
kRotateMinX
kRotateMaxX
kRotateMinY
kRotateMaxY
kRotateMinZ
kRotateMaxZ
kTranslateMinX
kTranslateMaxX
kTranslateMinY
kTranslateMaxY
kTranslateMinZ
kTranslateMaxZ
bool isLimited ( MFnTransform::LimitType type , MStatus * ReturnStatus = NULL ) const
double limitValue ( MFnTransform::LimitType type , MStatus * ReturnStatus = NULL ) const
MStatus setLimit ( MFnTransform::LimitType type , double value)
MStatus enableLimit ( MFnTransform::LimitType type , bool flag)

Inherited from MFnDagNode:

public members:

kNextPos
MObject create ( const MTypeId &typeId, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId &typeId, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
unsigned int parentCount ( MStatus * ReturnStatus = NULL ) const
MObject parent ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MStatus addChild ( MObject & child , unsigned int index = kNextPos , bool keepExistingParents = false )
MStatus removeChild ( MObject & child )
MStatus removeChildAt ( unsigned int index )
unsigned int childCount ( MStatus * ReturnStatus = NULL ) const
MObject child ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MObject dagRoot ( MStatus * ReturnStatus = NULL )
bool hasParent ( const MObject & node, MStatus * ReturnStatus = NULL ) const
bool hasChild (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isChildOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isParentOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool inUnderWorld ( MStatus * ReturnStatus = NULL ) const
bool inModel ( MStatus * ReturnStatus = NULL ) const
bool isInstanceable ( MStatus * ReturnStatus=NULL ) const
MStatus setInstanceable ( const bool how )
bool isInstanced ( bool indirect = true, MStatus * ReturnStatus = NULL ) const
bool isInstancedAttribute ( const MObject & attr, MStatus * ReturnStatus = NULL ) const
unsigned int instanceCount ( bool total, MStatus * ReturnStatus = NULL ) const
MObject duplicate ( bool instance = false, bool instanceLeaf = false, MStatus * ReturnStatus = NULL ) const
MStatus getPath ( MDagPath & path )
MStatus getAllPaths ( MDagPathArray & paths )
MString fullPathName ( MStatus *ReturnStatus = NULL)
MString partialPathName ( MStatus *ReturnStatus = NULL)
MMatrix transformationMatrix ( MStatus * ReturnStatus = NULL ) const
bool isIntermediateObject ( MStatus * ReturnStatus = NULL ) const
MStatus setIntermediateObject ( bool isIntermediate )
int objectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setObjectColor ( int color )
bool usingObjectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setUseObjectColor ( bool useObjectColor )
MBoundingBox boundingBox ( MStatus * ReturnStatus = NULL ) const
MDagPath dagPath ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MDagPath & path )
virtual MStatus setObject ( MObject & object )
MObject model ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MObject & object )

Inherited from MFnDependencyNode:

public members:

virtual MFn::Type type () const
enum MAttrClass
kGlobalDynamicAttr
kLocalDynamicAttr
MObject create ( const MTypeId & typeId , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId & typeId , const MString & name , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , const MString & name , MStatus * ReturnStatus = NULL )
MTypeId typeId ( MStatus * ReturnStatus = NULL ) const
MString typeName ( MStatus * ReturnStatus = NULL ) const
MString name ( MStatus * ReturnStatus = NULL ) const
MString setName ( const MString & name , MStatus * ReturnStatus = NULL )
MStatus getConnections ( MPlugArray & array ) const
unsigned int attributeCount ( MStatus * ReturnStatus=NULL) const
MObject attribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject reorderedAttribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject attribute ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MAttrClass attributeClass ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MStatus getAffectedAttributes ( const MObject & attr, MObjectArray & affectedAttributes ) const
MStatus getAffectedByAttributes ( const MObject & attr, MObjectArray & affectedByAttributes ) const
MPlug findPlug ( const MObject & attr, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MStatus addAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MStatus removeAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MPxNode * userNode ( MStatus * ReturnStatus=NULL ) const
bool isFromReferencedFile ( MStatus * ReturnStatus=NULL) const
bool isShared ( MStatus * ReturnStatus=NULL) const
bool hasUniqueName ( MStatus * ReturnStatus=NULL) const
MString parentNamespace ( MStatus * ReturnStatus=NULL) const
bool isLocked ( MStatus * ReturnStatus=NULL) const
MStatus setLocked ( bool locked )
static MString classification ( const MString & nodeTypeName )
bool isNewAttribute ( const MObject & attr, MStatus * ReturnStatus=NULL) const
static unsigned int allocateFlag ( const MString pluginName, MStatus * ReturnStatus=NULL )
static MStatus deallocateFlag (const MString pluginName, unsigned int flag)
static MStatus deallocateAllFlags (const MString pluginName)
MStatus setFlag (unsigned int flag, bool state)
bool isFlagSet (unsigned int flag, MStatus * ReturnStatus=NULL) const
bool isDefaultNode ( MStatus * ReturnStatus=NULL) const
MStatus setDoNotWrite ( bool flag )
bool canBeWritten ( MStatus * ReturnStatus=NULL) const
bool hasAttribute (const MString & name , MStatus * ReturnStatus=NULL) const
MObject getAliasAttr (bool force, MStatus * ReturnStatus=NULL)
bool setAlias (const MString & alias,const MString & name , const MPlug & plug, bool add=true, MStatus * ReturnStatus=NULL)
bool findAlias (const MString & alias, MObject & attrObj, MStatus * ReturnStatus=NULL) const
bool getAliasList ( MStringArray & strArray, MStatus * ReturnStatus=NULL)
MString plugsAlias (const MPlug & plug, MStatus * ReturnStatus=NULL)
public
bool getPlugsAlias (const MPlug & plug, MString & aliasName, MStatus * ReturnStatus=NULL)

Inherited from MFnBase:

public members:

virtual MFn::Type type () const
bool hasObj ( MFn::Type ) const
bool hasObj ( const MObject & ) const
MObject object ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( MObject & object )
virtual MStatus setObject ( const MObject & object )

Documentation

MFnRotateManip is the function set for the Maya arcball rotation manipulator.
Description

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.

Functions

MFnRotateManip:: MFnRotateManip ()

Description

Default class constructor. The function set is not attached to an MObject.

MFnRotateManip:: MFnRotateManip ( MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given MObject.

Arguments

  • object the MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnRotateManip:: MFnRotateManip ( const MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given constant MObject.

Arguments

  • object the const MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnRotateManip:: MFnRotateManip ( const MDagPath & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given constant MDagPath object.

Arguments

  • object the const MDagPath to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFn::Type MFnRotateManip:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kRotateManip

MFnRotateManip:: ~MFnRotateManip ()

Description

Class destructor.

MObject MFnRotateManip:: create ( MStatus *ReturnStatus)

Description

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.

Arguments

  • ReturnStatus return status

Return Value

  • An object corresponding to the new manipulator

Status Codes

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

MObject MFnRotateManip:: create (const MString &manipName, const MString &rotationName, MStatus *ReturnStatus)

Description

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.

Arguments

  • manipName The name for the manipulator
  • rotationName The string that displays in the feedback line while the rotation is being changed
  • ReturnStatus return status

Return Value

  • An object corresponding to the new manipulator

Status Codes

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

MStatus MFnRotateManip:: connectToRotationPlug (const MPlug &rotationPlug)

Description

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.

Arguments

  • rotationPlug The plug to connect the rotation value to

Return Value

  • MS::kSuccess Successfully connected the plug
  • MS::kFailure Could not connect to the plug or an invalid object is attached to the function set

MStatus MFnRotateManip:: connectToRotationCenterPlug (const MPlug &rotationCenterPlug)

Description

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.

Arguments

  • rotationCenterPlug The plug to connect the rotation center to

Return Value

  • MS::kSuccess Successfully connected the plug
  • MS::kFailure Could not connect to the plug or an invalid object is attached to the function set

MStatus MFnRotateManip:: setInitialRotation (const MEulerRotation & rotation)

Description

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.

Arguments

  • rotation The initial rotation

Return Value

  • MS::kSuccess Successfully set the initial rotation
  • MS::kFailure Could not set the rotation or an invalid object is attached to the function set

MStatus MFnRotateManip:: displayWithNode (const MObject & node)

Description

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.

Arguments

  • node The node the manipulator should display with

Return Value

  • MS::kSuccess Successfully configured display with the node
  • MS::kInvalidParameter Invalid node parameter
  • MS::kFailure Could not display with the node or an invalid object is attached to the function set

MStatus MFnRotateManip:: setRotateMode ( RotateMode mode)

Description

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:

  • MFnRotateManip::kObjectSpace In object space mode, the manipulator is displayed as three perpendicular manipulator discs, as well as a view disc enclosing the manipulator. The manipulator will rotate whenever the manip value is changed.
  • MFnRotateManip::kWorldSpace This mode forces the manipulator to display in the default orientation regardless of the manipulator value. The manipulator is displayed the same as in object space mode, except it does not rotate when the manip value is changed.
  • MFnRotateManip::kGimbal In gimbal mode, only the constrained axis rotation discs are allowed to be manipulated. Gimbal mode treats the X,Y, and Z axis rotations as a sequence of operations on the default manipulator display. First, the X rotation is applied. Then, the Y rotation is applied, causing the X rotation disc to become transformed. Finally, the Z rotation is applied, transforming both the X and Y rotation discs. The Z rotation disc remains fixed during the operation. No view disc can be manipulated in gimbal mode.

Arguments

  • mode The new manipulator mode

Return Value

  • MS::kSuccess Successfully set the manipulator mode
  • MS::kInvalidParameter Invalid mode parameter
  • MS::kFailure The function set is attached to an invalid object

MFnRotateManip::RotateMode MFnRotateManip:: rotateMode () const

Description

Returns the current rotation mode.

Return Value

  • MFnRotateManip::RotateMode The current rotation mode

MStatus MFnRotateManip:: setSnapMode (bool snapEnabled)

Description

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.

Arguments

  • snapEnabled The new snap mode

Return Value

  • MS::kSuccess Successfully set the snap mode
  • MS::kFailure The function set is attached to an invalid object

bool MFnRotateManip:: isSnapModeOn () const

Description

Returns true when snap mode is on.

Return Value

  • bool Snap mode

MStatus MFnRotateManip:: setSnapIncrement (double snapInc)

Description

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

Arguments

  • snapInc The new snap increment in degrees

Return Value

  • MS::kSuccess Successfully set the snap increment
  • MS::kFailure The function set is attached to an invalid object

double MFnRotateManip:: snapIncrement () const

Description

Returns the snapping increment in degrees.

Return Value

  • double Snapping increment (degrees)

unsigned int MFnRotateManip:: rotationIndex ( MStatus *ReturnStatus) const

Description

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.

Arguments

  • ReturnStatus return status

Return Value

  • rotation index

Status Codes

  • MS::kSuccess Successfully retrieved the index
  • MS::kFailure Failed to retrieve the index or the object attached to this function set is invalid

unsigned int MFnRotateManip:: rotationCenterIndex ( MStatus *ReturnStatus) const

Description

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.

Arguments

  • ReturnStatus return status

Return Value

  • rotation center index

Status Codes

  • MS::kSuccess Successfully retrieved the index
  • MS::kFailure Failed to retrieve the index or the object attached to this function set is invalid

This class has no child classes.


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