Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Edge/Face selection with apiMeshShape example (legacy Viewport)

Edge/Face selection with apiMeshShape example (legacy Viewport)

Anonymous
Not applicable
356 Views
0 Replies
Message 1 of 1

Edge/Face selection with apiMeshShape example (legacy Viewport)

Anonymous
Not applicable

Hello!

 

It is me again, trying to fully understand the apiMeshShape example of the devkit. As we all know now, legacy Viewport is disabled by default in Maya 2018, but in the plugin I am developing I would like to give support to both viewports. I think edge and face selection works almost straight out of the box with the appropriate buffers in the SubSceneOverride class for viewport 2.0, however, I am having trouble to perform the same tasks in the legacy viewport (apiMeshShapeUI class). I have four main questions I would love to get an answer to:

 

1. In the "select" routine, does the selection routine of an M3dView work with primitives other than points? If I draw a line or a triangle, will the collision get detected?

 

2. In the "select" routine, I feel the MSelectInfo class is not giving me some information I would like to have. For example, I've seen the method detects intersection with vertices even when I don't click (which is useful to highlight vertices close to the marquee), but I don't know if the user is clicking or not! It seems I just pass the "collision" list and maya decides weather to add the vertices to the selection list or not, depending if the user clicked or not.

 

3. I would also like to get through the API the selection mode to highlight vertices, edges or faces (as selected components, and also when the mouse hovers over them). I guess this has to be done in the getDrawRequests method, but (at least I am skipping some details) it seems the apiMeshShape is written to only work with vertex selection.

 

4. After all this works, am I supposed to keep different selection lists for the vertex/edge/face components? I've seen functions in the apiMeshShape example that transform each edge/face into the corresponding vertices, but I don't know if this is just to apply the tweaks or to avoid having three selection lists.

 

An answer to any of these four questions will be greatly appreciated. Thank you in advance for your time!

0 Likes
357 Views
0 Replies
Replies (0)