Hi Manny, I think the problem is that the deform method gets points that could come from a surface or a curve or particles, or any combination of those, so there aren't always normals available. Having said that, if you know you will have normals available that match points you can get them in the deform method, but not from the MItGeometry. (I don't think MItGeometry knows what object it came from and it only holds points). Instead get the normals separately and check that the counts match.
In a simple implementation, when you know its a mesh, add a mesh attribute to the node and use the MDataBlock to get a dataHandle to the mesh object and create a MItMeshVertex from that object.
MItMeshVertex vtxIter(inMeshObject, &status);
Then in the loop in the deform method you can use the index of the current point to get the normal from the equivalent element of the MItMeshVertex you just created:
MVector normal;
int uselessInt = 0;
for ( iter.reset(); !iter.isDone(); iter.next() ) {
vtxIter.setIndex(iter.index(), uselessInt);
vtxIter.getNormal(normal, MSpace::kWorld);
// do something with the normal such as push the point along it
}
You should probably check that the MItMeshVertex has the same number of vertices as the MItGeometry. They both have a count() method.
--
to print out variable values you can use cerr. You need to include MIOStream.h
example:
MVector normal(1,0,0);
cerr << "value of normal is" << normal << endl; // prints the value of normal. endl is a new line.
it works for arrays and matrices and any MString and more.
For example
cerr << myDagPath.partialName() << endl;
cerr << myVectorArrayFunctionSet.array() << endl;
Hope it helps.