diff options
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_edit.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index d734fb2678e..8506e90191f 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -1928,7 +1928,7 @@ static int gpencil_blank_frame_add_exec(bContext *C, wmOperator *op) if (ELEM(NULL, gpd, active_gpl)) { /* Let's just be lazy, and call the "Add New Layer" operator, * which sets everything up as required. */ - WM_operator_name_call(C, "GPENCIL_OT_layer_add", WM_OP_EXEC_DEFAULT, NULL); + WM_operator_name_call(C, "GPENCIL_OT_layer_add", WM_OP_EXEC_DEFAULT, NULL, NULL); } /* Go through each layer, adding a frame after the active one @@ -5430,9 +5430,10 @@ static int gpencil_stroke_normalize_exec(bContext *C, wmOperator *op) if (ED_gpencil_stroke_can_use(C, gps) == false) { continue; } - - bool selected = (is_curve_edit) ? gps->editcurve->flag |= GP_CURVE_SELECT : - (gps->flag & GP_STROKE_SELECT); + bool is_curve_ready = (gps->editcurve != NULL); + bool selected = (is_curve_edit && is_curve_ready) ? + (gps->editcurve->flag & GP_CURVE_SELECT) : + (gps->flag & GP_STROKE_SELECT); if (!selected) { continue; } @@ -5445,7 +5446,7 @@ static int gpencil_stroke_normalize_exec(bContext *C, wmOperator *op) } /* Loop all Polyline points. */ - if (!is_curve_edit) { + if (!is_curve_edit || !is_curve_ready) { for (int i = 0; i < gps->totpoints; i++) { bGPDspoint *pt = &gps->points[i]; if (mode == GP_NORMALIZE_THICKNESS) { |