MPxSubSceneOverride selection of non sequential vertices

MPxSubSceneOverride selection of non sequential vertices

Anonymous
Not applicable
437 Views
1 Reply
Message 1 of 2

MPxSubSceneOverride selection of non sequential vertices

Anonymous
Not applicable

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!

 

0 Likes
Accepted solutions (1)
438 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

I reply to myself. I found out there is a chance to make component conversion through a custom implementation of MPxComponentConverter, where I can do this vertex selection I wanted.

0 Likes