Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/animation/keyframes_draw.c
| Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | |||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "DNA_anim_types.h" | #include "DNA_anim_types.h" | ||||
| #include "DNA_cachefile_types.h" | #include "DNA_cachefile_types.h" | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_gpencil_types.h" | #include "DNA_gpencil_types.h" | ||||
| #include "DNA_brush_types.h" | |||||
| #include "DNA_mask_types.h" | #include "DNA_mask_types.h" | ||||
| #include "BKE_fcurve.h" | #include "BKE_fcurve.h" | ||||
| #include "GPU_draw.h" | #include "GPU_draw.h" | ||||
| #include "GPU_immediate.h" | #include "GPU_immediate.h" | ||||
| #include "GPU_state.h" | #include "GPU_state.h" | ||||
| ▲ Show 20 Lines • Show All 719 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| void draw_gpencil_channel(View2D *v2d, bDopeSheet *ads, bGPdata *gpd, float ypos, float yscale_fac) | void draw_gpencil_channel(View2D *v2d, bDopeSheet *ads, bGPdata *gpd, float ypos, float yscale_fac) | ||||
| { | { | ||||
| DLRBT_Tree keys; | DLRBT_Tree keys; | ||||
| BLI_dlrbTree_init(&keys); | BLI_dlrbTree_init(&keys); | ||||
| gpencil_to_keylist(ads, gpd, &keys); | gpencil_to_keylist(ads, gpd, &keys, false); | ||||
| BLI_dlrbTree_linkedlist_sync(&keys); | BLI_dlrbTree_linkedlist_sync(&keys); | ||||
| draw_keylist(v2d, &keys, NULL, ypos, yscale_fac, false); | draw_keylist(v2d, &keys, NULL, ypos, yscale_fac, false); | ||||
| BLI_dlrbTree_free(&keys); | BLI_dlrbTree_free(&keys); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 219 Lines • ▼ Show 20 Lines | if (act) { | ||||
| /* loop through F-Curves */ | /* loop through F-Curves */ | ||||
| for (fcu = act->curves.first; fcu; fcu = fcu->next) { | for (fcu = act->curves.first; fcu; fcu = fcu->next) { | ||||
| fcurve_to_keylist(adt, fcu, keys, blocks); | fcurve_to_keylist(adt, fcu, keys, blocks); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void gpencil_to_keylist(bDopeSheet *ads, bGPdata *gpd, DLRBT_Tree *keys) | void gpencil_to_keylist(bDopeSheet *ads, bGPdata *gpd, DLRBT_Tree *keys, const bool active) | ||||
| { | { | ||||
| bGPDlayer *gpl; | bGPDlayer *gpl; | ||||
| if (gpd && keys) { | if (gpd && keys) { | ||||
| /* for now, just aggregate out all the frames, but only for visible layers */ | /* for now, just aggregate out all the frames, but only for visible layers */ | ||||
| for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { | for (gpl = gpd->layers.first; gpl; gpl = gpl->next) { | ||||
| if ((gpl->flag & GP_LAYER_HIDE) == 0) { | if ((gpl->flag & GP_LAYER_HIDE) == 0) { | ||||
| if ((!active) || ((active) && (gpl->flag & GP_LAYER_SELECT))) { | |||||
| gpl_to_keylist(ads, gpl, keys); | gpl_to_keylist(ads, gpl, keys); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| void gpl_to_keylist(bDopeSheet *UNUSED(ads), bGPDlayer *gpl, DLRBT_Tree *keys) | void gpl_to_keylist(bDopeSheet *UNUSED(ads), bGPDlayer *gpl, DLRBT_Tree *keys) | ||||
| { | { | ||||
| bGPDframe *gpf; | bGPDframe *gpf; | ||||
| if (gpl && keys) { | if (gpl && keys) { | ||||
| /* although the frames should already be in an ordered list, they are not suitable for displaying yet */ | /* although the frames should already be in an ordered list, they are not suitable for displaying yet */ | ||||
| for (gpf = gpl->frames.first; gpf; gpf = gpf->next) | for (gpf = gpl->frames.first; gpf; gpf = gpf->next) | ||||
| Show All 17 Lines | |||||