ed3c16624bbd3b0726225e418f50bc704a3b46e9
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
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
