gpu-drawing-and-overlays
Installation
SKILL.md
GPU Drawing and Overlays
Trigger
Use this skill when the user:
- Wants to draw lines, points, shapes or text over the 3D viewport or an image editor from an add-on
- Has add-on code with
import bgl,bgl.glEnable,bgl.glLineWidth, or getsModuleNotFoundError: No module named 'bgl'on 5.x - Wants to render something with the GPU into an image from a script, including headless
- Sees
SystemError: GPU functions for drawing are not available in background mode
bgl is gone
bgl wrapped raw OpenGL calls, which Blender's Metal and Vulkan backends cannot honour. It is deprecated on 4.5 LTS and removed in 5.x. Measured: importlib.util.find_spec('bgl') is None on 5.0.1, 5.1.2 and 5.2.1, and still present on 4.5.14. Code that imports it does not register on 5.x at all. Everything below uses gpu, gpu_extras and blf, which work on both 4.5 and 5.x, so no version branch is needed for drawing itself. The no-bgl rule flags leftovers.