Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/gpencil.c
| Show First 20 Lines • Show All 1,849 Lines • ▼ Show 20 Lines | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Iterators | /** \name Iterators | ||||
| * | * | ||||
| * Iterate over all visible stroke of all visible layers inside a gpObject. | * Iterate over all visible stroke of all visible layers inside a gpObject. | ||||
| * Also take into account onion skining. | * Also take into account onion skining. | ||||
| * | * | ||||
| * \{ */ | * \{ */ | ||||
| void BKE_gpencil_visible_stroke_iter( | void BKE_gpencil_visible_stroke_iter(Depsgraph *depsgraph, | ||||
| Object *ob, gpIterCb layer_cb, gpIterCb stroke_cb, void *thunk, bool do_onion, int cfra) | Object *ob, | ||||
| gpIterCb layer_cb, | |||||
| gpIterCb stroke_cb, | |||||
| void *thunk, | |||||
| bool do_onion, | |||||
| int cfra) | |||||
| { | { | ||||
| bGPdata *gpd = (bGPdata *)ob->data; | bGPdata *gpd = (bGPdata *)ob->data; | ||||
| const bool is_multiedit = GPENCIL_MULTIEDIT_SESSIONS_ON(gpd); | const bool is_multiedit = GPENCIL_MULTIEDIT_SESSIONS_ON(gpd); | ||||
| const bool is_onion = do_onion && ((gpd->flag & GP_DATA_STROKE_WEIGHTMODE) == 0); | const bool is_onion = do_onion && ((gpd->flag & GP_DATA_STROKE_WEIGHTMODE) == 0); | ||||
| const ViewLayer *view_layer = depsgraph ? DEG_get_evaluated_view_layer(depsgraph) : NULL; | |||||
| /* Onion skinning. */ | /* Onion skinning. */ | ||||
| const bool onion_mode_abs = (gpd->onion_mode == GP_ONION_MODE_ABSOLUTE); | const bool onion_mode_abs = (gpd->onion_mode == GP_ONION_MODE_ABSOLUTE); | ||||
| const bool onion_mode_sel = (gpd->onion_mode == GP_ONION_MODE_SELECTED); | const bool onion_mode_sel = (gpd->onion_mode == GP_ONION_MODE_SELECTED); | ||||
| const bool onion_loop = (gpd->onion_flag & GP_ONION_LOOP) != 0; | const bool onion_loop = (gpd->onion_flag & GP_ONION_LOOP) != 0; | ||||
| const short onion_keytype = gpd->onion_keytype; | const short onion_keytype = gpd->onion_keytype; | ||||
| LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { | LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { | ||||
| bGPDframe *act_gpf = gpl->actframe; | bGPDframe *act_gpf = gpl->actframe; | ||||
| bGPDframe *sta_gpf = act_gpf; | bGPDframe *sta_gpf = act_gpf; | ||||
| bGPDframe *end_gpf = act_gpf ? act_gpf->next : NULL; | bGPDframe *end_gpf = act_gpf ? act_gpf->next : NULL; | ||||
| if (gpl->flag & GP_LAYER_HIDE) { | if (gpl->flag & GP_LAYER_HIDE) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| /* Filter view layer to gp layers in the same view layer (for compo). */ | |||||
fclem: comment is hard to understand. | |||||
| if ((view_layer != NULL) && (gpl->viewlayername[0] != '\0') && | |||||
| (!STREQ(view_layer->name, gpl->viewlayername))) { | |||||
| continue; | |||||
| } | |||||
| if (is_multiedit) { | if (is_multiedit) { | ||||
| sta_gpf = end_gpf = NULL; | sta_gpf = end_gpf = NULL; | ||||
| /* Check the whole range and tag the editable frames. */ | /* Check the whole range and tag the editable frames. */ | ||||
| LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { | LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) { | ||||
| if (gpf == act_gpf || (gpf->flag & GP_FRAME_SELECT)) { | if (gpf == act_gpf || (gpf->flag & GP_FRAME_SELECT)) { | ||||
| gpf->runtime.onion_id = 0; | gpf->runtime.onion_id = 0; | ||||
| if (sta_gpf == NULL) { | if (sta_gpf == NULL) { | ||||
| sta_gpf = gpf; | sta_gpf = gpf; | ||||
| ▲ Show 20 Lines • Show All 244 Lines • Show Last 20 Lines | |||||
comment is hard to understand.