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
path: root/source
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-07-31 19:20:27 +0300
committerJeroen Bakker <jeroen@blender.org>2020-08-12 10:13:44 +0300
commit39d7c111dbed051d5ac29e7f05fb9b346e4f0ce7 (patch)
treef5d292d77d048d928748f5dddf68167c9e1b3f1a /source
parent1d816e3a66c99358e3530dce2f124fbaa58666b0 (diff)
Fix T78884: GPencil weight paint crash when painting over modifier generated points
The weight must be added only to the real points, not to the autogenerated points by modifiers. This affects, not only to subdivide, but to any modifier that generate points.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/gpencil/gpencil_weight_paint.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/gpencil_weight_paint.c b/source/blender/editors/gpencil/gpencil_weight_paint.c
index 2ebf1aba353..a1006904294 100644
--- a/source/blender/editors/gpencil/gpencil_weight_paint.c
+++ b/source/blender/editors/gpencil/gpencil_weight_paint.c
@@ -453,9 +453,9 @@ static void gp_weightpaint_select_stroke(tGP_BrushWeightpaintData *gso,
/* To each point individually... */
pt = &gps->points[i];
- pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
- index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i;
+ pt_active = pt->runtime.pt_orig;
if (pt_active != NULL) {
+ index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i;
gp_save_selected_point(gso, gps_active, index, pc1);
}
@@ -469,9 +469,9 @@ static void gp_weightpaint_select_stroke(tGP_BrushWeightpaintData *gso,
*/
if (i + 1 == gps->totpoints - 1) {
pt = &gps->points[i + 1];
- pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
- index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i + 1;
+ pt_active = pt->runtime.pt_orig;
if (pt_active != NULL) {
+ index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i + 1;
gp_save_selected_point(gso, gps_active, index, pc2);
include_last = false;
}
@@ -487,9 +487,9 @@ static void gp_weightpaint_select_stroke(tGP_BrushWeightpaintData *gso,
* (but wasn't added then, to avoid double-ups).
*/
pt = &gps->points[i];
- pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
- index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i;
+ pt_active = pt->runtime.pt_orig;
if (pt_active != NULL) {
+ index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i;
gp_save_selected_point(gso, gps_active, index, pc1);
include_last = false;