Hi, thanks for the reply. After more testing, it was working the way I did, but my debug messages with MGlobal::displayInfo didn't display anything...
I'm testing with the bulgeMesh deformer of Chad Vernon from CGCircuit, and if I try to display the name of the inputGeom like this: MGlobal::displayInfo(fnMesh.name()); it doesn't display anything. I've tried with different attributes without luck. Then I tried with the normal values that Chad use in his plugin. Now I see the values with displayInfo. And after try the same thing in my MPxCommand, I see the normals values too. Anyone knows why I can't display the fnMesh name taken from a MDataHandle? Thanks. On Mon, Mar 2, 2015 at 1:44 PM, f.michal <[email protected]> wrote: > W dniu 2015-03-02 o 13:18, Miguel González Viñé pisze: > > Hi all, >> >> I'm doing a c++ deformer node and a MPxCommand to create some info inside >> the deformer. >> >> I'm trying to get the MFnMesh of the object before any deformations >> through a MPlug because as I'm in the MPxCommand class I don't know how to >> get the datablock. >> >> The problem is that when I get the connected node to my >> deformer.input[0].inputGeometry, >> I get a node of type "groupParts" and inside this "groupParts" node I see >> an attribute called "input geometry" with a tweak node connected to. >> >> So, what's the best way to get the orig geometry outside the >> MPxDeformerNode class? >> >> > 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()); > > ... > > -- > You received this message because you are subscribed to the Google Groups > "Python Programming for Autodesk Maya" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/python_inside_maya/54F45B23.4010702%40gmail.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CABbyGYyCzweFuDn9osAO7TLjuwSPmpHxqMdDLe59Yxk%3DGXRk7g%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
