Not applicable
04-05-2019
02:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When I use getPoints in MSpace::kObject like this, I get the right (object) points:
MSelectionList selList; MGlobal::getActiveSelectionList(selList, true); MItSelectionList selListIt(selList); if(!selListIt.isDone()) { MDagPath mesh_dagpath; selListIt.getDagPath(mesh_dagpath); mesh_dagpath.extendToShape(); MObject maya_mesh = mesh_dagpath.node(); MFnMesh meshFn(maya_mesh); meshFn.getPoints(points, MSpace::kObject); // Do something with the points } else { MError("No mesh selected."); }
But when I use MSpace::kWorld instead of MSpace::kObject, all vertices are (0,0,0).
I already tried to use
MFnDagNode dagNodeFn(maya_mesh); maya_mesh = dagNodeFn.parent(0);
because I suspect that getPoints is missing the transform node of the mesh, but it did not work either.
What do I need to do to get the right world coordinates?
Solved! Go to Solution.