Fix T78337: Fix crash when use GPencil merge without materials
If the object hadn't material, the index of material was negative.
This commit is contained in:
parent
e2e9df1520
commit
78c7e7e3bc
Notes:
blender-bot
2023-02-14 10:29:32 +01:00
Referenced by issue #78337, GPencil, edit mode: merge points do nothing
|
@ -132,7 +132,7 @@ static bGPDstroke *gpencil_prepare_stroke(bContext *C, wmOperator *op, int totpo
|
|||
bGPDframe *gpf = BKE_gpencil_layer_frame_get(gpl, CFRA, add_frame_mode);
|
||||
|
||||
/* stroke */
|
||||
bGPDstroke *gps = BKE_gpencil_stroke_new(ob->actcol - 1, totpoints, brush->size);
|
||||
bGPDstroke *gps = BKE_gpencil_stroke_new(max(ob->actcol - 1, 0), totpoints, brush->size);
|
||||
gps->flag |= GP_STROKE_SELECT;
|
||||
|
||||
if (cyclic) {
|
||||
|
|
Loading…
Reference in New Issue