blender-core-api

Guide correct Blender Python access to bpy.data, bpy.context, bpy.ops, RNA, and depsgraph evaluated data.

30|4|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Impertio-Studio/Blender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package --skill blender-core-api-impertio-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: blender-core-api
Source: https://github.com/Impertio-Studio/Blender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package/tree/main/skills/blender/core/blender-core-api
Command: npx skills add https://github.com/Impertio-Studio/Blender-Bonsai-ifcOpenshell-Sverchok-Claude-Skill-Package --skill blender-core-api-impertio-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents common Blender Python failures caused by incorrect access patterns to bpy.data, bpy.context, bpy.ops, and dependency-graph evaluation, which can produce broken scripts, crashes, or silent wrong results.

Core Features & Use Cases

  • Correct bpy.data access patterns: Use direct BlendData manipulation (fast and stable) and handle ID lifecycle safely across saves, orphaning, and undo boundaries.
  • Context-safe bpy.ops invocation: Invoke operators only with the right active object, mode, and area/region context, using poll checks and temp_override to avoid Blender-version breakages.
  • Accurate depsgraph evaluation: Read evaluated (post-modifier) geometry and instances correctly, including proper to_mesh/to_mesh_clear lifecycle management.
  • RNA introspection and version-aware migration: Inspect properties via bl_rna and apply version-specific rules for Blender 3.x/4.x/5.x to avoid deprecated APIs.

Quick Start

Ask Claude to produce a Blender 4.x Python snippet that reads the evaluated mesh of the active object (including modifiers) and prints each evaluated vertex in world space while correctly clearing the temporary evaluated mesh.

Frequently Asked Questions about blender-core-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I get the evaluated mesh from a Blender object including modifiers using Python?

To get the evaluated mesh in Blender Python, use depsgraph.evaluated_get on the object, then call to_mesh to extract modifier-aware geometry, ensuring you call to_mesh_clear afterward to prevent memory leaks.

Why does bpy.ops fail with a context error in Blender Python scripting?

bpy.ops fails in Blender Python when the context lacks the correct active object, mode, or area. Always perform an operator poll check first and use context.temp_override to supply the required context safely.

What is the correct way to override context for bpy.ops operators in Blender 4.x?

The correct way to override context in Blender 4.x is using context.temp_override, passing the necessary area, region, and active object, while checking the operator's poll method before invocation.

How do I safely read evaluated geometry and instances from the Blender dependency graph?

Safely read evaluated geometry from the Blender dependency graph by getting the evaluated object via depsgraph, extracting geometry with to_mesh, processing instances, and mandatorily clearing it with to_mesh_clear.

Can I use direct bpy.data manipulation instead of bpy.ops for automated Blender scripting?

Yes, direct bpy.data manipulation is preferred for automated Blender scripting because it is faster and more stable, avoiding context dependencies and undo caching issues associated with bpy.ops operators.

How do I avoid Blender Python API deprecation across versions 3.x, 4.x, and 5.x?

Avoid Blender Python API deprecation across versions by using RNA introspection via bl_rna to inspect properties and applying version-specific rules for Blender 3.x, 4.x, and 5.x APIs.