class MFnScaleManip

Jump to documentation

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

Inheritance:

MFnScaleManip < MFnManip3D < MFnTransform < MFnDagNode < MFnDependencyNode < MFnBase

public members:

MFnScaleManip ( const MObject & object, MStatus * ReturnStatus = NULL )
MObject create ( MStatus *ReturnStatus = NULL)
MObject create (const MString &manipName, const MString &scaleName, MStatus *ReturnStatus = NULL)
MStatus connectToScalePlug (const MPlug &scalePlug)
MStatus connectToScaleCenterPlug (const MPlug &scaleCenterPlug)
MStatus setInitialScale (const MVector & scale)
MStatus displayWithNode (const MObject & node)
MStatus setSnapMode (bool snapEnabled)
bool isSnapModeOn () const
MStatus setSnapIncrement (double snapInc)
double snapIncrement () const
unsigned int scaleIndex ( MStatus *ReturnStatus = NULL) const
unsigned int scaleCenterIndex ( 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

MFnScaleManip is the function set for the standard Maya scale tool.
Description

This class provides access to the built-in Maya scale manipulator. The manipulator consists of three constrained-axis scale handles for non-proportional scaling, and a central handle for proportional scaling.

The manipulator provides data to the plugin through the scale manipVal. The scale value is a vector consisting of X, Y, and Z scale values. Each scale value represents a factor controlling how much an object should be extended along that dimension. The scale values are absolute and the initial scale value has a default of <1.0,1.0,1.0>.

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 scaleCenter manipVal.

Functions

MFnScaleManip:: MFnScaleManip ()

Description

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

MFnScaleManip:: MFnScaleManip ( 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

MFnScaleManip:: MFnScaleManip ( 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

MFnScaleManip:: MFnScaleManip ( 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 MFnScaleManip:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kScaleManip

MFnScaleManip:: ~MFnScaleManip ()

Description

Class destructor.

MObject MFnScaleManip:: create ( MStatus *ReturnStatus)

Description

Creates a new ScaleManip, 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 "Scale", 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 MFnScaleManip:: create (const MString &manipName, const MString &scaleName, MStatus *ReturnStatus)

Description

Creates a new ScaleManip, 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 scaleName, indicating that this manipulator is in use.

Arguments

  • manipName The name for the manipulator
  • scaleName The string that displays in the feedback line while the scale value 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 MFnScaleManip:: connectToScalePlug (const MPlug &scalePlug)

Description

Create a 1-1 connection from the scale manipVal to the scalePlug parameter. Any changes to the scale manipVal will be immediately reflected in the connected plug. Connecting to the "scale" plug on a transform node will produce similar behavior to the built-in scale manipulator.

The plug must have a data type of MFnNumericData::k3Double.

Arguments

  • scalePlug The plug to connect the scale 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 MFnScaleManip:: connectToScaleCenterPlug (const MPlug &scaleCenterPlug)

Description

Create a 1-1 association of the scale center on the manipulator and the scaleCenterPlug parameter. When both the scale 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 scale center.

The plug must have a data type of MFnNumericData::k3Double.

Arguments

  • scaleCenterPlug The plug to connect the scale 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 MFnScaleManip:: setInitialScale (const MVector & scale)

Description

Sets the initial scale for the scale manipulator. Setting the initial scale will prevent the manipulator from jumping back to the default scale when there is already an existing scale on the target plug.

Arguments

  • scale The initial scale

Return Value

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

MStatus MFnScaleManip:: 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 MFnScaleManip:: setSnapMode (bool snapEnabled)

Description

Sets the snap mode. The snap modes can be either on (true) or off (false). When snap mode is on, scale values will snap to scale value within some interval apart. The interval is set using setSnapIncrement().

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 MFnScaleManip:: isSnapModeOn () const

Description

Returns true when snap mode is on.

Return Value

  • bool Snap mode

MStatus MFnScaleManip:: setSnapIncrement (double snapInc)

Description

Sets the snap increment. The snap increment is specified in the working unit, and is the distance between snap points when dragging the scale handles.

Arguments

  • snapInc The new snap increment

Return Value

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

double MFnScaleManip:: snapIncrement () const

Description

Returns the snapping increment in working units.

Return Value

  • double Snapping increment

unsigned int MFnScaleManip:: scaleIndex ( MStatus *ReturnStatus) const

Description

Returns the index of the scale manipVal for this manipulator.

Arguments

  • ReturnStatus return status

Return Value

  • scale 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 MFnScaleManip:: scaleCenterIndex ( MStatus *ReturnStatus) const

Description

Returns the index of the scale center manipVal for this manipulator.

Note that the scale center is only used for display of the manipulator and has no effect on scale values produced by the manipulator.

Arguments

  • ReturnStatus return status

Return Value

  • scale 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