[WIP] GP Bezier Tool Design #58777

Closed
opened 2018-12-05 10:54:11 +01:00 by Charlie Jolly · 23 comments
Member

Discussion of GP Bezier Tool

Discussion of GP Bezier Tool
Author
Member

Added subscriber: @CharlieJolly

Added subscriber: @CharlieJolly
Author
Member

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.

gp_bezier.gif

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.

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](https://archive.blender.org/developer/D4030). ![gp_bezier.gif](https://archive.blender.org/developer/F5832179/gp_bezier.gif) 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.
Author
Member

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

gp_bezier_polyline.gif

Polyline using AKEY to add a new line. New ring cursor for moving line ends, ![gp_bezier_polyline.gif](https://archive.blender.org/developer/F5834434/gp_bezier_polyline.gif)

Added subscribers: @mendio, @pepe-school-land, @antoniov

Added subscribers: @mendio, @pepe-school-land, @antoniov

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.

@pepe-school-land @mendio What do you think?

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. @pepe-school-land @mendio What do you think?
Author
Member

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.

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.

@CharlieJolly 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.

@CharlieJolly 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 @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 @CharlieJolly is doing to the greasepencil-object branch first.

Agree @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 @CharlieJolly is doing to the greasepencil-object branch first.

I like a lot this tool @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
maypaint3.gif

I like a lot this tool @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 ![maypaint3.gif](https://archive.blender.org/developer/F5842282/maypaint3.gif)

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

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

@CharlieJolly 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()

@CharlieJolly 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()

@CharlieJolly 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
@CharlieJolly 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
Author
Member

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

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

I just merge 2.8 in GP 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.

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.

Added subscriber: @wevon-2

Added subscriber: @wevon-2

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.

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.
Author
Member

@wevon-2 it is on my todo list to look into implementing this

@wevon-2 it is on my todo list to look into implementing this

In #58777#595898, @CharlieJolly wrote:
@wevon-2 it is on my todo list to look into implementing this

Apart from being able to edit any fragment I think it could also soften them. Although there is the smoothing brush, as an editing tool it can be useful.
This is how I imagine it, by adding a ring on the tool.
Smooth stroke.jpg
Another option would be to put the ring on the ends and scale it to adjust the influence radius of the smoothing.

> In #58777#595898, @CharlieJolly wrote: > @wevon-2 it is on my todo list to look into implementing this Apart from being able to edit any fragment I think it could also soften them. Although there is the smoothing brush, as an editing tool it can be useful. This is how I imagine it, by adding a ring on the tool. ![Smooth stroke.jpg](https://archive.blender.org/developer/F6222669/Smooth_stroke.jpg) Another option would be to put the ring on the ends and scale it to adjust the influence radius of the smoothing.

Without wanting to stretch longer since it is out of topic.
I have improved the design, I have made a video and I have uploaded it to RightClickSelect to explain myself better, I hope it is useful Charlie, thanks for your attention.

https://blender.community/c/rightclickselect/V4cbbc/edit-sections-of-grease-pencil

https://youtu.be/F1bSeTSoCq0

Without wanting to stretch longer since it is out of topic. I have improved the design, I have made a video and I have uploaded it to RightClickSelect to explain myself better, I hope it is useful Charlie, thanks for your attention. https://blender.community/c/rightclickselect/V4cbbc/edit-sections-of-grease-pencil https://youtu.be/F1bSeTSoCq0

Changed status from 'Needs Triage' to: 'Archived'

Changed status from 'Needs Triage' to: 'Archived'
Antonio Vazquez self-assigned this 2020-08-18 12:32:26 +02:00

Added subscriber: @filedescriptor

Added subscriber: @filedescriptor

We can close this task because it have been replaced by GSoC Bezier project by @filedescriptor

We can close this task because it have been replaced by GSoC Bezier project by @filedescriptor
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#58777
No description provided.