From 2c7b7056589eab53d3487db05adf9ae4db21e9b5 Mon Sep 17 00:00:00 2001 From: Pullusb Date: Thu, 26 Mar 2026 11:04:50 +0100 Subject: [PATCH] Grease Pencil: Expose strokes fill_id and hide_stroke attributes to high level python API Expose grease pencil `fill_id` and `hide_stroke` attributes to high level python API. This allows to easily get or set those attributes using the stroke object itself in scripts or interactive console. #### Usage: For the example, let's store a drawing (first frame on first layer of an active GP object): `drawing = bpy.context.object.data.layers[0].frames[0].drawing` Using low level API: `drawing.attributes['fill_id'].data[0].value = 1` `drawing.attributes['hide_stroke'].data[0].value = True` Now also possible directly on stroke object with high level API: `drawing.strokes[0].fill_id = 1` `drawing.strokes[0].hide_stroke = True` Pull Request: https://projects.blender.org/blender/blender/pulls/156246 --- scripts/modules/_bpy_internal/grease_pencil/stroke.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/modules/_bpy_internal/grease_pencil/stroke.py b/scripts/modules/_bpy_internal/grease_pencil/stroke.py index e44dfaab500..d7b05580518 100644 --- a/scripts/modules/_bpy_internal/grease_pencil/stroke.py +++ b/scripts/modules/_bpy_internal/grease_pencil/stroke.py @@ -285,6 +285,8 @@ class GreasePencilStrokePointSlice(SliceHelper): ("cyclic", "cyclic", 'BOOLEAN', False, "The closed state for this stroke."), ("material_index", "material_index", 'INT', 0, "The index of the material for this stroke."), + ("fill_id", "fill_id", 'INT', 0, "The fill id of this stroke."), + ("hide_stroke", "hide_stroke", 'BOOLEAN', False, "The stroke visibility state."), ("softness", "softness", 'FLOAT', 0.0, "Used by the renderer to generate a soft gradient from the stroke center line to the edges."), ("start_cap", "start_cap", 'INT8', 0, "The type of start cap of this stroke."),