Use separate render item for selection only?

Use separate render item for selection only?

Anonymous
Not applicable
623 Views
3 Replies
Message 1 of 4

Use separate render item for selection only?

Anonymous
Not applicable

Hi

I have this problem where I have a custom component shape and I want to use a separate render item for selection only that renders components as low-poly geometry. I though this could be achieved by creating the render item and setting the draw mode to kSelectionOnly. However, when using Maya's Select tool, component selection works only when clicking on individual components. If I try to select with marquee rectangle, component converter for my selection render item is not called at all and  refineSelectionPath() method is called only for other render items visible in the viewport.

 

Is this kind of setup possible at all or am I doing something wrong to prevent the Select tool work properly with marquee selection?

PS I'm using Maya 2018.2

Kind regards, Mila

0 Likes
624 Views
3 Replies
Replies (3)
Message 2 of 4

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

kSelectionOnly means the renderitem will be only used for selection and it won't be drawn. I don't think you need to create them.

 

For your original request, I think creating a MRenderItem with a customer vertex generator could be helpful here. apiMeshGeometryOverride::updateActiveVerticesItem in the apiMeshShape has an option to enable a custom stream(apiMeshSharedVertexStream).

 

Yours,

Li

0 Likes
Message 3 of 4

Anonymous
Not applicable

I feel I did not express my problem right. Let me try again:

 

I create MRenderItem with custom vertex streams, set its draw mode to MGeometry::kSelectionOnly to be used for selection only (i.e. not draw in the viewport). I register a component converter for it to properly calculate component ids for my shape.

However, when I use Maya Select tool if I click on individual components they are selected properly. If I try to select with marquee selection this doesn't work at all - my shape is deselected. If I instead use MGeometry::kAll as draw mode of this render item, marquee selection works properly now but it is visible in the viewport and which I want to avoid.

I hope I'm more clear now. Thank you!

Best regards, Mila



0 Likes
Message 4 of 4

cheng_xi_li
Autodesk Support
Autodesk Support

Hi,

 

Could you send me a sample? I need to look at it and might need to discuss with our engineers.

 

P.S. It could take a while. Thursday and Friday are holidays here and I will be on travelling this weekend.

 

Yours,

Li

0 Likes