Many classic plugin classes can implement a "Draw" function that allows to draw something in the editor viewport. These "Draw" functions differ from class to class.
A "Draw" function can be found in the following classic base classes:
A "Draw" function is typically called multiple times during the drawing process for different draw passes and for each open viewport window. The given BaseDraw object represents a viewport window and is used to draw in that window.
This is an example implementation of ObjectData::Draw():
Typical tasks in a "Draw" function are:
How to use a BaseDraw object is described in BaseView / BaseDraw Manual.
For objects that can be assigned to layers it might be necessary to check if the assigned layer forbids viewport drawing. See Layer Manual.
If the drawing operations should only be applied to the currently selected viewport window it is needed to check if the given BaseDraw represents the selected viewport.
It is also possible to enable or disable several viewport filters that define what should be visible in the viewport.