Custom shape selection

Custom shape selection

Anonymous
Not applicable
845 Views
2 Replies
Message 1 of 3

Custom shape selection

Anonymous
Not applicable

Hello everyone!!

 

I have developed a custom shape node and a subsceneoverride which draws all the geometry for this object. The shape do not implements almost nothing. Just bounding boxes methods. Its just a kind of placeholder connected to an specific shader. Lets say its an entry point.

 

Now, i would like this custom shape to be selectable. I have implemented the UI class, registered in the MFnPlugin registerShape method. The custom shape works like a charm but the UI class does not seem to be constructed. Some std::couts in the constructor and in the select method says that its never constructed.

 

Any idea??

0 Likes
Accepted solutions (1)
846 Views
2 Replies
Replies (2)
Message 2 of 3

negow
Advocate
Advocate
Accepted solution

The UI class, assuming you are talking about MPxSurfaceShapeUI, is only applicable to Viewport 1.0. Selection with MPxSubSceneOverride and Viewport 2.0 is handled within the override itself, on the render items you create. For each render item, try calling `renderItem->setSelectionMask(MSelectionMask::kSelectHandles);`

And choose between the various masks available here.

 

https://help.autodesk.com/view/MAYAUL/2020/ENU/?guid=__cpp_ref_class_m_selection_mask_html#acffca3b3...

Message 3 of 3

Anonymous
Not applicable

Thank you so much!!

0 Likes