This extends the `GreasePencilDrawing` rna type using python.
The goal is to add an API that allows developers to transition to
the new grease pencil API a bit more smoothly.
Adds the following endpoints to the `GreasePencilDrawing`:
* `drawing.strokes`: Returns a list/slice of `GreasePencilStroke`s in the drawing.
Adds a python class `GreasePencilStroke`:
* `stroke.points`: Returns a list/slice of `GreasePencilStrokePoint`s.
* Getters/Setters of attributes for this stroke:
* `stroke.cyclic`
* `stroke.material_index`
* `stroke.select`
* `stroke.softness` (used to be `hardness`)
* `stroke.start_cap`
* `stroke.end_cap`
* `stroke.curve_type`: The type of curve: `POLY`,`BEZIER`,`CATMULL_ROM`,`NURBS`.
* `stroke.aspect_ratio`
* `stroke.fill_opacity`
* `stroke.fill_color`
* `stroke.time_start`
* High-level functions:
* `stroke.add_points(count)`: Adds `count` points at the end of the stroke.
* `stroke.remove_points(count)`: Removes `count` points from the end of the stroke. Note that this will not remove the stroke if the count is greater than the number of points in the stroke. A stroke has at least 1 point. Removing strokes can be done from the drawing.
Adds a python class `GreasePencilStrokePoint`:
* Getters/Setters of attributes for this point:
* `position`
* `radius`
* `opacity`
* `select`
* `vertex_color`
* `rotation`
* `delta_time`
Note that `GreasePencilStroke` and `GreasePencilStrokePoint` are not stored in the file and don't have an RNA API. This means that they are not compatible with e.g. `layout.prop`.
This API should not be used for performance critical code. It's likely
even slower than the python API from 4.2.
There will be migration documentation for addon developers here:
https://developer.blender.org/docs/release_notes/4.3/grease_pencil/#python-api-changes
Pull Request: https://projects.blender.org/blender/blender/pulls/125599