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.
This commit is contained in:
parent
1d816e3a66
commit
39d7c111db
Notes:
blender-bot
2023-02-14 10:21:15 +01:00
Referenced by issue #78884, Grease Pencil: Crash weight painting on stroke with generative modifier [subdivide] - also generative modifiers create actual editable points? Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue