[Bf-blender-cvs] [d5e7263cd13] temp-gpencil-bezier-stroke-type: GPencil: comments

Falk David noreply at git.blender.org
Mon Mar 15 00:36:25 CET 2021


Commit: d5e7263cd135c7db78d56f34e7ff01f628d52ca7
Author: Falk David
Date:   Sun Mar 14 19:47:38 2021 +0100
Branches: temp-gpencil-bezier-stroke-type
https://developer.blender.org/rBd5e7263cd135c7db78d56f34e7ff01f628d52ca7

GPencil: comments

===================================================================

M	source/blender/blenkernel/intern/gpencil_geom.c
M	source/blender/editors/gpencil/gpencil_convert.c
M	source/blender/editors/gpencil/gpencil_edit.c

===================================================================

diff --git a/source/blender/blenkernel/intern/gpencil_geom.c b/source/blender/blenkernel/intern/gpencil_geom.c
index 132f4ef5dff..d84f47e7d7f 100644
--- a/source/blender/blenkernel/intern/gpencil_geom.c
+++ b/source/blender/blenkernel/intern/gpencil_geom.c
@@ -1290,12 +1290,12 @@ void BKE_gpencil_stroke_geometry_update(bGPdata *gpd, bGPDstroke *gps)
     return;
   }
 
-  /* If the stroke is a curve, update stroke points first. */
+  /* Update stroke points first if it's a bezier stroke. */
   if (GPENCIL_STROKE_TYPE_BEZIER(gps)) {
 
     /* If the stroke geometry was updated, refit the curve.
      * NOTE: Normally the stroke points of a curve should not be updated directly. Only if it is
-     * unavoidable. Sculpting a curve also makes use of this. */
+     * unavoidable. Sculpting bezier strokes also makes use of this. */
     if (gps->editcurve->flag & GP_CURVE_NEEDS_STROKE_UPDATE) {
       /* TODO: Make do-partial-update variable */
       BKE_gpencil_stroke_editcurve_update(
diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c
index ac75ae44c8a..adb84ef3650 100644
--- a/source/blender/editors/gpencil/gpencil_convert.c
+++ b/source/blender/editors/gpencil/gpencil_convert.c
@@ -1378,6 +1378,7 @@ static void gpencil_layer_to_curve(bContext *C,
       nu = NULL;
     }
 
+    /* TODO: check if the strok is of type BEZIER. In that case the conversion can be less expensive. */
     switch (mode) {
       case GP_STROKECONVERT_PATH:
         gpencil_stroke_to_path(C,
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 0a7246d5410..23a2cae4d06 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -4082,6 +4082,7 @@ static int gpencil_recalc_geometry_exec(bContext *C, wmOperator *UNUSED(op))
   LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
     LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
       LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
+        /* TODO: maybe add an option to only include selected strokes? */
         BKE_gpencil_stroke_geometry_update(gpd, gps);
       }
     }



More information about the Bf-blender-cvs mailing list