Fix T97019: Regression - GPencil Shrinkwrap modifier not longer working

Bug introduced in the smooth function changes done in commit rBd4e1458db3a0e0eaf80219dc8e6d10cb27620793

Differential Revision: https://developer.blender.org/D14548
This commit is contained in:
Antonio Vazquez 2022-04-04 16:59:02 +02:00
parent 0ebcc711fc
commit 5eab5713c0
Notes: blender-bot 2023-02-13 15:49:10 +01:00
Referenced by issue #97019, Regression: Grease pencil Shrinkwrap modifier no longer working
1 changed files with 4 additions and 6 deletions

View File

@ -105,18 +105,16 @@ static void deformStroke(GpencilModifierData *md,
/* Apply deformed coordinates. */
pt = gps->points;
bGPDstroke gps_old = *gps;
gps_old.points = (bGPDspoint *)MEM_dupallocN(gps->points);
for (i = 0; i < gps->totpoints; i++, pt++) {
copy_v3_v3(&pt->x, vert_coords[i]);
/* Smooth stroke. */
BKE_gpencil_stroke_smooth_point(
&gps_old, i, mmd->smooth_factor, mmd->smooth_step, true, false, gps);
}
MEM_freeN(gps_old.points);
MEM_freeN(vert_coords);
/* Smooth stroke. */
BKE_gpencil_stroke_smooth(
gps, mmd->smooth_factor, mmd->smooth_step, true, false, false, false, true, NULL);
/* Calc geometry data. */
BKE_gpencil_stroke_geometry_update(gpd, gps);
}