[Bf-blender-cvs] [934c724755a] blender-v2.93-release: Fix T91534: GPencil interpolate Sequence fails if stroke has 0 points

Antonio Vazquez noreply at git.blender.org
Wed Sep 22 08:50:26 CEST 2021


Commit: 934c724755a97faa21f0a4d756a3cfd03adb1476
Author: Antonio Vazquez
Date:   Tue Sep 21 17:29:19 2021 +0200
Branches: blender-v2.93-release
https://developer.blender.org/rB934c724755a97faa21f0a4d756a3cfd03adb1476

Fix T91534: GPencil interpolate Sequence fails if stroke has 0 points

In some cases the stroke has 0 points and this must be skipped in the interpolation.

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

M	source/blender/editors/gpencil/gpencil_interpolate.c

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

diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index 7ca53779522..1e732046b7b 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -317,6 +317,9 @@ static void gpencil_stroke_pair_table(bContext *C,
     if (ELEM(NULL, gps_from, gps_to)) {
       continue;
     }
+    if ((gps_from->totpoints == 0) || (gps_to->totpoints == 0)) {
+      continue;
+    }
     /* Insert the pair entry in the hash table and the list of strokes to keep order. */
     BLI_addtail(&tgpil->selected_strokes, BLI_genericNodeN(gps_from));
     BLI_ghash_insert(tgpil->pair_strokes, gps_from, gps_to);
@@ -1334,6 +1337,9 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op)
       if (ELEM(NULL, gps_from, gps_to)) {
         continue;
       }
+      if ((gps_from->totpoints == 0) || (gps_to->totpoints == 0)) {
+        continue;
+      }
 
       /* if destination stroke is smaller, resize new_stroke to size of gps_to stroke */
       if (gps_from->totpoints > gps_to->totpoints) {



More information about the Bf-blender-cvs mailing list