| MPxDeformerNode () | |
| ~MPxDeformerNode () | |
| type () const | |
| deform ( MDataBlock & block, MItGeometry & iter, const MMatrix & mat, unsigned int multiIndex) | |
| accessoryAttribute () const | |
| accessoryNodeSetup ( MDagModifier & cmd) | |
| weightValue ( MDataBlock & mblock, unsigned int multiIndex, unsigned int wtIndex) | |
| setUseExistingConnectionWhenSetEditing (bool state) | |
| setModifiedCallback ( MSelectionList & list, bool listAdded ) | |
| input input attribute, multi | |
| inputGeom input geometry attribute | |
| groupId input group id attribute | |
| outputGeom geometry output attribute | |
| weightList weight list attribute, multi | |
| weights weight attribute, multi | |
| envelope envelope attribute |
| Type | |
| postConstructor () | |
| compute ( const MPlug & plug, MDataBlock & dataBlock ) | |
| getInternalValueInContext ( const MPlug & plug, MDataHandle & dataHandle, MDGContext & ctx) | |
| setInternalValueInContext ( const MPlug & plug, const MDataHandle & dataHandle, MDGContext & ctx) | |
| getInternalValue ( const MPlug & plug, MDataHandle & dataHandle) | |
| setInternalValue ( const MPlug & plug, const MDataHandle & dataHandle) | |
| internalArrayCount ( const MPlug & plug, const MDGContext & ctx) const | |
| copyInternalData ( MPxNode * ) | |
| legalConnection ( const MPlug & plug, const MPlug & otherPlug, bool asSrc, bool& isLegal ) const | |
| legalDisconnection ( const MPlug & plug, const MPlug & otherPlug, bool asSrc, bool& isLegal ) const | |
| setDependentsDirty ( const MPlug & plug, MPlugArray & plugArray) | |
| connectionMade ( const MPlug & plug, const MPlug & otherPlug, bool asSrc ) | |
| connectionBroken ( const MPlug & plug, const MPlug & otherPlug, bool asSrc ) | |
| isPassiveOutput ( const MPlug & plug ) const | |
| shouldSave ( const MPlug & plug, bool& isSaving ) | |
| passThroughToOne ( const MPlug & plug ) const | |
| passThroughToMany ( const MPlug & plug, MPlugArray & plugArray ) const | |
| typeId () const | |
| typeName () const | |
| name () const | |
| type () const | |
| isAbstractClass () const | |
| thisMObject () const | |
| addAttribute ( const MObject & attr ) | |
| inheritAttributesFrom ( const MString & parentClassName ) | |
| attributeAffects ( const MObject & whenChanges, const MObject & isAffected ) | |
| setExistWithoutInConnections ( bool flag ) | |
| existWithoutInConnections ( MStatus * ReturnStatus = NULL ) const | |
| setExistWithoutOutConnections ( bool flag ) | |
| existWithoutOutConnections ( MStatus * ReturnStatus = NULL ) const | |
| message | |
| isHistoricallyInteresting | |
| caching | |
| state |
| forceCache ( MDGContext & ctx= MDGContext::fsNormal ) | |
| setMPSafe ( bool flag ) | |
| setDoNotWrite ( bool flag ) | |
| doNotWrite ( MStatus *ReturnStatus = NULL ) const |
MStatus
exampleDeformer::compute(const MPlug& plug, MDataBlock& dataBlock)
{
MStatus status = MS::kUnknownParameter;
if (plug.attribute() == outputGeom) {
// get the input corresponding to this output
//
unsigned int index = plug.logicalIndex();
MObject thisNode = this->thisMObject();
MPlug inPlug(thisNode,input);
inPlug.selectAncestorLogicalIndex(index,input);
MDataHandle hInput = dataBlock.inputValue(inPlug);
// get the input geometry and input groupId
//
MDataHandle hGeom = hInput.child(inputGeom);
MDataHandle hGroup = hInput.child(groupId);
unsigned int groupId = hGroup.asLong();
MDataHandle hOutput = dataBlock.outputValue(plug);
hOutput.copy(hGeom);
// do the deformation
//
MItGeometry iter(hOutput,groupId,false);
for ( ; !iter.isDone(); iter.next()) {
MPoint pt = iter.position();
//
// insert deformation code here
//
iter.setPosition(pt);
}
status = MS::kSuccess;
}
return status;
}
For most deformers, implementing compute() is unnecessary. To create a
deformer, derive from this class and override the deform() method as
demonstrated in the "offsetNode.cpp" example plug-in. The other
methods of the parent class MPxNode may also be overridden to perform
standard dependency node capabilities.When implementing the compute method for a
deformer, another consideration is that the input geometry attribute is not
cached. This means that all of the inputs will evaluate each time
MDataBlock::inputArrayValue is called on "inputGeom". If you only want
a single inputGeometry, you can prevent unneeded evaluations by avoiding
calls to MDataBlock.inputArrayValue. For example, use the technique shown in the
above example or use MDataBlock::outputArrayValue.
| Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. | doc++ Copyright |