Page MenuHome

GSoC Editing Grease Pencil Strokes Using Curves
ClosedPublic

Authored by Falk David (filedescriptor) on Aug 20 2020, 4:53 PM.

Details

Summary

This patch includes all the changes made in the soc-2020-greasepencil-curve branch.

Major changes:

  • Add a new "sub-mode" to grease pencil edit mode called "curve edit mode".
  • Grease pencil stroke data structure has a pointer to a grease pencil curve. It will be saved with the stroke to the blend file.
  • Most edit mode operators have been changed to work in curve edit mode.
  • Transformation code has been adjusted to work for grease pencil curves.
  • New source file added (gpencil_edit_curve.c) for operators exclusive to curve edit mode.

See the weekly reports of GSoC for detailed changes.

Image of curve edit mode activated:

Video demo:

Diff Detail

Repository
rB Blender
Branch
soc-2020-greasepencil-curve
Build Status
Buildable 9707
Build 9707: arc lint + arc unit

Event Timeline

Falk David (filedescriptor) requested review of this revision.Aug 20 2020, 4:53 PM
Falk David (filedescriptor) created this revision.

I see that patch is correct and don't see big issues. You have done a great job.

Also, I noticed the patch includes the changes on Draw Engine for Curves I did. We need test this code with last master changes to be sure the Handles are hidden and displayed depending of the option of the Overlay. I did some changes in master recently and this could be affected.

As general rule, as there are new code (this does not apply to old code):

  • Review you use the new datatypes like uint16_t in loops.
  • Review comments, must be start with Uppercase and ends with point.
  • Add Doxygen text to BKE function (not needed for static function).
  • Review some code commented and ToDos. If the ToDos are going to be used in next Phase, just add a comment like To be implemented in Phase II, or something like that.

I would like @Daniel Martinez Lara (pepeland) and @Matias Mendiola (mendio) run a complete test to be sure all is running as expected.

source/blender/blenkernel/BKE_gpencil.h
170

Can you use const?

source/blender/blenkernel/BKE_gpencil_curve.h
57

Can you use const?

source/blender/blenkernel/intern/gpencil.c
954

Following new rules, it's better use uint16_t for loop variables.

source/blender/blenkernel/intern/gpencil_curve.c
468

Same as above uint16_t

source/blender/editors/gpencil/gpencil_edit.c
4846

Is this a real TODO or an old comment?

4995

TODO??

source/blender/editors/gpencil/gpencil_select.c
1691

Need this code? if not remove.

1822

Do we need this?

source/blender/editors/transform/transform_mode_gpopacity.c
99

Why GXX? if it's a comment, just remove this tag... the XX tags means something to fix

source/blender/editors/transform/transform_mode_gpshrinkfatten.c
101

Same as above

  • GPencil: Make parameters const
  • GPencil: Recalc transform only in curve edit mode
Falk David (filedescriptor) marked 4 inline comments as done.Aug 21 2020, 11:07 AM
source/blender/blenkernel/intern/gpencil.c
954

My mistake, I mean uint32_t

source/blender/blenkernel/intern/gpencil_curve.c
468

My mistake, I mean uint32_t

  • GPencil: Fix handle lines display
  • GPencil: Fix transform memory issue
  • GPencil: Draw transform gizmo curve edit
  • GPencil: Remove unessesary curve edit mode test
  • GPencil: Report operators that are not implemented
  • GPencil: Move Curve versioning to the end of the file
  • GPencil: Handle strokes with one or two points
  • GPencil: Rename parameters
  • GPencil: Cleanup compiler warnings
  • GPencil: Fix angle initialization
  • GPencil: Convert to curve on selection
  • GPencil: Fix circle select curve conversion
  • GPencil: Refactor and small fixes
  • GPencil: Implement duplicate for curve points
  • Merge branch 'greasepencil-edit-curve' into soc-2020-greasepencil-curve
  • GPencil: Support view_selected in curve edit mode
  • Merge branch 'greasepencil-edit-curve' into soc-2020-greasepencil-curve
  • Merge with master and fix conflicts

As this patch is tagged to be included in 2.92 we must do a plan of testing and bug fixing to have all ready before end of October.

@Daniel Martinez Lara (pepeland) @Matias Mendiola (mendio) What is the status of the test?

@Falk David (filedescriptor) What is the status of the bugs?

If we think we must have a meeting, we can arrange a meeting. (@Pablo Vazquez (pablovazquez) you are invited, if you want).

So I wanted to take a close look at selection syncing again, because there are some issues there. Also locked layers need to be handled properly. Finally we have this issue of NaN pressure and strength that we need to figure out. I think the last one has the highest priority, since it can cause crashes, so it should be addressed first.

The code is good for me and it's running without bugs. I vote to merge in master and fix any bug directly. Also, merge in master allow us to get more testers.

@Falk David (filedescriptor) would be good idea update the patch to the very last version (I guess from greasepencil-curve branch, or after merge this branch in GSoC branch)

This revision is now accepted and ready to land.Nov 9 2020, 4:07 PM
  • GPencil: Hide Curve Handles when layer is locked
  • GPencil: Check if layer is locked for Handles
  • GPencil: Remove unused function
  • GPencil: Fix parameter list after merge
  • GPencil: Fix missing screen update when use Fixed Simplify
  • GPencil: Fix bug where curve points woud dissapear
  • GPencil: Fix compiler errors due merge conflicts
  • GPencil: Fix comments and rename _pad2 to _pad
  • GPencil: Clean up compiler warnings
  • GPencil: Fix curve point extrude selection
  • GPencil: Fix edit curve not being written to file
This revision was automatically updated to reflect the committed changes.