What problem does it solve?
This Skill prevents common, production-breaking GPU drawing mistakes in Blender Python—especially the deprecated bgl API and Blender-version-specific shader pitfalls—so your viewport overlays and offscreen renders work reliably.
Core Features & Use Cases
- Correct GPU drawing API: Enforces using Blender’s
gpu module (not bgl, removed in Blender 5.0) for shaders, batches, GPU state, and textures.
- Viewport draw-handler safety: Provides patterns for registering and removing
SpaceView3D draw handlers to avoid leaked “ghost” overlays and crashes.
- Version-safe shader + uniform handling: Covers Blender 3.x vs 4.x/5.x shader name changes and the required uniforms for
POLYLINE_* shaders (including viewportSize and lineWidth).
- Deterministic anti-pattern avoidance: Includes migration checklists and explicit anti-patterns for state restoration, main-thread GPU usage, and freeing
GPUOffScreen.
- Use cases: Custom 2D/3D viewport overlays (lines, filled shapes, textured quads), dashed line visuals, depth-tested debug drawings, and offscreen rendering pipelines.
Quick Start
Ask Claude to generate a Blender Python draw handler that draws a 3D viewport wire overlay using only the gpu module (not bgl), with correct POLYLINE_UNIFORM_COLOR uniforms and guaranteed cleanup in unregister().