diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-06-21 08:01:51 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-06-21 08:01:51 +0400 |
commit | 24ca3eb4c42f3dfb4e2b775f53b35e4c4dcd8367 (patch) | |
tree | bb566767311f1f3b07a91333023cea24d5b657eb /source/blender/editors/space_graph | |
parent | a4178b7a6a1ce804f581c0e3289aa0f912085c78 (diff) |
AnimFiltering Code Cleanups - Part 2
* Changed all int's to size_t's, where the int's were used for size of
channel list returned
* Object vs Base is now passed to filtering functions - was relic from
old owner/ownertype code which required access to bases
* Found bug in NLA code where filter was being overwritten and then
used again as input for some other function unintentionally
* Found bug where trying to select a NLA strip would crash if lamp
data was around
Diffstat (limited to 'source/blender/editors/space_graph')
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_utils.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_graph/space_graph.c | 3 |
3 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 382bb71a592..73ecea8e31e 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -964,7 +964,8 @@ void graph_draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar) View2D *v2d= &ar->v2d; float y= 0.0f, height; - int items, i=0; + size_t items; + int i=0; /* build list of channels to draw */ filter= (ANIMFILTER_VISIBLE|ANIMFILTER_CHANNELS); diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c index e4509a29a91..e20b4593fa9 100644 --- a/source/blender/editors/space_graph/graph_utils.c +++ b/source/blender/editors/space_graph/graph_utils.c @@ -70,7 +70,7 @@ bAnimListElem *get_active_fcurve_channel (bAnimContext *ac) { ListBase anim_data = {NULL, NULL}; int filter= (ANIMFILTER_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_ACTIVE | ANIMFILTER_CURVESONLY); - int items = ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); + size_t items = ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype); /* We take the first F-Curve only, since some other ones may have had 'active' flag set * if they were from linked data. @@ -99,7 +99,8 @@ int graphop_visible_keyframes_poll (bContext *C) bAnimListElem *ale; ListBase anim_data = {NULL, NULL}; ScrArea *sa= CTX_wm_area(C); - int filter, items; + size_t items; + int filter; short found = 0; /* firstly, check if in Graph Editor */ @@ -147,7 +148,8 @@ int graphop_editable_keyframes_poll (bContext *C) bAnimListElem *ale; ListBase anim_data = {NULL, NULL}; ScrArea *sa= CTX_wm_area(C); - int filter, items; + size_t items; + int filter; short found = 0; /* firstly, check if in Graph Editor */ @@ -230,7 +232,8 @@ int graphop_selected_fcurve_poll (bContext *C) bAnimContext ac; ListBase anim_data = {NULL, NULL}; ScrArea *sa= CTX_wm_area(C); - int filter, items; + size_t items; + int filter; /* firstly, check if in Graph Editor */ // TODO: also check for region? diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 883b476f372..24e196749a8 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -513,8 +513,9 @@ static void graph_refresh(const bContext *C, ScrArea *sa) if (ANIM_animdata_get_context(C, &ac)) { ListBase anim_data = {NULL, NULL}; bAnimListElem *ale; + size_t items; int filter; - int items, i; + int i; /* build list of F-Curves which will be visible as channels in channel-region * - we don't include ANIMFILTER_CURVEVISIBLE filter, as that will result in a |