
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
The title contains my exact problem. I am trying to implement a class which inherits from MPxSubSceneOverride. I am based in the apiMeshShape plug-in example in Maya's devkit (so the file is called apiMeshSubSceneOverride.cpp). In this example, a polygon mesh is implemented, where each control point corresponds to a vertex in the mesh. Let's say I want to re-use the vertex buffer array of the vertices in the mesh to use as control points, but I want a subset of these vertices to be selectable. I tried modifying the following two lines of code (close to the end of the manageRenderItems function):
// Point vertex buffer is fully sequential, use an empty index buffer to draw non-indexed.
setGeometryForRenderItem(*vertexSelectionItem, wireBuffers, MIndexBuffer(MGeometry::kUnsignedInt32), &bounds);
But I tried to pass a custom MIndexBuffer (let's call it myBuffer) with the custom subset of indices, but Maya keeps selecting the nodes as if they were sequential! That is, given the MIndexBuffer myBuffer = [5, 11, 17, 18, 21], if I use the marquee to chose the vertex 17, it will chose the vertex 2 (as the index 17 is in the third position of the MIndexBuffer). Is there a way to force Maya to choose the value in the index array? Thanks in advance!
Solved! Go to Solution.