[Bf-blender-cvs] [bf375544cc3] greasepencil-object: Cleanup: use function to free weights
Campbell Barton
noreply at git.blender.org
Fri May 18 12:19:04 CEST 2018
Commit: bf375544cc35a7370ca8e214ab24d014f7e1c416
Author: Campbell Barton
Date: Fri May 18 12:16:49 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rBbf375544cc35a7370ca8e214ab24d014f7e1c416
Cleanup: use function to free weights
===================================================================
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 21ec40beab9..9e611d8e8ee 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -61,6 +61,7 @@
#include "BKE_library.h"
#include "BKE_report.h"
#include "BKE_screen.h"
+#include "BKE_deform.h"
#include "UI_interface.h"
#include "UI_resources.h"
@@ -1007,11 +1008,7 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op)
/* if destination stroke is smaller, resize new_stroke to size of gps_to stroke */
if (gps_from->totpoints > gps_to->totpoints) {
/* free weights of removed points */
- for (int i = gps_to->totpoints; i < gps_from->totpoints; i++) {
- bGPDspoint *pt = &gps_from->points[i];
- MDeformVert *dvert = &gps_from->dvert[i];
- BKE_gpencil_free_point_weights(dvert);
- }
+ BKE_defvert_array_free_elems(gps_from->dvert + gps_to->totpoints, gps_from->totpoints - gps_to->totpoints);
new_stroke->points = MEM_recallocN(new_stroke->points, sizeof(*new_stroke->points) * gps_to->totpoints);
new_stroke->dvert = MEM_recallocN(new_stroke->dvert, sizeof(*new_stroke->dvert) * gps_to->totpoints);
More information about the Bf-blender-cvs
mailing list