blender-core-gpu
blender-core-gpu
Quick Reference
Critical Warnings
NEVER use the bgl module — it is deprecated since Blender 3.5 and completely removed in Blender 5.0. ALL drawing code MUST use the gpu module.
NEVER use shader name 3D_UNIFORM_COLOR or 3D_FLAT_COLOR in Blender 4.0+ — the 3D_ prefix was removed. Use UNIFORM_COLOR, POLYLINE_UNIFORM_COLOR, etc.
NEVER forget to restore gpu.state to defaults at the end of draw callbacks — failing to restore state corrupts rendering for ALL subsequent draw handlers and Blender's own UI.
NEVER create gpu.types.GPUOffScreen outside a valid OpenGL/GPU context — offscreen buffers require a graphics context (viewport draw callback or bpy.types.SpaceView3D).
NEVER call gpu.shader.from_builtin() or create batches from a background thread — ALL GPU operations MUST execute on the main thread.
ALWAYS remove draw handlers in addon unregister() — leaked handlers cause crashes or persistent ghost overlays.
ALWAYS set viewportSize and lineWidth uniforms when using POLYLINE_* shaders — these are REQUIRED uniforms (Blender 4.0+).
More from openaec-foundation/blender-bonsai-ifcopenshell-sverchok-claude-skill-package
blender-syntax-materials
>
3blender-agents-code-validator
>
3blender-syntax-panels
>
3blender-errors-data
>
3blender-syntax-data
Covers Blender data management including collections, library overrides, asset system, linked libraries, BlendDataLibraries, data block creation and removal, fake users, and data transfer between files. Activates when managing Blender collections, linking/appending data, working with library overrides, or using the asset system.
3blender-core-api
>
3