#include
<MFnScaleManip.h>
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.
Public Member Functions |
|
virtual MFn::Type | type () const |
Function set type. |
|
virtual | ~MFnScaleManip () |
Destructor. |
|
MFnScaleManip () | |
Default constructor. |
|
MFnScaleManip (MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. |
|
MFnScaleManip (const MDagPath &object, MStatus *ret=NULL) | |
Constructor. |
|
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 |
MFnScaleManip (const MObject &object, MStatus *ret=NULL) | |
Constructor. |
|
Protected Member Functions |
|
virtual const char * | className () const |
Class name. |
MFnScaleManip::~MFnScaleManip | ( | ) | [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 MFnScaleManip::type | ( | ) | const [virtual] |
const char * MFnScaleManip::className | ( | ) | const [protected, virtual] |
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.
[out] | ReturnStatus | return status |
MObject MFnScaleManip::create | ( | const MString & | manipName, | |
const MString & | scaleName, | |||
MStatus * | ReturnStatus =
NULL |
|||
) |
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.
[in] | manipName | The name for the manipulator |
[in] | scaleName | The string that displays in the feedback line while the scale value is being changed |
[out] | ReturnStatus | return status |
Reimplemented from MFnDependencyNode.
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.
[in] | scalePlug | The plug to connect the scale value to |
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.
[in] | scaleCenterPlug | The plug to connect the scale center to |
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.
[in] | scale | The initial scale |
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 MFnScaleManip::setSnapMode | ( | bool | snapEnabled | ) |
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().
[in] | snapEnabled | The new snap mode |
bool MFnScaleManip::isSnapModeOn | ( | ) | const |
Returns true when snap mode is on.
MStatus MFnScaleManip::setSnapIncrement | ( | double | snapInc | ) |
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.
[in] | snapInc | The new snap increment |
double MFnScaleManip::snapIncrement | ( | ) | const |
Returns the snapping increment in working units.
unsigned int MFnScaleManip::scaleIndex | ( | MStatus * | ReturnStatus =
NULL |
) | const |
Returns the index of the scale manipVal for this manipulator.
[out] | ReturnStatus | return status |
unsigned int MFnScaleManip::scaleCenterIndex | ( | MStatus * | ReturnStatus =
NULL |
) | const |
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.
[out] | ReturnStatus | return status |
Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |