W dniu 2015-03-02 o 13:18, Miguel González Viñé pisze:
What you wan't to do breaks basics of maya API fundamentals, namely:
node is defined only by it's attributes and it's illegal to try to get
data outside of node (or said differently: compute() methed should
operate based on node plugs ONLY).
That being said ... we often have to workaround different things :)
ie I'd like to get transfrom node from withing deform() method if anyone
has idea...
Here's how I get OUTPUT mesh from a deformer, you should be able to
adapt it to your needs.
Remember, this is forbidden in maya API ;)
MStatus xxx::deform( MDataBlock& block, MItGeometry &iter, const MMatrix
&localToWorld, unsigned int geomIndex)
{
MObject thisNode(thisMObject());
MFnDependencyNode this_dn(thisNode);
// -- OUTPUT GEOM
MPlug outputPlug(thisNode, outputGeom);
outputPlug.selectAncestorLogicalIndex(geomIndex);
MPlugArray outputs_plugArr;
outputPlug.connectedTo(outputs_plugArr, false, true);
if(!outputs_plugArr.length()) {
return MS::kSuccess;
}
outputPlug = outputs_plugArr[0];
MFnDependencyNode mesh_dn(outputPlug.node());
...