From ca2bf2f3a058d48c7e8fd1575fce8bc4df128fa2 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Mon, 13 Mar 2023 18:04:25 +0100 Subject: [PATCH] Fix #105625: GPencil sculpt crash with subdivide modifier The created point hasn't a original point in the original stroke, so must use only the valid points. Pull Request: https://projects.blender.org/blender/blender/pulls/105627 --- source/blender/editors/gpencil/gpencil_sculpt_paint.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/blender/editors/gpencil/gpencil_sculpt_paint.c b/source/blender/editors/gpencil/gpencil_sculpt_paint.c index ab3edfdd4fa..d7ea38f5e3f 100644 --- a/source/blender/editors/gpencil/gpencil_sculpt_paint.c +++ b/source/blender/editors/gpencil/gpencil_sculpt_paint.c @@ -1411,7 +1411,8 @@ static float gpencil_sculpt_rotation_eval_get(tGP_BrushEditData *gso, const GP_SpaceConversion *gsc = &gso->gsc; bGPDstroke *gps_orig = (gps_eval->runtime.gps_orig) ? gps_eval->runtime.gps_orig : gps_eval; - bGPDspoint *pt_orig = &gps_orig->points[pt_eval->runtime.idx_orig]; + bGPDspoint *pt_orig = (pt_eval->runtime.pt_orig) ? &gps_orig->points[pt_eval->runtime.idx_orig] : + pt_eval; bGPDspoint *pt_prev_eval = NULL; bGPDspoint *pt_orig_prev = NULL; if (idx_eval != 0) {