| MPlug () | |||||||||
| MPlug ( const MPlug & in ) | |||||||||
| MPlug ( const MObject & node , const MObject & attribute ) | |||||||||
| ~MPlug () | |||||||||
| setAttribute ( MObject & attribute ) | |||||||||
| attribute ( MStatus * ReturnStatus = NULL ) const | |||||||||
| node ( MStatus * ReturnStatus = NULL ) const | |||||||||
| name ( MStatus * ReturnStatus = NULL ) const | |||||||||
| partialName ( bool includeNodeName = false, bool includeNonMandatoryIndices = false, bool includeInstancedIndices = false, bool useAlias = false, bool useFullAttributePath = false, bool useLongNames = false, MStatus * ReturnStatus = NULL ) const | |||||||||
MValueSelector
| |||||||||
| getSetAttrCmds ( MStringArray & cmds, MValueSelector valueSelector = kAll , bool useLongNames = false ) | |||||||||
| isNetworked ( MStatus * ReturnStatus = NULL ) const | |||||||||
| isArray ( MStatus * ReturnStatus = NULL ) const | |||||||||
| isElement ( MStatus * ReturnStatus = NULL) const | |||||||||
| isCompound ( MStatus * ReturnStatus = NULL ) const | |||||||||
| isChild ( MStatus * ReturnStatus = NULL ) const | |||||||||
| isProcedural ( MStatus * ReturnStatus = NULL ) const | |||||||||
| logicalIndex ( MStatus * ReturnStatus = NULL ) const | |||||||||
| selectAncestorLogicalIndex ( unsigned int index, const MObject & attribute = MObject::kNullObj ) | |||||||||
| getExistingArrayAttributeIndices ( MIntArray & indices, MStatus * ReturnStatus = NULL) | |||||||||
| numElements ( MStatus * ReturnStatus = NULL ) const | |||||||||
| evaluateNumElements ( MStatus * ReturnStatus = NULL ) | |||||||||
| numChildren ( MStatus * ReturnStatus = NULL ) const | |||||||||
| numConnectedElements ( MStatus * ReturnStatus = NULL ) const | |||||||||
| numConnectedChildren ( MStatus * ReturnStatus = NULL ) const | |||||||||
| child ( MObject & attr, MStatus * ReturnStatus = NULL ) const | |||||||||
| child ( unsigned int index, MStatus * ReturnStatus = NULL ) const | |||||||||
| parent ( MStatus * ReturnStatus = NULL ) const | |||||||||
| array ( MStatus * ReturnStatus = NULL ) const | |||||||||
| elementByLogicalIndex ( unsigned int logicalIndex , MStatus * ReturnStatus = NULL) const | |||||||||
| elementByPhysicalIndex ( unsigned int physicalIndex, MStatus * ReturnStatus = NULL) const | |||||||||
| connectionByPhysicalIndex ( unsigned int physicalIndex, MStatus * ReturnStatus = NULL) const | |||||||||
| connectedTo ( MPlugArray & array , bool asDst, bool asSrc, MStatus * ReturnStatus = NULL ) const | |||||||||
| isConnected ( MStatus * ReturnStatus = NULL ) const | |||||||||
| isKeyable ( MStatus * ReturnStatus = NULL ) const | |||||||||
| setKeyable ( bool keyable ) | |||||||||
| isLocked ( MStatus * ReturnStatus = NULL ) const | |||||||||
| setLocked ( bool locked ) | |||||||||
| isChannelBoxFlagSet ( MStatus * ReturnStatus = NULL ) const | |||||||||
| setChannelBox ( bool channelBox ) | |||||||||
| isCachingFlagSet ( MStatus * ReturnStatus = NULL ) const | |||||||||
| setCaching ( bool caching ) | |||||||||
| isNull ( MStatus * ReturnStatus = NULL ) const | |||||||||
| info ( MStatus * ReturnStatus = NULL ) const | |||||||||
| isFromReferencedFile ( MStatus * ReturnStatus = NULL ) const | |||||||||
| isDynamic ( MStatus * ReturnStatus = NULL ) const | |||||||||
| isIgnoredWhenRendering ( MStatus * ReturnStatus = NULL ) const | |||||||||
FreeToChangeState
| |||||||||
| isFreeToChange (bool checkParents = true, bool checkChildren = true, MStatus * ReturnStatus = NULL ) const | |||||||||
| constructHandle ( MDataBlock &) const | |||||||||
| destructHandle ( MDataHandle &) const | |||||||||
| getValue ( MObject &val, MDGContext & ctx= MDGContext::fsNormal ) const NO SCRIPT SUPPORT | |||||||||
| getValue ( double&, MDGContext & ctx= MDGContext::fsNormal ) const NO SCRIPT SUPPORT | |||||||||
| getValue ( float&, MDGContext & ctx= MDGContext::fsNormal ) const NO SCRIPT SUPPORT | |||||||||
| getValue ( int&, MDGContext & ctx= MDGContext::fsNormal ) const NO SCRIPT SUPPORT | |||||||||
| getValue ( short&, MDGContext & ctx= MDGContext::fsNormal ) const NO SCRIPT SUPPORT | |||||||||
| getValue ( bool&, MDGContext & ctx= MDGContext::fsNormal ) const NO SCRIPT SUPPORT | |||||||||
| getValue ( MDistance &, MDGContext & ctx= MDGContext::fsNormal ) const NO SCRIPT SUPPORT | |||||||||
| getValue ( MAngle &, MDGContext & ctx= MDGContext::fsNormal ) const NO SCRIPT SUPPORT | |||||||||
| getValue ( MTime &, MDGContext & ctx= MDGContext::fsNormal ) const NO SCRIPT SUPPORT | |||||||||
| getValue ( char&, MDGContext & ctx= MDGContext::fsNormal ) const NO SCRIPT SUPPORT | |||||||||
| getValue ( MString &, MDGContext & ctx= MDGContext::fsNormal ) const NO SCRIPT SUPPORT | |||||||||
| setValue ( MObject & val ) NO SCRIPT SUPPORT | |||||||||
| setValue ( MPxData * data ) NO SCRIPT SUPPORT | |||||||||
| setValue ( MDataHandle & handle ) NO SCRIPT SUPPORT | |||||||||
| setValue ( double ) NO SCRIPT SUPPORT | |||||||||
| setValue ( float ) NO SCRIPT SUPPORT | |||||||||
| setValue ( int ) NO SCRIPT SUPPORT | |||||||||
| setValue ( short ) NO SCRIPT SUPPORT | |||||||||
| setValue ( bool ) NO SCRIPT SUPPORT | |||||||||
| setValue ( MDistance & ) NO SCRIPT SUPPORT | |||||||||
| setValue ( MAngle & ) NO SCRIPT SUPPORT | |||||||||
| setValue ( MTime & ) NO SCRIPT SUPPORT | |||||||||
| setValue ( char ) NO SCRIPT SUPPORT | |||||||||
| setValue ( const MString & ) NO SCRIPT SUPPORT | |||||||||
| setValue ( const char* ) NO SCRIPT SUPPORT | |||||||||
| asMObject ( MDGContext & ctx= MDGContext::fsNormal , MStatus * ReturnStatus = NULL ) const | |||||||||
| asDouble ( MDGContext & ctx= MDGContext::fsNormal , MStatus * ReturnStatus = NULL ) const | |||||||||
| asFloat ( MDGContext & ctx= MDGContext::fsNormal , MStatus * ReturnStatus = NULL ) const | |||||||||
| asInt ( MDGContext & ctx= MDGContext::fsNormal , MStatus * ReturnStatus = NULL ) const | |||||||||
| asShort ( MDGContext & ctx= MDGContext::fsNormal , MStatus * ReturnStatus = NULL ) const | |||||||||
| asBool ( MDGContext & ctx= MDGContext::fsNormal , MStatus * ReturnStatus = NULL ) const | |||||||||
| asMDistance ( MDGContext & ctx= MDGContext::fsNormal , MStatus * ReturnStatus = NULL ) const | |||||||||
| asMAngle ( MDGContext & ctx= MDGContext::fsNormal , MStatus * ReturnStatus = NULL ) const | |||||||||
| asMTime ( MDGContext & ctx= MDGContext::fsNormal , MStatus * ReturnStatus = NULL ) const | |||||||||
| asChar ( MDGContext & ctx= MDGContext::fsNormal , MStatus * ReturnStatus = NULL ) const | |||||||||
| asString ( MDGContext & ctx= MDGContext::fsNormal , MStatus * ReturnStatus = NULL ) const | |||||||||
| setMObject ( MObject & val ) | |||||||||
| setMPxData ( MPxData * data ) | |||||||||
| setMDataHandle ( MDataHandle & handle ) | |||||||||
| setDouble ( double ) | |||||||||
| setFloat ( float ) | |||||||||
| setInt ( int ) | |||||||||
| setShort ( short ) | |||||||||
| setBool ( bool ) | |||||||||
| setMDistance ( MDistance & ) | |||||||||
| setMAngle ( MAngle & ) | |||||||||
| setMTime ( MTime & ) | |||||||||
| setChar ( char ) | |||||||||
| setString ( const MString & ) | |||||||||
| operator = ( const MPlug & other ) | |||||||||
| operator[] ( unsigned int physicalIndex ) const | |||||||||
| operator == ( const MPlug &other ) const | |||||||||
| operator == ( const MObject &other ) const | |||||||||
| operator != ( const MPlug &other ) const | |||||||||
| operator != ( const MObject &other ) const | |||||||||
| setNumElements ( unsigned int ) | |||||||||
| operator[] ( MObject & attr ) const NO SCRIPT SUPPORT | |||||||||
| MObject () const NO SCRIPT SUPPORT | |||||||||
| operator! () const NO SCRIPT SUPPORT |
// See note below on numElements() method
for (i = 0; i < arrayPlug.numElements (); i++)
{
MPlug elementPlug = arrayPlug [i];
unsigned int logicalIndex = elementPlug.logicalIndex();
// ...
}
This is equivalent to calling elementByPhysicalIndex since the
bracket operator uses physical indexes. The ancestry of a plug is the tree above the plug: any parents or arrays
which this plug belongs to. The selectAncestorLogicalIndex method
provides quick access to element plugs without walking the plug tree. A
plug does not need to exist in the datablock or plug tree in order to
be constructed using selectByLogicalIndex, but once a value is requested or set
on the plug, it will be added to the datablock if it was not there already.
For example:
MPlug plug(node,attribute);
// See note below on numElements() method
unsigned int count = plug.numElements();
if (0 == count) {
plug.selectAncestorLogicalIndex(0,attribute);
plug.setValue(setVal);
count = plug.numElements(); // count will now be 1 since we added a value
plug.selectAncestorLogicalIndex(10,attribute);
MObject getVal;
plug.getValue(getVal);
count = plug.numElements(); // count will now be 2 since we asked for a value
}
Once a value has been added to an array plug, it will usually remain
in the datablock as long as the scene is open. The exception is for attributes that
have their disconnect behavior set to kDelete; data for these attributes will be
deleted when their connection is broken. When a file is saved, only array values
that are not at their default values will be written out. Therefore, the number
of elements in an array plug may change when the file is read in again. NOTE: The numElements() call for array plugs returns a value based on the
information in the datablock. It is possible to have un-evaluated connected
items being excluded from the count since these items are not yet in the
datablock. In this case, the numElements() method will return the correct
answer if the ::evaluateNumElements() call is made first. But this cannot
be done in the ::compute() method of a node.
MPlug inPlug (node, inAttribute);
MPlug valuePlug (node, valueAttribute);
MPlug plug (node, valueAttribute);
for (i = 0; i < inPlug.numElements (); i++)
{
valuePlug.selectAncestorLogicalIndex (i, inAttribute);
(for j = 0; j < valuePlug.numElements (); j++)
{
plug.selectAncestorLogicalIndex (i, inAttribute);
plug.selectAncestorLogicalIndex (j, valueAttribute);
// ...
}
}
This method is only valid for non-networked plugs since networked plugs
are part of a dependency node and can only be modified by making or
breaking connections. Arguments | Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. | doc++ Copyright |