GreasePencilDrawing(bpy_struct)#
base class — bpy_struct
- class bpy.types.GreasePencilDrawing(bpy_struct)#
A Grease Pencil drawing
- attributes#
Geometry attributes
- Type:
AttributeGroupGreasePencilDrawing
bpy_prop_collection
ofAttribute
, (readonly)
- color_attributes#
Geometry color attributes
- Type:
AttributeGroupGreasePencilDrawing
bpy_prop_collection
ofAttribute
, (readonly)
- curve_offsets#
Offset indices of the first point of each curve
- Type:
bpy_prop_collection
ofIntAttributeValue
, (readonly)
- type#
Drawing type
- Type:
enum in [‘DRAWING’, ‘REFERENCE’], default ‘DRAWING’, (readonly)
- user_count#
The number of keyframes this drawing is used by
- Type:
int in [-inf, inf], default 0, (readonly)
- strokes#
Return a collection of all the Grease Pencil strokes in this drawing.
Note
This API should not be used for performance critical operations. Use the
GreasePencilDrawing.attributes
API instead.Note
When point/curves count of a drawing is changed, the slice returned by this call prior to the change is no longer valid. You need to get the new stroke slice via drawing.strokes[n].
(readonly)
- add_strokes(sizes)#
Add new strokes with provided sizes at the end
- Parameters:
sizes (int array of 1 items in [1, inf]) – Sizes, The number of points in each stroke
- remove_strokes(*, indices=(0,))#
Remove all strokes. If indices are provided, remove only the strokes with the given indices.
- Parameters:
indices (int array of 1 items in [0, inf], (optional)) – Indices, The indices of the strokes to remove
- resize_strokes(sizes, *, indices=(0,))#
Resize all existing strokes. If indices are provided, resize only the strokes with the given indices. If the new size for a stroke is smaller, the stroke is trimmed. If the new size for a stroke is larger, the new end values are default initialized.
- Parameters:
sizes (int array of 1 items in [1, inf]) – Sizes, The number of points in each stroke
indices (int array of 1 items in [0, inf], (optional)) – Indices, The indices of the stroke to resize
- tag_positions_changed()#
Indicate that the positions of points in the drawing have changed
- classmethod bl_rna_get_subclass(id, default=None)#
- Parameters:
id (str) – The RNA type identifier.
- Returns:
The RNA type or default when not found.
- Return type:
bpy.types.Struct
subclass