I will be posting my weekly progress here in this thread. You can also find all the reports on my blender wiki page.
Week 1 (June 01 - 07)
- Added a dummy operator mainly to test the curve data structure that was added to the
bGPDstrokedata structure now has a
bGPDcurvestructure. This holds an array of
BezTriplethat will represent the curve points.
- Implemented the RNA structure for
- Added reading and writing of the
bGPDcurvestructure to file.
- Added a toggle button for the edit curve mode in the header bar of grease pencil edit mode
Week 2 (June 08 - 14)
- Implemented a function to create a bézier curve from a grease pencil stroke. It uses the algorithms defined in
- When the user switches to curve edit mode, the selected strokes will automatically be used to generate their curves.
- Implemented a function to (re)create grease pencil stroke points from a bézier curve.
- Implemented interpolation for pressure, strength and vertex colors between curve points. Currently this uses linear interpolation.
- When the coordinates, strength, pressure or vertex color of the curve points change, an update of the stroke points is automatically triggered.
- Implemented the
select_alloperator to make it work with curve points if the object is in curve edit mode. This includes deselection and invert selection.
- Implemented the
select_lessoperator for curve points.
- Added a
curve_resolutionparameter to the
bGPdatastructure. This parameter controls the number of segments that get created when the editcurve is transformed back into a stroke (visually this controls how smooth the stroke looks).
- When the
curve_resolutionparameter changes, the stroke is automatically updated.
Week 3 (June 15 - 21)
- Added a
error_thresholdproperty to the
select_alloperator. When a stroke is first converted to a curve, the fitting can be adjusted with this parameter.
- Implemented click selection for curve points and handles. This includes deselection for clicking in empty space, toggle selection and extend selection (with
shift). The selection also takes the overlay settings into account, e.g. if a handle is not displayed it cannot be selected.
- Implemented basic transformation for curve points. This includes translation, rotation, scaling, changing the thickness and changing the strength/opacity for every curve point. The handles are treated as type
freeand do not move with the control point for now.
- Exiting curve edit mode deselects all the stroke points and strokes on the current frame. This will change later, as we aim to synchronize the selection between strokes and edit curves.
Week 4 (June 22 - 28)
- Worked on selection synchronization when entering/exiting curve edit mode. Currently, if a handle is selected, the corresponding stroke point of the control point will be selected. If two neighbouring handles are selected, all of the stroke points in between will additionally be selected.
- More conceptual work was done on solving a code design issue, when it comes to the curve fitting. We would want the fitting to be triggered when the user selects a stroke in curve edit mode. More details on this issue can be found in this devtalk thread.
Week 5 (June 29 - July 05)
- Added an operator to set the handle type of a curve point (
- Added a BKE function to recalculate the handle positions depending on the type (
- Support transformation of all handle types.
- Added custom shortcuts for curve edit mode. Currently there are only two shortcuts (
Vto toggle the handle type and
Uto toggle curve edit mode). All the usual shortcuts in edit mode still work in curve edit mode, unless they are overwritten (e.g.
Vis “split” in edit mode, but “toggle handle type” in curve edit mode). They can all be changed through the keymap editor.
- Fixed some crashes when editing points in edit mode and when editing individual handles.
- Reworked parts of the handling of the conversion from curve to stroke and vice versa. Both the stroke and the curve now have a flag that indicates they are no longer synchronized with the other data structure. This allows us to recalculate stroke and curve data only when needed.