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>2020-04-17 20:35:24 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-04-17 20:41:57 +0300
commit75ded99ff959d5f0ef819bb726bcdbc0a5a2217e (patch)
tree1546ed0dda71d18d98ac4eef49252a8369ecf963 /source/blender/blenkernel
parente4915730605568816033a141af28bd27124e3abf (diff)
Fix T75811: GPencil Sculpt not working when use Subdivide
When use the subdivide modifier the number of points was not correct and can produce segment faults. Also, the points were selected by default and this was wrong.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/gpencil.c5
-rw-r--r--source/blender/blenkernel/intern/gpencil_modifier.c1
2 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index a0fa07f4a41..041ef0503b9 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -1971,8 +1971,11 @@ void BKE_gpencil_frame_original_pointers_update(const struct bGPDframe *gpf_orig
if (i > gps_eval->totpoints - 1) {
break;
}
+ bGPDspoint *pt_orig = &gps_orig->points[i];
bGPDspoint *pt_eval = &gps_eval->points[i];
- pt_eval->runtime.pt_orig = &gps_orig->points[i];
+ pt_orig->runtime.pt_orig = NULL;
+ pt_orig->runtime.idx_orig = i;
+ pt_eval->runtime.pt_orig = pt_orig;
pt_eval->runtime.idx_orig = i;
}
/* Increase pointer. */
diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c
index 0bb6ce84b1b..b732d9cdd4c 100644
--- a/source/blender/blenkernel/intern/gpencil_modifier.c
+++ b/source/blender/blenkernel/intern/gpencil_modifier.c
@@ -684,6 +684,7 @@ void BKE_gpencil_stroke_subdivide(bGPDstroke *gps, int level, int type)
CLAMP(pt_final->strength, GPENCIL_STRENGTH_MIN, 1.0f);
pt_final->time = interpf(pt->time, next->time, 0.5f);
pt_final->runtime.pt_orig = NULL;
+ pt_final->flag = 0;
interp_v4_v4v4(pt_final->vert_color, pt->vert_color, next->vert_color, 0.5f);
if (gps->dvert != NULL) {