Page MenuHome

[WIP] GP Bezier Tool Design
Open, Needs TriagePublic

Description

Discussion of GP Bezier Tool

Details

Type
Design

Event Timeline

I've got a patch for adding a gp bezier tool based on the MyPaint curve tool.

I've not added it to the tracker yet pending D4030.

Current sequence of actions:
Left click drag release to draw initial curve.
Shift click and drag curve.
Enter to apply.

The modify behaviour first detects if the mouse is near the start or end of the line within a threshold, failing that it uses the control point for nearest end.
Ctrl-shift drag moves both control points to the same place (for effectively a cubic bezier).
Cursor changes to hand when in modify mode.
The control points aren't shown so the shift action feels more like sculpting.

Polyline using AKEY to add a new line.
New ring cursor for moving line ends,

Firstly, I like the idea of primitives with Bezier curves, but do we want only this? I mean, maybe we need to think in a new whole type of strokes "Curves" and keep all the information to allow editing. Sometimes you could need to refine or reshape the curve. Anyway, I like the primitive that you describe, but maybe we need to be "careful" with the name we give, Bezier curves are too wide and the users will expect more of this type of tool.

@Daniel Lara (Pepeland) (pepeland) @Matias Mendiola (mendio) What do you think?

I suppose there are two aspects, one from artists and one from a technical point of view.

For artists, the primitive tools allow them to create smooth curves and other geometric shapes which will be generated as regular GP strokes. As a comparison to MyPaint, at least you can delete the strokes you don't want.

Technically. allowing strokes to be editable as Beziers would probably mean implementing a curve fitting function to convert a GP point stroke back to a Bezier after scultpting and other actions. This has other impacts such as memory use.

Maybe it should be an initial goal to give artists more useful tools then at a later time investigate curve fitting functions.

@Charlie Jolly (charlie) Yes, agree. Real Beziers is totally different, but we can add this primitive now.

Could you load the patch to test it?

Maybe, you could apply the patch to greasepencil-object branch and we can test all before moving to 2.8.

Agree @Antonio Vazquez (antoniov) , the tool is very useful but this require more research and test before land in Grease Pencil as a complete bezier curves system.
I suggest to move all this new tools development that @Charlie Jolly (charlie) is doing to the greasepencil-object branch first.

I like a lot this tool @Charlie Jolly (charlie). Great for the cleanup process and the implemetnation for the user seems ok, (need to test it)
A good improvement will be that you can see the final GP stroke during maipulation (like in mypaint) instead the current preview orange line and
the otherone is have a option to taper the stroke start/end in the toolbar. See the attached gif

The final stroke preview should be not only for this bezier curve tool, but also for all the other primitives

@Charlie Jolly (charlie) To get the preview while drawing you need fill the stroke buffer with the points. Also, we need to be sure the buffer is cleared at the end of the operator (you can see an example in gpencil_paint.c)

Also look at gp_session_validatebuffer()

@Charlie Jolly (charlie) I have been thinking and IMHO it's mandatory to do all this stuff in greasepencil-object branch. Add new/change operators and add real stroke drawing in primitives can break the current 2.8 version, and now we have users, so we cannot test things there (if something is broken we will receive a lot of bugs and we will need time to manage them).

The plan is:

  1. Move the changes to greasepencil-object branch. We do all work here.
  2. Implement real drawing and other changes.
  3. Test and polish.
  4. Merge to 2.8

@Antonio Vazquez (antoniov) Ok, I'll get setup on the greasepencil-object branch.

I just merge 2.8 in GP branch.

In the branch the stroke is drawn while do the primitive (2bcc5f8bdef7)

Not sure if we must draw the orange line, but as you use Cyclic for Rectangles and Circles, during the drawing this is a help.

As shown in this video fragment,

https://youtu.be/0CnfsU4cKDY?t=136

Retopoflow allows you to create strips with and edit them with a curve, but unlike the first version, it allows you to select any curve fragment and edit it with a curve that adapts to the length of the selection. . I think that adapting this Grease Pencil tool so that it can work in Edit Mode, can be very interesting.