In Maya 2016, several APIs were introduced but marked as Not implemented or not mandatory. Some of them are now fully implemented in Maya 2016 Extension 2, and actually now required in your plug-in code. The Completion of native Viewport 2.0 selection feature is one of them. If you wonder why Maya 2016 had some ‘Not implemented’ API but signature present, it was to help binary compatibility between Maya 2016 versions of the plug-ins using these API. However, as you probably figure out now, Maya 2016 Extension 2 is not binary compatible with the Maya 2016 family, but for other reasons.
MPxSurfaceShape::getShapeSelectionMask is one of the must in the Viewport 2.0 native selection API. To make your shape selectable in Viewport 2, you have to override it now.
For general meshes, the code below would be enough.
MSelectionMask apiMesh::getShapeSelectionMask() const
{
MSelectionMask::SelectionType selType = MSelectionMask::kSelectMeshes;
return MSelectionMask( selType );
}
Please update your custom shapes if you want to make it selectable in Maya 2016 Extension 2. The Porting Selection from Viewport 1 to 2 guide has been updated for the latest Maya, please check it out.
Comments
You can follow this conversation by subscribing to the comment feed for this post.