/blender-developer-tools:curves-and-textfrom blender-developer-tools
Builds legacy Curve and TextCurve datablocks from Python, covering splines, bezier points, bevel settings, and 3D text. Useful when scripting beveled tubes, wires, logos, or reading tessellated geometry.
Ships in blender-developer-tools. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use this skill when the user:
bpy.data.curves.new, type='CURVE' or type='FONT')splines, bezier_points, bevel_depth, bevel_resolution, use_fill_caps, extrude, TextCurve, body, align_x, or BfontReferenceError reading a mesh after to_mesh_clear()A curve or text object is a Curve datablock, not a mesh. Author it on the data API, link an object to a collection, and read geometry only through the depsgraph:
import bpy
curve = bpy.data.curves.new("Tube", 'CURVE') # 'FONT' returns a TextCurve
curve.dimensions = '3D'
curve.bevel_depth = 0.15
curve.use_fill_caps = True
spline = curve.splines.new('BEZIER')
spline.bezier_points.add(3) # one point exists already -> 4
for i, bp in enumerate(spline.bezier_points):
bp.co = (i, 0.0, 0.15)
bp.handle_left_type = 'AUTO'
bp.handle_right_type = 'AUTO'
obj = bpy.data.objects.new("Tube", curve)
bpy.context.collection.objects.link(obj)
No operator, no mesh conversion: the tube renders from the curve settings. The curve and text APIs taught here do not diverge between 4.5 LTS and 5.x; the examples run the same code on 4.5 LTS, 5.1 and 5.2 LTS, and the curve tessellation counts are identical across them. The one version split nearby is bpy.app.version_string (see Text below).
splines.new('BEZIER') creates a spline that already holds one point. bezier_points.add(n - 1) gives n points; add(n) gives n + 1.bp.co is the point; handle_left_type / handle_right_type = 'AUTO' lets Blender place smooth handles. For exact shapes (a straight leg, a quarter-circle bend), set both types to 'FREE' first, then write bp.co, bp.handle_left, bp.handle_right.bevel_depth is the tube radius. bevel_resolution and resolution_u set the cross-section and along-curve sampling.use_fill_caps = True closes the ends of an open spline with faces. Without it the ends are hollow; the caps exist only in the evaluated mesh, so check them there.Measured closed forms (curve-bevel-arc, a semicircle of radius 1.5, centerline at z = bevel_depth):
| Quantity | Value |
|---|---|
| Evaluated Z span | [0, 2 * bevel_depth] (the tube rests on the floor) |
| Evaluated X span | 2 * radius + 2 * bevel_depth |
Verts / faces (8 points, bevel_resolution 4, resolution_u 12, caps on) | 1044 / 1028 — measured, no closed form |
Tessellation counts have no simple formula. Treat them as a regression pin, never derive them.
import bpy, math
BEVEL, RADIUS, N = 0.15, 1.5, 8
cu = bpy.data.curves.new("Arc", 'CURVE')
cu.dimensions = '3D'
cu.bevel_depth = BEVEL
cu.bevel_resolution = 4
cu.resolution_u = 12
cu.use_fill_caps = True
sp = cu.splines.new('BEZIER')
sp.bezier_points.add(N - 1)
for i, bp in enumerate(sp.bezier_points):
a = i / (N - 1) * math.pi
bp.co = (RADIUS * math.cos(a), RADIUS * math.sin(a), BEVEL)
bp.handle_left_type = 'AUTO'
bp.handle_right_type = 'AUTO'
obj = bpy.data.objects.new("Arc", cu)
bpy.context.collection.objects.link(obj)
bpy.context.view_layer.update()
ev = obj.evaluated_get(bpy.context.evaluated_depsgraph_get())
me = ev.to_mesh()
try:
zs = [v.co.z for v in me.vertices]
xs = [v.co.x for v in me.vertices]
n_faces = len(me.polygons)
finally:
ev.to_mesh_clear()
assert len(cu.splines[0].bezier_points) == N
assert n_faces > 0
assert abs(min(zs)) < 1e-4 and abs(max(zs) - 2 * BEVEL) < 1e-4
assert abs((max(xs) - min(xs)) - (2 * RADIUS + 2 * BEVEL)) < 0.05
bpy.data.curves.new(name, type='FONT') returns a bpy.types.TextCurve, which is also a bpy.types.Curve; the object's type is 'FONT'. The built-in font (font.name contains "Bfont", "Bfont Regular") is assigned and loaded even under --background, so no font file is needed.
body is plain assignable text. Editing it regenerates the geometry: more characters give a strictly wider evaluated mesh.align_x = 'CENTER', align_y = 'CENTER' center the text on the object origin.extrude, no bevel_depth) is already filled: the evaluated mesh has faces, and its Z extent is 0.extrude and bevel_depth give exact solids: evaluated Z extent = 2 * (extrude + bevel_depth), and a round bevel pushes an upright glyph's outline out by exactly bevel_depth.bpy.data.fonts.load(path, check_existing=True). Blender ships fonts under bpy.utils.system_resource('DATAFILES') + fonts/ (Inter.woff2, DejaVuSansMono.woff2 on 4.5 LTS and 5.x). On 4.5 LTS, Inter's variable-font outlines are built with broken counters, so use DejaVuSansMono.woff2 there. Bfont's "1" is a bare stem that reads as a capital I.Version split: bpy.app.version_string is "5.1.2" on 5.x but "4.5.11 LTS" on 4.5. Use it as display text in body if you like, but branch on the bpy.app.version tuple, never on the string.
import bpy
EXTRUDE, BEVEL = 0.06, 0.02
txt = bpy.data.curves.new("Stamp", type='FONT')
txt.body = bpy.app.version_string
txt.align_x = 'CENTER'
txt.align_y = 'CENTER'
txt.extrude = EXTRUDE
txt.bevel_depth = BEVEL
txt.bevel_resolution = 3
obj = bpy.data.objects.new("Stamp", txt)
bpy.context.collection.objects.link(obj)
deps = bpy.context.evaluated_depsgraph_get()
deps.update()
ev = obj.evaluated_get(deps)
me = ev.to_mesh()
try:
zs = [v.co.z for v in me.vertices]
n_faces = len(me.polygons)
finally:
ev.to_mesh_clear()
assert isinstance(txt, bpy.types.TextCurve) and isinstance(txt, bpy.types.Curve)
assert obj.type == 'FONT' and "Bfont" in txt.font.name
assert n_faces > 0
assert abs((max(zs) - min(zs)) - 2 * (EXTRUDE + BEVEL)) < 1e-4
obj.data on a curve or text object is the Curve, so it has no vertices. The tessellated mesh (bevel, caps, extrude, glyph fill) exists only after evaluation: obj.evaluated_get(depsgraph).to_mesh(), then to_mesh_clear() in a finally. After to_mesh_clear() the returned Mesh is dead and any access raises ReferenceError; copy out the numbers you need first. The full lifetime contract is in depsgraph-and-evaluated-data § The lifetime rule.
After changing curve settings or body in the same script, call bpy.context.view_layer.update() or depsgraph.update() before evaluating again, as both examples do.
Reading obj.data.vertices on a curve or text object. The Curve has no vertices. Evaluate and use to_mesh().
bezier_points.add(n) for n points. The spline starts with one point; this yields n + 1.
Forgetting use_fill_caps. An open beveled spline renders as a hollow pipe. The caps are faces in the evaluated mesh, not a flag to re-read.
Treating bevel_depth as a diameter. It is the radius: a tube spans 2 * bevel_depth, and text Z extent is 2 * (extrude + bevel_depth).
Exact bevel growth on every glyph edge. Straight sides grow by exactly bevel_depth; curved glyphs overshoot (#505). Use a band.
Converting to a mesh or calling curve operators to get a tube. Bevel, caps and extrude render straight from the Curve datablock.
Deriving tessellation counts. Vert/face counts are measured regression pins (1044 / 1028 for the arc above), not closed forms.
Shipping a font file for headless text. Bfont is built in and loaded under --background.
Parsing version_string as semver. "4.5.11 LTS" breaks it. Compare bpy.app.version tuples.
Using the mesh after to_mesh_clear(). ReferenceError. Read first, clear in finally.
examples/curve-bevel-arc/ — Bezier semicircle with bevel_depth, use_fill_caps, measured tessellation and closed-form spans; falsifier --no-caps (exit 7).examples/text-version-stamp/ — TextCurve with body, Bfont, extrude/bevel closed forms, the #505 trailing-glyph band, and the dead-mesh ReferenceError; falsifier --wrong-body (exit 4).depsgraph-and-evaluated-data — evaluated_get / to_mesh / to_mesh_clear lifetimes.Each example runs headless, asserts the contract, and exits non-zero when it breaks. Run one with blender --background --python <script> --; pass a falsifier flag to watch the check fail.
curve-bevel-arc: A beveled Bezier semicircle authored on bpy.types.Curve — splines.new('BEZIER'), bezier_points, bevel_depth, use_fill_caps — so the curve renders as a solid tube without a prior mesh conversion. Falsify: --no-caps (exit 7).text-version-stamp: The TextCurve data API — curves.new(type='FONT'), live body text from bpy.app.version_string, extrude and bevel_depth solids, and evaluated-mesh conversion. Falsify: --wrong-body (exit 4).bpy.types.Curve: https://docs.blender.org/api/current/bpy.types.Curve.htmlbpy.types.TextCurve: https://docs.blender.org/api/current/bpy.types.TextCurve.htmlbpy.types.Spline: https://docs.blender.org/api/current/bpy.types.Spline.htmlbpy.types.BezierSplinePoint: https://docs.blender.org/api/current/bpy.types.BezierSplinePoint.htmlbpy.types.Object.to_mesh: https://docs.blender.org/api/current/bpy.types.Object.html#bpy.types.Object.to_meshCurve: https://docs.blender.org/api/4.5/bpy.types.Curve.htmlTextCurve: https://docs.blender.org/api/4.5/bpy.types.TextCurve.htmlSpline: https://docs.blender.org/api/4.5/bpy.types.Spline.htmlWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
27 skills in this plugin
/addon-scaffoldingScaffold a Blender add-on as an Extensions Platform package: blender_manifest.toml, modular file layout, register_classes_factory, symmetric register/unregister. Use when the user starts a new add-on or extension, writes or fixes blender_manifest.toml, asks which layout or registration pattern to use on Blender 4.5 LTS or 5.x, or has classes that fail to register or unregister cleanly. Targets 5.2 LTS with 4.5 LTS fallback./ai-mesh-cleanupOrdered cleanup for an imported generated or scanned mesh before it goes to an engine: scene units, apply rotation and scale, origin to base, recalculate normals, evaluated triangle count, decimate to a budget, convex collider. Use when the user has a GLB, glTF or FBX that is not engine-ready, mentions unit scale, unapplied transforms, triangle budget, LODs or a collision hull, or is about to run mesh operations on an import without checking its scale. Targets 5.2 LTS with 4.5 LTS fallback./bake-high-to-lowCage-bake high-poly surface detail onto a low-poly target as a tangent-space normal map with bpy.ops.object.bake (Cycles, selected-to-active, active Image Texture node, UV layer, save_render). Use when the user wants a normal map from a dense mesh onto a game-resolution or decimated LOD, mentions cage_extrusion or use_selected_to_active, or gets a bake that returns CANCELLED, comes out black or flat, or fails with 'No active UV layer found'. Targets 5.2 LTS with 4.5 LTS fallback./blender-rulesBlender Python anti-pattern rules (bmesh leaks, bpy.ops in loops, deprecated context-copy overrides, bulk mesh writes, prop annotations and context guards, Extensions manifest, import scale, export modifiers, glTF/FBX axis RNA, the removed bgl module, the normals API removed in 4.1). Use when writing, reviewing or fixing any bpy / Blender add-on or script code./bl-info-migrationMigrate a legacy bl_info add-on to the Extensions Platform in three steps, with a before/after diff and the dual-format pattern. Use when the user has a bl_info dictionary in __init__.py, asks whether bl_info is deprecated or still supported, wants to publish to extensions.blender.org or ship an extension .zip, or sees warnings about legacy add-ons at install time. Targets 5.2 LTS; manifests work from 4.2./compositor-nodesBuild and render through the scene compositor from Python across the 4.5 LTS to 5.x split: scene.use_nodes plus scene.node_tree and a Composite node on 4.5, a CompositorNodeTree node group assigned to scene.compositing_node_group with interface sockets and a Group Output on 5.x, a Render Layers to Glare (Fog Glow) chain, the Glare node's move from enum properties to menu input sockets, and render.use_compositing. Use when the user scripts compositor nodes, adds bloom or glow, hits AttributeError on scene.node_tree in 5.x, sets glare_type or quality and gets AttributeError on 5.x, looks for the removed EEVEE use_bloom toggle, or renders and sees no compositor effect. Targets 5.2 LTS with 4.5 LTS fallback.npx claudepluginhub tmhsdigital/blender-developer-tools --plugin blender-developer-toolsOther plugins' skills for the same job