What problem does it solve?
This Skill prevents common Blender Python runtime failures that cause crashes, freezes, invalid references after undo/redo, and broken event handling when writing addon and automation code.
Core Features & Use Cases
- Thread-safety guardrails: Ensures Blender API calls never run from background threads by routing bpy work through
bpy.app.timers (worker threads may do pure computation only).
- Undo/redo-safe reference patterns: Avoids
ReferenceError and dangling pointers by storing names/identifiers instead of bpy.data object references across undo boundaries.
- Correct event + callback usage: Uses
@persistent handlers, proper handler cleanup on unregister(), safe msgbus subscriptions, and timer return conventions to keep addons stable across file loads.
- Correct math + spatial queries: Enforces safe mathutils usage (
@ for matrix multiplication, .length_squared for comparisons) and correct KDTree/BVHTree workflows (kd.balance(), evaluated depsgraph for BVHTree).
- Use Case: Build a Blender addon that listens to depsgraph changes, offloads heavy computations to threads, and updates geometry safely without freezing or crashing after undo/redo.
Quick Start
Use the blender-core-runtime Skill when your Blender Python addon intermittently crashes, freezes, or errors after undo/redo, or when background-thread code must interact with bpy safely.