I'm writing a deformer, that moves vertices based on the positions of its neighbors. Basically, I'm trying to do something similar to a convolve. My question is, how do I get information about the adjacent vertices of a arbitrary vertex from the information given to me by the
MItGeometry?
(Assuming you're working with polygons)
I haven't tested the two methods below but they should work:
1) If you have the mesh MObject you can use:
MItGeometry::index();
MItMeshVertex(MObject);
MItMeshVertex::setIndex();
MItMeshVertex::getConnectedVertices();
2) If you have the MDagPath of your mesh you can use:
MItGeometry::component();
MItMeshVertex ( MDagPath &dagPath, MObject &component);
MItMeshVertex:: getConnectedVertices();
If your MItGeometry was initialized from an MDataHandle then you could get the MObject from MDataHandle::asMesh().
Note: you can't get worldSpace data without having an MDagPath.
-jd
Thanks alot. It seems like the get connected vertices will work perfectly.