Here is how i used the MfnMesh before
// defining the attribute info so i can plug a path into my shader
// to retrieve the surface mesh info
static MObject aInMesh;
MObject testCode::aInMesh;
aInMesh = tAttr.create(“inMesh”, “im”, MFnData::kMesh);
tAttr.setStorable(true);
tAttr.setKeyable(false);
tAttr.setReadable(true);
tAttr.setWritable(true);
tAttr.setHidden(true);
tAttr.setCached(false);
addAttribute(aInMesh);
attributeAffects(aInMesh, aOutColor);
// from This point on is where the computations start to
// take place in the shader.
// get the InMesh attribute from previous blocks
MObject inMesh = inMeshDataHandle.asMesh();
// here is how i would use the MfnMesh type before
MFnMesh polyMesh(inMesh); <---- mesh Input to access Info
// then from here i should be able to compute and
//access information from the mesh that is inputed
// into my shader
//Examples//
polyMesh.numVertices() <--------accessing number vertices
MFloatPointArray Ppoints;
polyMesh.getPoints(Ppoints,MSpace::kWorld); <—getting points