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
This commit is contained in:
Pullusb 2026-03-26 11:04:50 +01:00 • committed by Thomas Dinges
parent 2719ae9b79
commit 08f823dcd8

View file

@ -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."),