Page MenuHome

GPencil: New bézier stroke type
Closed, ArchivedPublicTO DO

Authored By
Falk David (filedescriptor)
Feb 17 2021, 11:32 PM
"100" token, awarded by frogstomp."Love" token, awarded by hamza.elbarmaki."Love" token, awarded by luckykadam."Pterodactyl" token, awarded by Gavriel5578."Love" token, awarded by YAFU."Love" token, awarded by lone_noel."Love" token, awarded by damian."Love" token, awarded by Yuro."Love" token, awarded by charlie."Love" token, awarded by Bit."Love" token, awarded by jsm.


Status: In development.


Commissioner: @Antonio Vazquez (antoniov)
Project leader: @Falk David (filedescriptor)
Project members: @Daniel Martinez Lara (pepeland), @Matias Mendiola (mendio)


Big picture: The goal is to make a bézier-curve-based workflow possible that covers all areas in grease pencil (Drawing, Editing, Sculpting, etc.).

  • Introduce curves as a new stroke type: Bézier type. Previous strokes have the Poly type.
  • Curves are editable just like strokes in Sculpt Mode, Vertex Paint, and Weight Paint.
  • Users can convert strokes between Bezier and Poly type using a dedicated operator: Set stroke type.
Work plan

Milestone 1 - Remove Curve Editing toggle
Remove the curve editing-related UI elements and code (like the keymap).

Milestone 2 - Selection operators
Adapt the selection operators to work for curves and strokes simultaneously. Some of the selection code might need a refactor as well.

Additional changes:

  • Curves now have runtime data. Since some selection operators can also select from evaluated data (generated by modifiers), it is necessary that curves have runtime data. (rBd603c9c7ecb6) EDIT: This was later partially removed again. The curve itself does not need runtime data, because it can use the normal stroke runtime data. Curve points do need runtime data.
  • When curves are refitted, they keep their previous selection (as good as possible). (rBbed0e8a9a278)
  • To test runtime data for curves, the "Offset" modifier was implemented for curves. (rB310810188420)

Milestone 3 - Conversion operators
To convert between the two types we need a "Set Stroke Type" operator.

Milestone 4 - Transform
The transform code will have to be implemented. The TransData can no longer be separated for strokes and curves and will have to take both into account.

Note: The code is implemented and has been tested, but there could still be some bugs. Needs more thorough testing.

Milestone 5 - Editing operators and modifiers

Adapt/implement all the editing operators. Some of these might only need minor changes like checking if a stroke is a curve and then calling the right function (the bulk has already been implemented).

Adapt modifiers to work with Bezier type.

Milestone 6 - Sculpting, weight painting and vertex painting
Sculpting curves is similar to sculpting strokes. In fact, the only difference is that with curves, we sculpt the stroke points and then refit the curve after the operation. In order to make this work properly though, we need to be able to do partial curve refitting.


  • Do curve update if the stroke that was transformed is a curve. (rB7783f7ea1dc4)
  • Tag the points that have been transformed. (rB7783f7ea1dc4)
  • Change BKE_gpencil_stroke_editcurve_update to handle partial updates.
    • Create function to find curve segments that need updating.
    • Write BKE to do partial curve updates.

Weight painting

Vertex painting

  • Implement painting to the curve points. (rB1ddc36d42d18)
  • Update the vertex color of the poly points. (rB1ddc36d42d18)
  • Implement all brushes: brush_blur, brush_average, brush_smear, brush_replace

Milestone 7 - Drawing curves
To make curves part of all areas, we need at least one way to create curves directly in Draw Mode. There are multiple ideas:

  • Brush option: Setting that converts a drawn stroke to a curve on release. This would allow the user to automatically convert every stroke they draw to a curve (which they can then further edit in Edit Mode).
  • Bézier pen tool: Dedicated tool that allows drawing a bézier curve. Similar to the pen tool in other software. (need a subtask for this)

Branch: temp-gpencil-bezier-stroke-type

Related Objects

Mentioned In
D9565: GPencil: Add initial bezier smoothing option
Mentioned Here
rBe4c81a0a2b22: GPencil: Initial bezier support for smooth modifier
rB06abb9d99c79: GPencil: Bezier stroke smooth modifer
rB87d5bd5fb063: GPencil: Implement Merge by Distance for curves
rBe70e618ce745: GPencil: Curve smoothing BKE
rBceec9a6ddd14: GPencil: Fix drawing for Bezier weight paint
rB85b78a14d29b: GPencil: Add IS_BEZT_CONTROL flag for poly points
rBfb587e68be3b: GPencil: Experimental hide edit points
rB1ddc36d42d18: GPencil: Add vertex draw to bezier strokes
rBf59c9364cbcf: GPencil: Initial code for curve vertex groups
rB54c19452c0b0: GPencil: Add weight painting for bezier strokes
rB592d356c4a35: GPencil: First phase to make Armature modifier for Bezier type
rB39e1a77fdb47: GPencil: Prepare to copy weights for Armatures
rB6d5ba8857175: GPencil: More work to copy weights
rB7c38066bb7c8: GPencil: Add Bezier support to Texture modifier
rB6e5080bd643c: GPencil: Add Bezier support to Mirror modifier
rB4f0098760a69: GPencil: Add Bezier support to Offset modifier
rB82c2236259bd: GPencil: Add Bezier support to Thickness modifier
rB8bcc203ed707: GPencil: Add Bezier support to Lattice modifier
rB9405d3f9e38d: GPencil: Add Bezier support to Hook modifier
rBd1ce52120cd3: GPencil: Add Bezier support to Array modifier
rBccbe9d7ab15f: GPencil: Rename deformStroke to deformPolyline
rBfa7c2b6b22aa: GPemcil: Add new deformBezier callback for modifiers
rB1700e9977c21: GPencil: Support Bezier type for Tint Modifier
rB531704813df8: GPencil: Support Bezier type for Opacity Modifier
rB48ee94f15d61: GPencil: Support Bezier type for Hue/Saturation Modifier
rBeb5591fc9aba: GPencil: Simplify fixed for bezier strokes
rB799704df18dd: GPencil: Simplify adaptive for bezier strokes
rB13fe1b242cf0: GPencil: reset vertex colors for bezier strokes
rB015476f92381: GPencil: Add split operator for bezier strokes
rBeec4d20a4486: GPencil: Add BKE for single curve segment fitting
rBc944003d2940: GPencil: Add dissolve for curves with refit option
rBb110bc7820eb: GPencil: Add copy & past for curves
rB9ee08542a21b: GPencil: Extrude curves
rB15f2dcf46ded: GPencil: Move to layer for curves
rBd443af12f22d: GPencil: snap to grid for curve handles
rB07966cbacfc1: GPencil: Snap to cursor curves
rB51a00dfc59e3: GPencil: Snap cursor to selected curve points
rBc7a0d397988d: GPencil: reproject curves
rBb25cc036fcec: GPencil: Arrange curves operator
rB2f39d6b00263: GPencil: change material curves operator
rB548f57921149: GPencil: set cyclic curves operator
rB50bdc83cda0a: GPencil: Toggle end caps curves operator
rB44a1990286bb: GPencil: join bezier strokes operator
rBd6ff9444ead3: GPecnil: flip bezier strokes operator
rBaed4b6a2fa67: GPencil: subdivide bezier strokes operator
rB756bc5d94db6: GPencil: add transform modes for bezier strokes
rBf34e17fcb7e9: GPencil: seperate for bezier strokes operator
rB5a82aa69f7a4: GPencil: Duplicate curves
rBfa76a163d3ba: GPencil: Add delete curve/curve points
rB82a225acb50c: GPencil: Transform code for bezier strokes
rB633086e97967: GPencil: Set stroke type operator
rBa591eabe94a4: GPencil: Set Stroke Type UI
rB310810188420: GPencil: Offset modifier for curves
rBd603c9c7ecb6: WIP: Add runtime data for curves
rBbed0e8a9a278: GPencil: Sync selection when generating new curve
rB6d922553593b: GPencil: Add vertex color select for curves
rBc40efe078f47: GPencil: Fix compiler errors and change geom update
rBa0562388286c: GPencil: Add click select for curves
rB01799306e703: GPencil: Implement generic selection for curves
rB91792983f8e7: GPencil: Use active curve in circle select
rB7783f7ea1dc4: WIP: curve sculpting
rBa063c5a7cafa: GPencil: Curve circle select
rB739a7f984623: GPencil: curve select linked
rB47fe846254a8: GPencil: curve select alternated
rBe251509b5410: GPencil: curve select grouped
rB5b1e79105494: GPencil: curve select first/last
rBf1c97a561423: GPencil: curve select more/less

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Falk David (filedescriptor) renamed this task from GPencil: Next steps for curve editing to GPencil: New bézier stroke type.Mar 12 2021, 6:25 PM
Falk David (filedescriptor) updated the task description. (Show Details)
Falk David (filedescriptor) updated the task description. (Show Details)

Do you believe this will be included in 3.0?

any update for 3.3 or 3.4 ? or waiting for new curve structure data block and then ....?