Fix: Python: Empty list of drawing.strokes doesn't have length of 0

The API would return `None` if the number of strokes in the drawing was `0`.
Instead this should return a slice that has a length of 0 to be consistent.
This commit is contained in:
Falk David
2024-10-08 11:43:56 +02:00
parent 35c2461130
commit 09ca5a4c5f

View File

@@ -1421,5 +1421,4 @@ class GreasePencilDrawing(_StructRNA):
"""
from _bpy_internal.grease_pencil.stroke import GreasePencilStrokeSlice
num_strokes = self.attributes.domain_size('CURVE')
if num_strokes > 0:
return GreasePencilStrokeSlice(self, 0, num_strokes)
return GreasePencilStrokeSlice(self, 0, num_strokes)