diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2021-02-20 12:16:51 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2021-02-20 12:16:59 +0300 |
commit | 173b6b792cf95fb9eb20ec760b28469d46b0ff52 (patch) | |
tree | d1ae9e54c06d3972e7bba5fe2c667a35a51fbf29 /source/blender | |
parent | 37e6a1995ac7eeabd5b6a56621ad5a850dae4149 (diff) |
Cleanup: Split grease pencil selection index functions
This makes the code more readable.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_gpencil.h | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/gpencil.c | 27 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/gpencil_curve.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/gpencil_geom.c | 2 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_data.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 16 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_merge.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_primitive.c | 2 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_select.c | 38 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_utils.c | 16 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_gpencil.c | 4 |
11 files changed, 63 insertions, 63 deletions
diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h index b9dba991d64..5cfdcf241d1 100644 --- a/source/blender/blenkernel/BKE_gpencil.h +++ b/source/blender/blenkernel/BKE_gpencil.h @@ -103,9 +103,8 @@ void BKE_gpencil_batch_cache_free(struct bGPdata *gpd); void BKE_gpencil_stroke_sync_selection(struct bGPdata *gpd, struct bGPDstroke *gps); void BKE_gpencil_curve_sync_selection(struct bGPdata *gpd, struct bGPDstroke *gps); -void BKE_gpencil_stroke_select_index_set(struct bGPdata *gpd, - struct bGPDstroke *gps, - const bool reset); +void BKE_gpencil_stroke_select_index_set(struct bGPdata *gpd, struct bGPDstroke *gps); +void BKE_gpencil_stroke_select_index_reset(struct bGPDstroke *gps); struct bGPDframe *BKE_gpencil_frame_addnew(struct bGPDlayer *gpl, int cframe); struct bGPDframe *BKE_gpencil_frame_addcopy(struct bGPDlayer *gpl, int cframe); diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index 4167f60e880..28477e9dc30 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -1148,7 +1148,7 @@ void BKE_gpencil_stroke_sync_selection(bGPdata *gpd, bGPDstroke *gps) * so initially, we must deselect */ gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { if (pt->flag & GP_SPOINT_SELECT) { @@ -1158,7 +1158,7 @@ void BKE_gpencil_stroke_sync_selection(bGPdata *gpd, bGPDstroke *gps) } if (gps->flag & GP_STROKE_SELECT) { - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); } } @@ -1170,7 +1170,7 @@ void BKE_gpencil_curve_sync_selection(bGPdata *gpd, bGPDstroke *gps) } gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); gpc->flag &= ~GP_CURVE_SELECT; bool is_selected = false; @@ -1193,20 +1193,21 @@ void BKE_gpencil_curve_sync_selection(bGPdata *gpd, bGPDstroke *gps) if (is_selected) { gpc->flag |= GP_CURVE_SELECT; gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); } } /* Assign unique stroke ID for selection. */ -void BKE_gpencil_stroke_select_index_set(bGPdata *gpd, bGPDstroke *gps, const bool reset) +void BKE_gpencil_stroke_select_index_set(bGPdata *gpd, bGPDstroke *gps) { - if (!reset) { - gpd->select_last_index++; - gps->select_index = gpd->select_last_index; - } - else { - gps->select_index = 0; - } + gpd->select_last_index++; + gps->select_index = gpd->select_last_index; +} + +/* Reset unique stroke ID for selection. */ +void BKE_gpencil_stroke_select_index_reset(bGPDstroke *gps) +{ + gps->select_index = 0; } /* ************************************************** */ @@ -2533,7 +2534,7 @@ bool BKE_gpencil_from_image( } if (gps->flag & GP_STROKE_SELECT) { - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); } BKE_gpencil_stroke_geometry_update(gpd, gps); diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c index a1cae205d39..88d3e917a7a 100644 --- a/source/blender/blenkernel/intern/gpencil_curve.c +++ b/source/blender/blenkernel/intern/gpencil_curve.c @@ -814,7 +814,7 @@ void BKE_gpencil_stroke_editcurve_sync_selection(bGPdata *gpd, bGPDstroke *gps, { if (gpc->flag & GP_CURVE_SELECT) { gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); for (int i = 0; i < gpc->tot_curve_points - 1; i++) { bGPDcurve_point *gpc_pt = &gpc->curve_points[i]; @@ -868,7 +868,7 @@ void BKE_gpencil_stroke_editcurve_sync_selection(bGPdata *gpd, bGPDstroke *gps, } else { gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); for (int i = 0; i < gps->totpoints; i++) { bGPDspoint *pt = &gps->points[i]; pt->flag &= ~GP_SPOINT_SELECT; @@ -1093,7 +1093,7 @@ void BKE_gpencil_stroke_update_geometry_from_editcurve(bGPDstroke *gps, /* deselect */ pt->flag &= ~GP_SPOINT_SELECT; gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); return; } @@ -1136,7 +1136,7 @@ void BKE_gpencil_stroke_update_geometry_from_editcurve(bGPDstroke *gps, pt->flag &= ~GP_SPOINT_SELECT; } gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); /* free temp data */ MEM_freeN(points); diff --git a/source/blender/blenkernel/intern/gpencil_geom.c b/source/blender/blenkernel/intern/gpencil_geom.c index 2d10645a467..8c4882854d1 100644 --- a/source/blender/blenkernel/intern/gpencil_geom.c +++ b/source/blender/blenkernel/intern/gpencil_geom.c @@ -3444,7 +3444,7 @@ void BKE_gpencil_stroke_uniform_subdivide(bGPdata *gpd, if (select) { gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); } /* Free the sample points. Important to use the mutable loop here because we are erasing the list diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index 0597de445f4..c76c2e55d2b 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -3418,11 +3418,11 @@ static int gpencil_material_select_exec(bContext *C, wmOperator *op) if (!deselected) { gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); } else { gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { if (!deselected) { diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index aec593b97ea..b03d2c6e795 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -992,7 +992,7 @@ static int gpencil_duplicate_exec(bContext *C, wmOperator *op) pt->flag &= ~GP_SPOINT_SELECT; } gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); changed = true; } @@ -1194,7 +1194,7 @@ static void gpencil_add_move_points(bGPdata *gpd, bGPDframe *gpf, bGPDstroke *gp /* if the stroke is not reused, deselect */ if (!do_stroke) { gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } } @@ -1711,7 +1711,7 @@ static int gpencil_strokes_paste_exec(bContext *C, wmOperator *op) } gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } CTX_DATA_END; @@ -2551,7 +2551,7 @@ static bool gpencil_dissolve_selected_stroke_points(bContext *C, /* deselect the stroke, since none of its selected points will still be selected */ gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); for (i = 0, pt = gps->points; i < gps->totpoints; i++, pt++) { pt->flag &= ~GP_SPOINT_SELECT; } @@ -2624,7 +2624,7 @@ static int gpencil_delete_selected_points(bContext *C) if (gps->flag & GP_STROKE_SELECT) { /* deselect old stroke, since it will be used as template for the new strokes */ gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); if (is_curve_edit) { bGPDcurve *gpc = gps->editcurve; @@ -4579,7 +4579,7 @@ static int gpencil_stroke_separate_exec(bContext *C, wmOperator *op) else if (mode == GP_SEPARATE_STROKE) { /* deselect old stroke */ gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); /* unlink from source frame */ BLI_remlink(&gpf->strokes, gps); gps->prev = gps->next = NULL; @@ -4988,7 +4988,7 @@ static int gpencil_cutter_lasso_select(bContext *C, } gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } CTX_DATA_END; @@ -5029,7 +5029,7 @@ static int gpencil_cutter_lasso_select(bContext *C, changed = true; pt->flag |= GP_SPOINT_SELECT; gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); float r_hita[3], r_hitb[3]; if (gps->totpoints > 1) { ED_gpencil_select_stroke_segment( diff --git a/source/blender/editors/gpencil/gpencil_merge.c b/source/blender/editors/gpencil/gpencil_merge.c index 8d8734dfd1f..259b2882589 100644 --- a/source/blender/editors/gpencil/gpencil_merge.c +++ b/source/blender/editors/gpencil/gpencil_merge.c @@ -134,7 +134,7 @@ static bGPDstroke *gpencil_prepare_stroke(bContext *C, wmOperator *op, int totpo /* stroke */ bGPDstroke *gps = BKE_gpencil_stroke_new(MAX2(ob->actcol - 1, 0), totpoints, brush->size); gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); if (cyclic) { gps->flag |= GP_STROKE_CYCLIC; @@ -243,7 +243,7 @@ static void gpencil_calc_points_factor(bContext *C, } } gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } } } diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index 4eec4c7d00e..12d399f32ca 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -338,7 +338,7 @@ static void gpencil_primitive_set_initdata(bContext *C, tGPDprimitive *tgpi) ED_gpencil_fill_vertex_color_set(ts, brush, gps); gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); /* the polygon must be closed, so enabled cyclic */ if (ELEM(tgpi->type, GP_STROKE_BOX, GP_STROKE_CIRCLE)) { gps->flag |= GP_STROKE_CYCLIC; diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c index fd5c5bb5346..e01c1ec54d7 100644 --- a/source/blender/editors/gpencil/gpencil_select.c +++ b/source/blender/editors/gpencil/gpencil_select.c @@ -174,7 +174,7 @@ static void deselect_all_selected(bContext *C) /* deselect stroke itself too */ gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } /* deselect curve and curve points */ @@ -211,12 +211,12 @@ static void select_all_curve_points(bGPdata *gpd, bGPDstroke *gps, bGPDcurve *gp if (deselect == false) { gpc->flag |= GP_CURVE_SELECT; gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); } else { gpc->flag &= ~GP_CURVE_SELECT; gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } } @@ -570,7 +570,7 @@ static bool gpencil_select_same_layer(bContext *C) } gpc->flag |= GP_CURVE_SELECT; gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); changed = true; } @@ -587,7 +587,7 @@ static bool gpencil_select_same_layer(bContext *C) } gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); changed = true; } @@ -632,7 +632,7 @@ static bool gpencil_select_same_material(bContext *C) } gpc->flag |= GP_CURVE_SELECT; gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); changed = true; } @@ -651,7 +651,7 @@ static bool gpencil_select_same_material(bContext *C) } gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); changed = true; } @@ -768,7 +768,7 @@ static int gpencil_select_first_exec(bContext *C, wmOperator *op) BEZT_SEL_ALL(&gpc->curve_points[0].bezt); gpc->flag |= GP_CURVE_SELECT; gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); if ((extend == false) && (gps->totpoints > 1)) { for (int i = 1; i < gpc->tot_curve_points; i++) { @@ -783,7 +783,7 @@ static int gpencil_select_first_exec(bContext *C, wmOperator *op) else { gps->points->flag |= GP_SPOINT_SELECT; gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); /* deselect rest? */ if ((extend == false) && (gps->totpoints > 1)) { @@ -878,7 +878,7 @@ static int gpencil_select_last_exec(bContext *C, wmOperator *op) BEZT_SEL_ALL(&gpc->curve_points[gpc->tot_curve_points - 1].bezt); gpc->flag |= GP_CURVE_SELECT; gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); if ((extend == false) && (gps->totpoints > 1)) { for (int i = 0; i < gpc->tot_curve_points - 1; i++) { bGPDcurve_point *gpc_pt = &gpc->curve_points[i]; @@ -892,7 +892,7 @@ static int gpencil_select_last_exec(bContext *C, wmOperator *op) else { gps->points[gps->totpoints - 1].flag |= GP_SPOINT_SELECT; gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); /* deselect rest? */ if ((extend == false) && (gps->totpoints > 1)) { @@ -1289,12 +1289,12 @@ static bool gpencil_stroke_do_circle_sel(bGPdata *gpd, if (select) { pt_active->flag |= GP_SPOINT_SELECT; gps_active->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps_active, false); + BKE_gpencil_stroke_select_index_set(gpd, gps_active); } else { pt_active->flag &= ~GP_SPOINT_SELECT; gps_active->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps_active, true); + BKE_gpencil_stroke_select_index_reset(gps_active); } changed = true; /* if stroke mode, don't check more points */ @@ -1832,7 +1832,7 @@ static bool gpencil_generic_stroke_select(bContext *C, } gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } CTX_DATA_END; @@ -2358,11 +2358,11 @@ static int gpencil_select_exec(bContext *C, wmOperator *op) /* stroke too... */ if (deselect == false) { hit_stroke->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, hit_stroke, false); + BKE_gpencil_stroke_select_index_set(gpd, hit_stroke); } else { hit_stroke->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, hit_stroke, true); + BKE_gpencil_stroke_select_index_reset(hit_stroke); } } } @@ -2374,13 +2374,13 @@ static int gpencil_select_exec(bContext *C, wmOperator *op) BEZT_SEL_IDX(&hit_curve_point->bezt, hit_curve_handle); hit_curve->flag |= GP_CURVE_SELECT; hit_stroke->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, hit_stroke, false); + BKE_gpencil_stroke_select_index_set(gpd, hit_stroke); } else { /* we're adding selection, so selection must be true */ hit_point->flag |= GP_SPOINT_SELECT; hit_stroke->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, hit_stroke, false); + BKE_gpencil_stroke_select_index_set(gpd, hit_stroke); /* expand selection to segment */ int selectmode; @@ -2602,7 +2602,7 @@ static int gpencil_select_vertex_color_exec(bContext *C, wmOperator *op) if (gps_selected) { gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); /* Extend stroke selection. */ if (selectmode == GP_SELECTMODE_STROKE) { diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index f9242c5a1a8..5c041134a74 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1167,7 +1167,7 @@ void ED_gpencil_stroke_reproject(Depsgraph *depsgraph, if (keep_original) { gps_active = BKE_gpencil_stroke_duplicate(gps, true, true); gps_active->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps_active, true); + BKE_gpencil_stroke_select_index_reset(gps_active); for (i = 0, pt = gps_active->points; i < gps_active->totpoints; i++, pt++) { pt->flag &= ~GP_SPOINT_SELECT; } @@ -1692,7 +1692,7 @@ void ED_gpencil_vgroup_select(bContext *C, Object *ob) } if (gps->flag & GP_STROKE_SELECT) { - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); } } } @@ -2616,7 +2616,7 @@ void ED_gpencil_select_toggle_all(bContext *C, int action) } gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } } } @@ -2654,11 +2654,11 @@ void ED_gpencil_select_toggle_all(bContext *C, int action) /* Change status of stroke */ if (selected) { gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); } else { gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } } CTX_DATA_END; @@ -2695,7 +2695,7 @@ void ED_gpencil_select_curve_toggle_all(bContext *C, int action) } gpc->flag &= ~GP_CURVE_SELECT; gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } GP_EDITABLE_CURVES_END(gps_iter); } @@ -2737,12 +2737,12 @@ void ED_gpencil_select_curve_toggle_all(bContext *C, int action) if (selected) { gpc->flag |= GP_CURVE_SELECT; gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); } else { gpc->flag &= ~GP_CURVE_SELECT; gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } } GP_EDITABLE_STROKES_END(gps_iter); diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 631ab1c4671..f9caa746dac 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -941,11 +941,11 @@ static void rna_GPencil_stroke_select_set(PointerRNA *ptr, const bool value) /* set new value */ if (value) { gps->flag |= GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(gpd, gps, false); + BKE_gpencil_stroke_select_index_set(gpd, gps); } else { gps->flag &= ~GP_STROKE_SELECT; - BKE_gpencil_stroke_select_index_set(NULL, gps, true); + BKE_gpencil_stroke_select_index_reset(gps); } /* ensure that the stroke's points are selected in the same way */ |