Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2022-07-31 14:19:35 +0300
committerAntonio Vazquez <blendergit@gmail.com>2022-07-31 14:19:35 +0300
commit8c8c744f9d98fd0ff6ffc3b1d7e79a29e7f8e537 (patch)
treece95eec6ba2b5eae265d7e6fd53543a11982099e /source/blender/editors
parenta49b49d934aee9490d4aaf583f1f6b4d8686018e (diff)
parent27e6962beda6df155599cbbd1682c20f4e1cd06d (diff)
Merge branch 'blender-v3.3-release'
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 71cf9b1fafd..69a74c36aee 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -3989,6 +3989,7 @@ static void gpencil_smooth_stroke(bContext *C, wmOperator *op)
/* TODO use `BKE_gpencil_stroke_smooth` when the weights are better used. */
bGPDstroke gps_old = *gps;
gps_old.points = (bGPDspoint *)MEM_dupallocN(gps->points);
+ bool need_update = false;
/* Here the iteration needs to be done outside the smooth functions,
* as there are points that don't get smoothed. */
for (int n = 0; n < repeat; n++) {
@@ -4000,6 +4001,7 @@ static void gpencil_smooth_stroke(bContext *C, wmOperator *op)
/* Perform smoothing. */
if (smooth_position) {
BKE_gpencil_stroke_smooth_point(&gps_old, i, factor, 1, false, false, gps);
+ need_update = true;
}
if (smooth_strength) {
BKE_gpencil_stroke_smooth_strength(&gps_old, i, factor, 1, gps);
@@ -4009,6 +4011,7 @@ static void gpencil_smooth_stroke(bContext *C, wmOperator *op)
}
if (smooth_uv) {
BKE_gpencil_stroke_smooth_uv(&gps_old, i, factor, 1, gps);
+ need_update = true;
}
}
if (n < repeat - 1) {
@@ -4016,6 +4019,11 @@ static void gpencil_smooth_stroke(bContext *C, wmOperator *op)
}
}
MEM_freeN(gps_old.points);
+
+ if (need_update) {
+ gps->flag |= GP_STROKE_NEEDS_CURVE_UPDATE;
+ BKE_gpencil_stroke_geometry_update(gpd_, gps);
+ }
}
}
GP_EDITABLE_STROKES_END(gpstroke_iter);