VP 2.0 provides a very convenient way for plugin developers to draw some simple basic UI elements such as lines, circles, arcs, text, …. In Maya 2016, it now provides the ability to support drawing icons. By using MUiDrawManager, plugin developers do not need to consider the different GPU device, it will work for all.
MUiDrawManager is very powerful, some developers mention that they are trying to use that as much as possible. Actually, we provide several interfaces for partners to use MUiDrawManager in different context which includes:
For more details about using MUiDrawManager with the above interfaces, please check out the Maya online SDK help here. But before really using this class, there is something important you need to know first.
Unlike other Draw API which are used as immediate mode drawing, MUiDrawManager is different, it does not draw anything in the scene directly. Instead, this API will queue the draw operations in a special ‘retain’ mode. In another word, MUiDrawManager does not work with the GPU directly, you cannot access any GPU status while using MUiDrawManager. Also notice that MUiDrawManager only work with MFrameContext instead of MDrawContext. If anyone asks if they can draw some basic elements by using MUiDrawManager, and the draw operation needs to get information from the GPU, the answer is “No”.