diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-07-21 03:12:05 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2012-07-21 03:12:05 +0400 |
commit | 3b012c041f1fb7b78eddcf1f93288cf7a86ab8d6 (patch) | |
tree | cead235bff7687610b1372e709e742ef70692dcb /source/blender/editors/animation/anim_filter.c | |
parent | 5a581c1fd116c51df13e09c5c320feba48d069bb (diff) | |
parent | 16516238e2b25ce53144c2dcea5323dc7313b724 (diff) |
Merged changes in the trunk up to revision 49090.
Diffstat (limited to 'source/blender/editors/animation/anim_filter.c')
-rw-r--r-- | source/blender/editors/animation/anim_filter.c | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 81b6d77dd82..035641b2888 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -418,16 +418,16 @@ short ANIM_animdata_get_context(const bContext *C, bAnimContext *ac) * * For this to work correctly, a standard set of data needs to be available within the scope that this * gets called in: - * - ListBase anim_data; - * - bDopeSheet *ads; - * - bAnimListElem *ale; + * - ListBase anim_data; + * - bDopeSheet *ads; + * - bAnimListElem *ale; * - size_t items; * * - id: ID block which should have an AnimData pointer following it immediately, to use - * - adtOk: line or block of code to execute for AnimData-blocks case (usually ANIMDATA_ADD_ANIMDATA) - * - nlaOk: line or block of code to execute for NLA tracks+strips case - * - driversOk: line or block of code to execute for Drivers case - * - keysOk: line or block of code for Keyframes case + * - adtOk: line or block of code to execute for AnimData-blocks case (usually ANIMDATA_ADD_ANIMDATA) + * - nlaOk: line or block of code to execute for NLA tracks+strips case + * - driversOk: line or block of code to execute for Drivers case + * - keysOk: line or block of code for Keyframes case * * The checks for the various cases are as follows: * 0) top level: checks for animdata and also that all the F-Curves for the block will be visible @@ -1330,6 +1330,7 @@ static size_t animdata_filter_shapekey(bAnimContext *ac, ListBase *anim_data, Ke return items; } +/* Helper for Grease Pencil - layers within a datablock */ static size_t animdata_filter_gpencil_data(ListBase *anim_data, bGPdata *gpd, int filter_mode) { bGPDlayer *gpl; @@ -1396,6 +1397,7 @@ static size_t animdata_filter_gpencil(ListBase *anim_data, void *UNUSED(data), i return items; } +/* Helper for Mask Editing - mask layers */ static size_t animdata_filter_mask_data(ListBase *anim_data, Mask *mask, const int filter_mode) { MaskLayer *masklay_act = BKE_mask_layer_active(mask); @@ -1412,18 +1414,6 @@ static size_t animdata_filter_mask_data(ListBase *anim_data, Mask *mask, const i if (!(filter_mode & ANIMFILTER_ACTIVE) || (masklay_act == masklay)) { /* add to list */ ANIMCHANNEL_NEW_CHANNEL(masklay, ANIMTYPE_MASKLAYER, mask); - - -// if (filter_mode & ANIMFILTER_TMP_PEEK) -// return 1; -// else { -// bAnimListElem *ale = make_new_animlistelem(masklay, channel_type, (ID *)owner_id); -// if (ale) { -// BLI_addtail(anim_data, ale); -// items ++; -// } -// } - } // } } @@ -1432,28 +1422,29 @@ static size_t animdata_filter_mask_data(ListBase *anim_data, Mask *mask, const i return items; } +/* Grab all mask data */ static size_t animdata_filter_mask(ListBase *anim_data, void *UNUSED(data), int filter_mode) { Mask *mask; size_t items = 0; - - /* for now, grab grease pencil datablocks directly from main */ + + /* for now, grab mask datablocks directly from main */ // XXX: this is not good... for (mask = G.main->mask.first; mask; mask = mask->id.next) { ListBase tmp_data = {NULL, NULL}; size_t tmp_items = 0; - - /* only show if gpd is used by something... */ + + /* only show if mask is used by something... */ if (ID_REAL_USERS(mask) < 1) continue; - - /* add gpencil animation channels */ + + /* add mask animation channels */ BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_MASK(mask)) { tmp_items += animdata_filter_mask_data(&tmp_data, mask, filter_mode); } END_ANIMFILTER_SUBCHANNELS; - + /* did we find anything? */ if (tmp_items) { /* include data-expand widget first */ @@ -1461,14 +1452,14 @@ static size_t animdata_filter_mask(ListBase *anim_data, void *UNUSED(data), int /* add gpd as channel too (if for drawing, and it has layers) */ ANIMCHANNEL_NEW_CHANNEL(mask, ANIMTYPE_MASKDATABLOCK, NULL); } - + /* now add the list of collected channels */ BLI_movelisttolist(anim_data, &tmp_data); BLI_assert((tmp_data.first == tmp_data.last) && (tmp_data.first == NULL)); items += tmp_items; } } - + /* return the number of items added to the list */ return items; } @@ -2453,7 +2444,7 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mo items += animfilter_action(ac, anim_data, ads, data, filter_mode, (ID *)obact); } break; - + case ANIMCONT_SHAPEKEY: /* 'ShapeKey Editor' */ { /* the check for the DopeSheet summary is included here since the summary works here too */ @@ -2468,14 +2459,14 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mo items = animdata_filter_gpencil(anim_data, data, filter_mode); } break; - + case ANIMCONT_MASK: { if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items)) items = animdata_filter_mask(anim_data, data, filter_mode); } break; - + case ANIMCONT_DOPESHEET: /* 'DopeSheet Editor' */ { /* the DopeSheet editor is the primary place where the DopeSheet summaries are useful */ |