From fd556023cbadba1d6a8fb15f324257b728b5322b Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Fri, 7 Jun 2019 16:07:32 +0200 Subject: Cleanup: Reformat GPencil multiedit frame selection --- source/blender/editors/gpencil/gpencil_utils.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'source/blender/editors/gpencil/gpencil_utils.c') diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 93a80f0fcf8..065c133bf97 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1421,11 +1421,8 @@ void ED_gpencil_vgroup_assign(bContext *C, Object *ob, float weight) } CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) { - bGPDframe *init_gpf = gpl->actframe; + bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe; bGPDstroke *gps = NULL; - if (is_multiedit) { - init_gpf = gpl->frames.first; - } for (bGPDframe *gpf = init_gpf; gpf; gpf = gpf->next) { if ((gpf == gpl->actframe) || ((gpf->flag & GP_FRAME_SELECT) && (is_multiedit))) { @@ -1478,11 +1475,8 @@ void ED_gpencil_vgroup_remove(bContext *C, Object *ob) } CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) { - bGPDframe *init_gpf = gpl->actframe; + bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe; bGPDstroke *gps = NULL; - if (is_multiedit) { - init_gpf = gpl->frames.first; - } for (bGPDframe *gpf = init_gpf; gpf; gpf = gpf->next) { if ((gpf == gpl->actframe) || ((gpf->flag & GP_FRAME_SELECT) && (is_multiedit))) { @@ -1534,11 +1528,8 @@ void ED_gpencil_vgroup_select(bContext *C, Object *ob) } CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) { - bGPDframe *init_gpf = gpl->actframe; + bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe; bGPDstroke *gps = NULL; - if (is_multiedit) { - init_gpf = gpl->frames.first; - } for (bGPDframe *gpf = init_gpf; gpf; gpf = gpf->next) { if ((gpf == gpl->actframe) || ((gpf->flag & GP_FRAME_SELECT) && (is_multiedit))) { @@ -1588,11 +1579,8 @@ void ED_gpencil_vgroup_deselect(bContext *C, Object *ob) } CTX_DATA_BEGIN (C, bGPDlayer *, gpl, editable_gpencil_layers) { - bGPDframe *init_gpf = gpl->actframe; + bGPDframe *init_gpf = (is_multiedit) ? gpl->frames.first : gpl->actframe; bGPDstroke *gps = NULL; - if (is_multiedit) { - init_gpf = gpl->frames.first; - } for (bGPDframe *gpf = init_gpf; gpf; gpf = gpf->next) { if ((gpf == gpl->actframe) || ((gpf->flag & GP_FRAME_SELECT) && (is_multiedit))) { -- cgit v1.2.3