style cleanup: animation + buttons
authorCampbell Barton <ideasman42@gmail.com>
Tue, 8 May 2012 15:30:00 +0000 (15:30 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 8 May 2012 15:30:00 +0000 (15:30 +0000)
19 files changed:
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_deps.c
source/blender/editors/animation/anim_draw.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/animation/anim_intern.h
source/blender/editors/animation/anim_ipo_utils.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/anim_ops.c
source/blender/editors/animation/drivers.c
source/blender/editors/animation/keyframes_draw.c
source/blender/editors/animation/keyframes_edit.c
source/blender/editors/animation/keyframes_general.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/buttons_header.c
source/blender/editors/space_buttons/buttons_intern.h
source/blender/editors/space_buttons/buttons_ops.c
source/blender/editors/space_buttons/buttons_texture.c
source/blender/editors/space_buttons/space_buttons.c

index e3c1aacd7acdec6739327ad95c2f2140ee7a1846..df8c1d2907920ca9bef57e2a7ecef58be94677fa 100644 (file)
@@ -80,7 +80,7 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
                return;
                
        /* only clear the 'active' flag for the channels of the same type */
-       for (ale= anim_data.first; ale; ale= ale->next) {
+       for (ale = anim_data.first; ale; ale = ale->next) {
                /* skip if types don't match */
                if (channel_type != ale->type)
                        continue;
@@ -89,28 +89,28 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
                switch (ale->type) {
                        case ANIMTYPE_GROUP:
                        {
-                               bActionGroup *agrp= (bActionGroup *)ale->data;
+                               bActionGroup *agrp = (bActionGroup *)ale->data;
                                
                                ACHANNEL_SET_FLAG(agrp, ACHANNEL_SETFLAG_CLEAR, AGRP_ACTIVE);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_FCURVE:
                        {
-                               FCurve *fcu= (FCurve *)ale->data;
+                               FCurve *fcu = (FCurve *)ale->data;
                                
                                ACHANNEL_SET_FLAG(fcu, ACHANNEL_SETFLAG_CLEAR, FCURVE_ACTIVE);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_NLATRACK:
                        {
-                               NlaTrack *nlt= (NlaTrack *)ale->data;
+                               NlaTrack *nlt = (NlaTrack *)ale->data;
                                
                                ACHANNEL_SET_FLAG(nlt, ACHANNEL_SETFLAG_CLEAR, NLATRACK_ACTIVE);
                        }
-                               break;
+                       break;
                        
                        case ANIMTYPE_FILLACTD: /* Action Expander */
-                       case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
+                       case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
                        case ANIMTYPE_DSLAM:
                        case ANIMTYPE_DSCAM:
                        case ANIMTYPE_DSCUR:
@@ -129,7 +129,7 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
                                        ACHANNEL_SET_FLAG(ale->adt, ACHANNEL_SETFLAG_CLEAR, ADT_UI_ACTIVE);
                                }
                        }
-                               break;
+                       break;
                }
        }
        
@@ -138,25 +138,25 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
                switch (channel_type) {
                        case ANIMTYPE_GROUP:
                        {
-                               bActionGroup *agrp= (bActionGroup *)channel_data;
+                               bActionGroup *agrp = (bActionGroup *)channel_data;
                                agrp->flag |= AGRP_ACTIVE;
                        }
-                               break;
+                       break;
                        case ANIMTYPE_FCURVE:
                        {
-                               FCurve *fcu= (FCurve *)channel_data;
+                               FCurve *fcu = (FCurve *)channel_data;
                                fcu->flag |= FCURVE_ACTIVE;
                        }
-                               break;
+                       break;
                        case ANIMTYPE_NLATRACK:
                        {
-                               NlaTrack *nlt= (NlaTrack *)channel_data;
+                               NlaTrack *nlt = (NlaTrack *)channel_data;
                                nlt->flag |= NLATRACK_ACTIVE;
                        }
-                               break;
+                       break;
                                
                        case ANIMTYPE_FILLACTD: /* Action Expander */
-                       case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
+                       case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
                        case ANIMTYPE_DSLAM:
                        case ANIMTYPE_DSCAM:
                        case ANIMTYPE_DSCUR:
@@ -174,7 +174,7 @@ void ANIM_set_active_channel(bAnimContext *ac, void *data, short datatype, int f
                                        ale->adt->flag |= ADT_UI_ACTIVE;
                                }
                        }
-                               break;
+                       break;
                }
        }
        
@@ -196,45 +196,45 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
        
        /* filter data */
        /* NOTE: no list visible, otherwise, we get dangling */
-       filter= ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_CHANNELS;
+       filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_CHANNELS;
        ANIM_animdata_filter(ac, &anim_data, filter, data, datatype);
        
        /* See if we should be selecting or deselecting */
        if (test) {
-               for (ale= anim_data.first; ale; ale= ale->next) {
+               for (ale = anim_data.first; ale; ale = ale->next) {
                        if (sel == 0) 
                                break;
                        
                        switch (ale->type) {
                                case ANIMTYPE_SCENE:
                                        if (ale->flag & SCE_DS_SELECTED)
-                                               sel= ACHANNEL_SETFLAG_CLEAR;
+                                               sel = ACHANNEL_SETFLAG_CLEAR;
                                        break;
                                case ANIMTYPE_OBJECT:
-                               #if 0   /* for now, do not take object selection into account, since it gets too annoying */
+                               #if 0   /* for now, do not take object selection into account, since it gets too annoying */
                                        if (ale->flag & SELECT)
-                                               sel= ACHANNEL_SETFLAG_CLEAR;
+                                               sel = ACHANNEL_SETFLAG_CLEAR;
                                #endif
                                        break;
                                case ANIMTYPE_GROUP:
                                        if (ale->flag & AGRP_SELECTED)
-                                               sel= ACHANNEL_SETFLAG_CLEAR;
+                                               sel = ACHANNEL_SETFLAG_CLEAR;
                                        break;
                                case ANIMTYPE_FCURVE:
                                        if (ale->flag & FCURVE_SELECTED)
-                                               sel= ACHANNEL_SETFLAG_CLEAR;
+                                               sel = ACHANNEL_SETFLAG_CLEAR;
                                        break;
                                case ANIMTYPE_SHAPEKEY:
                                        if (ale->flag & KEYBLOCK_SEL)
-                                               sel= ACHANNEL_SETFLAG_CLEAR;
+                                               sel = ACHANNEL_SETFLAG_CLEAR;
                                        break;
                                case ANIMTYPE_NLATRACK:
                                        if (ale->flag & NLATRACK_SELECTED)
-                                               sel= ACHANNEL_SETFLAG_CLEAR;
+                                               sel = ACHANNEL_SETFLAG_CLEAR;
                                        break;
                                        
                                case ANIMTYPE_FILLACTD: /* Action Expander */
-                               case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
+                               case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
                                case ANIMTYPE_DSLAM:
                                case ANIMTYPE_DSCAM:
                                case ANIMTYPE_DSCUR:
@@ -250,24 +250,24 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
                                case ANIMTYPE_DSSPK:
                                {
                                        if ((ale->adt) && (ale->adt->flag & ADT_UI_SELECTED))
-                                               sel= ACHANNEL_SETFLAG_CLEAR;
+                                               sel = ACHANNEL_SETFLAG_CLEAR;
                                }
-                                       break;
+                               break;
                                        
                                case ANIMTYPE_GPLAYER:
                                        if (ale->flag & GP_LAYER_SELECT)
-                                               sel= ACHANNEL_SETFLAG_CLEAR;
+                                               sel = ACHANNEL_SETFLAG_CLEAR;
                                        break;
                        }
                }
        }
                
        /* Now set the flags */
-       for (ale= anim_data.first; ale; ale= ale->next) {
+       for (ale = anim_data.first; ale; ale = ale->next) {
                switch (ale->type) {
                        case ANIMTYPE_SCENE:
                        {
-                               Scene *scene= (Scene *)ale->data;
+                               Scene *scene = (Scene *)ale->data;
                                
                                ACHANNEL_SET_FLAG(scene, sel, SCE_DS_SELECTED);
                                
@@ -275,56 +275,56 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
                                        ACHANNEL_SET_FLAG(scene, sel, ADT_UI_SELECTED);
                                }
                        }
-                               break;
+                       break;
                        case ANIMTYPE_OBJECT:
-                       #if 0   /* for now, do not take object selection into account, since it gets too annoying */
-                       {
-                               Base *base= (Base *)ale->data;
-                               Object *ob= base->object;
+                       #if 0   /* for now, do not take object selection into account, since it gets too annoying */
+                               {
+                                       Base *base = (Base *)ale->data;
+                                       Object *ob = base->object;
                                
-                               ACHANNEL_SET_FLAG(base, sel, SELECT);
-                               ACHANNEL_SET_FLAG(ob, sel, SELECT);
+                                       ACHANNEL_SET_FLAG(base, sel, SELECT);
+                                       ACHANNEL_SET_FLAG(ob, sel, SELECT);
                                
-                               if (ob->adt) {
-                                       ACHANNEL_SET_FLAG(ob, sel, ADT_UI_SELECTED);
+                                       if (ob->adt) {
+                                               ACHANNEL_SET_FLAG(ob, sel, ADT_UI_SELECTED);
+                                       }
                                }
-                       }
                        #endif
                                break;
                        case ANIMTYPE_GROUP:
                        {
-                               bActionGroup *agrp= (bActionGroup *)ale->data;
+                               bActionGroup *agrp = (bActionGroup *)ale->data;
                                
                                ACHANNEL_SET_FLAG(agrp, sel, AGRP_SELECTED);
                                agrp->flag &= ~AGRP_ACTIVE;
                        }
-                               break;
+                       break;
                        case ANIMTYPE_FCURVE:
                        {
-                               FCurve *fcu= (FCurve *)ale->data;
+                               FCurve *fcu = (FCurve *)ale->data;
                                
                                ACHANNEL_SET_FLAG(fcu, sel, FCURVE_SELECTED);
                                fcu->flag &= ~FCURVE_ACTIVE;
                        }
-                               break;
+                       break;
                        case ANIMTYPE_SHAPEKEY:
                        {
-                               KeyBlock *kb= (KeyBlock *)ale->data;
+                               KeyBlock *kb = (KeyBlock *)ale->data;
                                
                                ACHANNEL_SET_FLAG(kb, sel, KEYBLOCK_SEL);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_NLATRACK:
                        {
-                               NlaTrack *nlt= (NlaTrack *)ale->data;
+                               NlaTrack *nlt = (NlaTrack *)ale->data;
                                
                                ACHANNEL_SET_FLAG(nlt, sel, NLATRACK_SELECTED);
                                nlt->flag &= ~NLATRACK_ACTIVE;
                        }
-                               break;
+                       break;
                                
                        case ANIMTYPE_FILLACTD: /* Action Expander */
-                       case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
+                       case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
                        case ANIMTYPE_DSLAM:
                        case ANIMTYPE_DSCAM:
                        case ANIMTYPE_DSCUR:
@@ -345,7 +345,7 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
                                        ale->adt->flag &= ~ADT_UI_ACTIVE;
                                }
                        }
-                               break;
+                       break;
                                
                        case ANIMTYPE_GPLAYER:
                        {
@@ -353,7 +353,7 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
                                
                                ACHANNEL_SET_FLAG(gpl, sel, GP_LAYER_SELECT);
                        }
-                               break;
+                       break;
                }
        }
        
@@ -374,21 +374,21 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, short datatype, s
  */
 void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAnimListElem *ale_setting, int setting, short on)
 {
-       bAnimListElem *ale, *match=NULL;
-       int prevLevel=0, matchLevel=0;
+       bAnimListElem *ale, *match = NULL;
+       int prevLevel = 0, matchLevel = 0;
        
        /* sanity check */
        if (ELEM(NULL, anim_data, anim_data->first))
                return;
        
        /* find the channel that got changed */
-       for (ale= anim_data->first; ale; ale= ale->next) {
+       for (ale = anim_data->first; ale; ale = ale->next) {
                /* compare data, and type as main way of identifying the channel */
                if ((ale->data == ale_setting->data) && (ale->type == ale_setting->type)) {
                        /* we also have to check the ID, this is assigned to, since a block may have multiple users */
                        // TODO: is the owner-data more revealing?
                        if (ale->id == ale_setting->id) {
-                               match= ale;
+                               match = ale;
                                break;
                        }
                }
@@ -398,7 +398,7 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn
                return;
        }
        else {
-               bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale_setting);
+               bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale_setting);
                
                if (acf == NULL) {
                        printf("ERROR: no channel info for the changed channel\n");
@@ -406,10 +406,10 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn
                }
                
                /* get the level of the channel that was affected
-                *       - we define the level as simply being the offset for the start of the channel
+                *   - we define the level as simply being the offset for the start of the channel
                 */
-               matchLevel= (acf->get_offset)? acf->get_offset(ac, ale_setting) : 0;
-               prevLevel= matchLevel;
+               matchLevel = (acf->get_offset) ? acf->get_offset(ac, ale_setting) : 0;
+               prevLevel = matchLevel;
        }
        
        /* flush up? 
@@ -423,11 +423,11 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn
         *        (otherwise, it's too much work to force the parents to be active too)
         */
        if ( ((setting == ACHANNEL_SETTING_VISIBLE) && on) ||
-                ((setting != ACHANNEL_SETTING_VISIBLE) && on==0) )
+            ((setting != ACHANNEL_SETTING_VISIBLE) && on == 0) )
        {
                /* go backwards in the list, until the highest-ranking element (by indention has been covered) */
-               for (ale= match->prev; ale; ale= ale->prev) {
-                       bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+               for (ale = match->prev; ale; ale = ale->prev) {
+                       bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
                        int level;
                        
                        /* if no channel info was found, skip, since this type might not have any useful info */
@@ -435,9 +435,9 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn
                                continue;
                        
                        /* get the level of the current channel traversed 
-                        *       - we define the level as simply being the offset for the start of the channel
+                        *   - we define the level as simply being the offset for the start of the channel
                         */
-                       level= (acf->get_offset)? acf->get_offset(ac, ale) : 0;
+                       level = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
                        
                        /* if the level is 'less than' (i.e. more important) the level we're matching
                         * but also 'less than' the level just tried (i.e. only the 1st group above grouped F-Curves, 
@@ -449,7 +449,7 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn
                                ANIM_channel_setting_set(ac, ale, setting, on);
                                
                                /* store this level as the 'old' level now */
-                               prevLevel= level;
+                               prevLevel = level;
                        }       
                        /* if the level is 'greater than' (i.e. less important) than the previous level... */
                        else if (level > prevLevel) {
@@ -470,8 +470,8 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn
        /* flush down (always) */
        {
                /* go forwards in the list, until the lowest-ranking element (by indention has been covered) */
-               for (ale= match->next; ale; ale= ale->next) {
-                       bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
+               for (ale = match->next; ale; ale = ale->next) {
+                       bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
                        int level;
                        
                        /* if no channel info was found, skip, since this type might not have any useful info */
@@ -479,9 +479,9 @@ void ANIM_flush_setting_anim_channels(bAnimContext *ac, ListBase *anim_data, bAn
                                continue;
                        
                        /* get the level of the current channel traversed 
-                        *       - we define the level as simply being the offset for the start of the channel
+                        *   - we define the level as simply being the offset for the start of the channel
                         */
-                       level= (acf->get_offset)? acf->get_offset(ac, ale) : 0;
+                       level = (acf->get_offset) ? acf->get_offset(ac, ale) : 0;
                        
                        /* if the level is 'greater than' (i.e. less important) the channel that was changed, 
                         * flush the new status...
@@ -537,11 +537,11 @@ void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, AnimData *adt, FCurve *f
                 * channel list that are empty, and linger around long after the data they
                 * are for has disappeared (and probably won't come back).
                 */
-                       // XXX: does everybody always want this?
-                       /* XXX: there's a problem where many actions could build up in the file if multiple
-                        * full add/delete cycles are performed on the same objects, but assume that this is rare
-                        */
-               if ((adt->action->curves.first == NULL) && (adt->flag & ADT_NLA_EDIT_ON)==0) {
+               // XXX: does everybody always want this?
+               /* XXX: there's a problem where many actions could build up in the file if multiple
+                * full add/delete cycles are performed on the same objects, but assume that this is rare
+                */
+               if ((adt->action->curves.first == NULL) && (adt->flag & ADT_NLA_EDIT_ON) == 0) {
                        id_us_min(&adt->action->id);
                        adt->action = NULL;
                }
@@ -557,9 +557,9 @@ void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, AnimData *adt, FCurve *f
 /* ****************** Operator Utilities ********************************** */
 
 /* poll callback for being in an Animation Editor channels list region */
-static int animedit_poll_channels_active (bContext *C)
+static int animedit_poll_channels_active(bContext *C)
 {
-       ScrArea *sa= CTX_wm_area(C);
+       ScrArea *sa = CTX_wm_area(C);
        
        /* channels region test */
        // TODO: could enhance with actually testing if channels region?
@@ -573,9 +573,9 @@ static int animedit_poll_channels_active (bContext *C)
 }
 
 /* poll callback for Animation Editor channels list region + not in NLA-tweakmode for NLA */
-static int animedit_poll_channels_nla_tweakmode_off (bContext *C)
+static int animedit_poll_channels_nla_tweakmode_off(bContext *C)
 {
-       ScrArea *sa= CTX_wm_area(C);
+       ScrArea *sa = CTX_wm_area(C);
        Scene *scene = CTX_data_scene(C);
        
        /* channels region test */
@@ -600,10 +600,10 @@ static int animedit_poll_channels_nla_tweakmode_off (bContext *C)
 /* constants for channel rearranging */
 /* WARNING: don't change exising ones without modifying rearrange func accordingly */
 enum {
-       REARRANGE_ANIMCHAN_TOP= -2,
-       REARRANGE_ANIMCHAN_UP= -1,
-       REARRANGE_ANIMCHAN_DOWN= 1,
-       REARRANGE_ANIMCHAN_BOTTOM= 2
+       REARRANGE_ANIMCHAN_TOP = -2,
+       REARRANGE_ANIMCHAN_UP = -1,
+       REARRANGE_ANIMCHAN_DOWN = 1,
+       REARRANGE_ANIMCHAN_BOTTOM = 2
 };
 
 /* defines for rearranging channels */
@@ -621,21 +621,21 @@ static EnumPropertyItem prop_animchannel_rearrange_types[] = {
 typedef struct tReorderChannelIsland {
        struct tReorderChannelIsland *next, *prev;
        
-       ListBase channels;      /* channels within this region with the same state */
-       int flag;                       /* eReorderIslandFlag */
+       ListBase channels;  /* channels within this region with the same state */
+       int flag;           /* eReorderIslandFlag */
 } tReorderChannelIsland;
 
 /* flags for channel reordering islands */
 typedef enum eReorderIslandFlag {
-       REORDER_ISLAND_SELECTED                 = (1<<0),       /* island is selected */
-       REORDER_ISLAND_UNTOUCHABLE              = (1<<1),       /* island should be ignored */
-       REORDER_ISLAND_MOVED                    = (1<<2)        /* island has already been moved */
+       REORDER_ISLAND_SELECTED         = (1 << 0),   /* island is selected */
+       REORDER_ISLAND_UNTOUCHABLE      = (1 << 1),   /* island should be ignored */
+       REORDER_ISLAND_MOVED            = (1 << 2)    /* island has already been moved */
 } eReorderIslandFlag;
 
 
 /* Rearrange Methods --------------------------------------------- */
 
-static short rearrange_island_ok (tReorderChannelIsland *island)
+static short rearrange_island_ok(tReorderChannelIsland *island)
 {
        /* island must not be untouchable */
        if (island->flag & REORDER_ISLAND_UNTOUCHABLE)
@@ -647,7 +647,7 @@ static short rearrange_island_ok (tReorderChannelIsland *island)
 
 /* ............................. */
 
-static short rearrange_island_top (ListBase *list, tReorderChannelIsland *island)
+static short rearrange_island_top(ListBase *list, tReorderChannelIsland *island)
 {
        if (rearrange_island_ok(island)) {
                /* remove from current position */
@@ -662,11 +662,11 @@ static short rearrange_island_top (ListBase *list, tReorderChannelIsland *island
        return 0;
 }
 
-static short rearrange_island_up (ListBase *list, tReorderChannelIsland *island)
+static short rearrange_island_up(ListBase *list, tReorderChannelIsland *island)
 {
        if (rearrange_island_ok(island)) {
                /* moving up = moving before the previous island, otherwise we're in the same place */
-               tReorderChannelIsland *prev= island->prev;
+               tReorderChannelIsland *prev = island->prev;
                
                if (prev) {
                        /* remove from current position */
@@ -682,7 +682,7 @@ static short rearrange_island_up (ListBase *list, tReorderChannelIsland *island)
        return 0;
 }
 
-static short rearrange_island_down (ListBase *list, tReorderChannelIsland *island)
+static short rearrange_island_down(ListBase *list, tReorderChannelIsland *island)
 {
        if (rearrange_island_ok(island)) {
                /* moving down = moving after the next island, otherwise we're in the same place */
@@ -690,7 +690,7 @@ static short rearrange_island_down (ListBase *list, tReorderChannelIsland *islan
                
                if (next) {
                        /* can only move past if next is not untouchable (i.e. nothing can go after it) */
-                       if ((next->flag & REORDER_ISLAND_UNTOUCHABLE)==0) {
+                       if ((next->flag & REORDER_ISLAND_UNTOUCHABLE) == 0) {
                                /* remove from current position */
                                BLI_remlink(list, island);
                                
@@ -706,7 +706,7 @@ static short rearrange_island_down (ListBase *list, tReorderChannelIsland *islan
        return 0;
 }
 
-static short rearrange_island_bottom (ListBase *list, tReorderChannelIsland *island)
+static short rearrange_island_bottom(ListBase *list, tReorderChannelIsland *island)
 {
        if (rearrange_island_ok(island)) {
                tReorderChannelIsland *last = list->last;
@@ -715,7 +715,7 @@ static short rearrange_island_bottom (ListBase *list, tReorderChannelIsland *isl
                BLI_remlink(list, island);
                
                /* add before or after the last channel? */
-               if ((last->flag & REORDER_ISLAND_UNTOUCHABLE)==0) {
+               if ((last->flag & REORDER_ISLAND_UNTOUCHABLE) == 0) {
                        /* can add after it */
                        BLI_addtail(list, island);
                }
@@ -741,7 +741,7 @@ static short rearrange_island_bottom (ListBase *list, tReorderChannelIsland *isl
 typedef short (*AnimChanRearrangeFp)(ListBase *list, tReorderChannelIsland *island);
 
 /* get rearranging function, given 'rearrange' mode */
-static AnimChanRearrangeFp rearrange_get_mode_func (short mode)
+static AnimChanRearrangeFp rearrange_get_mode_func(short mode)
 {
        switch (mode) {
                case REARRANGE_ANIMCHAN_TOP:
@@ -760,35 +760,35 @@ static AnimChanRearrangeFp rearrange_get_mode_func (short mode)
 /* Rearrange Islands Generics ------------------------------------- */
 
 /* add channel into list of islands */
-static void rearrange_animchannel_add_to_islands (ListBase *islands, ListBase *srcList, Link *channel, short type)
+static void rearrange_animchannel_add_to_islands(ListBase *islands, ListBase *srcList, Link *channel, short type)
 {
-       tReorderChannelIsland *island = islands->last;  /* always try to add to last island if possible */
-       short is_sel=0, is_untouchable=0;
+       tReorderChannelIsland *island = islands->last;  /* always try to add to last island if possible */
+       short is_sel = 0, is_untouchable = 0;
        
        /* get flags - selected and untouchable from the channel */
        switch (type) {
                case ANIMTYPE_GROUP:
                {
-                       bActionGroup *agrp= (bActionGroup *)channel;
+                       bActionGroup *agrp = (bActionGroup *)channel;
                        
-                       is_sel= SEL_AGRP(agrp);
-                       is_untouchable= (agrp->flag & AGRP_TEMP) != 0;
+                       is_sel = SEL_AGRP(agrp);
+                       is_untouchable = (agrp->flag & AGRP_TEMP) != 0;
                }
-                       break;
+               break;
                case ANIMTYPE_FCURVE:
                {
-                       FCurve *fcu= (FCurve *)channel;
+                       FCurve *fcu = (FCurve *)channel;
                        
-                       is_sel= SEL_FCU(fcu);
+                       is_sel = SEL_FCU(fcu);
                }       
-                       break;
+               break;
                case ANIMTYPE_NLATRACK:
                {
-                       NlaTrack *nlt= (NlaTrack *)channel;
+                       NlaTrack *nlt = (NlaTrack *)channel;
                        
-                       is_sel= SEL_NLT(nlt);
+                       is_sel = SEL_NLT(nlt);
                }
-                       break;
+               break;
                        
                default:
                        printf("rearrange_animchannel_add_to_islands(): don't know how to handle channels of type %d\n", type);
@@ -797,8 +797,8 @@ static void rearrange_animchannel_add_to_islands (ListBase *islands, ListBase *s
        
        /* do we need to add to a new island? */
        if ((island == NULL) ||                                 /* 1) no islands yet */
-               ((island->flag & REORDER_ISLAND_SELECTED) == 0) ||  /* 2) unselected islands have single channels only - to allow up/down movement */
-               (is_sel == 0))                                      /* 3) if channel is unselected, stop existing island (it was either wrong sel status, or full already) */
+           ((island->flag & REORDER_ISLAND_SELECTED) == 0) ||  /* 2) unselected islands have single channels only - to allow up/down movement */
+           (is_sel == 0))                                      /* 3) if channel is unselected, stop existing island (it was either wrong sel status, or full already) */
        {
                /* create a new island now */
                island = MEM_callocN(sizeof(tReorderChannelIsland), "tReorderChannelIsland");
@@ -816,9 +816,9 @@ static void rearrange_animchannel_add_to_islands (ListBase *islands, ListBase *s
 }
 
 /* flatten islands out into a single list again */
-static void rearrange_animchannel_flatten_islands (ListBase *islands, ListBase *srcList)
+static void rearrange_animchannel_flatten_islands(ListBase *islands, ListBase *srcList)
 {
-       tReorderChannelIsland *island, *isn=NULL;
+       tReorderChannelIsland *island, *isn = NULL;
        
        /* make sure srcList is empty now */
        BLI_assert(srcList->first == NULL);
@@ -836,10 +836,10 @@ static void rearrange_animchannel_flatten_islands (ListBase *islands, ListBase *
 /* ............................. */
 
 /* performing rearranging of channels using islands */
-static short rearrange_animchannel_islands (ListBase *list, AnimChanRearrangeFp rearrange_func, short mode, short type)
+static short rearrange_animchannel_islands(ListBase *list, AnimChanRearrangeFp rearrange_func, short mode, short type)
 {
        ListBase islands = {NULL, NULL};
-       Link *channel, *chanNext=NULL;
+       Link *channel, *chanNext = NULL;
        short done = 0;
        
        /* don't waste effort on an empty list */
@@ -858,7 +858,7 @@ static short rearrange_animchannel_islands (ListBase *list, AnimChanRearrangeFp
         */
        if (islands.first != islands.last) {
                tReorderChannelIsland *first = (mode > 0) ? islands.last : islands.first;
-               tReorderChannelIsland *island, *isn=NULL;
+               tReorderChannelIsland *island, *isn = NULL;
                
                for (island = first; island; island = isn) {
                        isn = (mode > 0) ? island->prev : island->next;
@@ -884,7 +884,7 @@ static short rearrange_animchannel_islands (ListBase *list, AnimChanRearrangeFp
  * ! NLA tracks are displayed in opposite order, so directions need care
  *     mode: REARRANGE_ANIMCHAN_*  
  */
-static void rearrange_nla_channels (bAnimContext *UNUSED(ac), AnimData *adt, short mode)
+static void rearrange_nla_channels(bAnimContext *UNUSED(ac), AnimData *adt, short mode)
 {
        AnimChanRearrangeFp rearrange_func;
        
@@ -909,7 +909,7 @@ static void rearrange_nla_channels (bAnimContext *UNUSED(ac), AnimData *adt, sho
 /* Change the order drivers within AnimData block
  *     mode: REARRANGE_ANIMCHAN_*  
  */
-static void rearrange_driver_channels (bAnimContext *UNUSED(ac), AnimData *adt, short mode)
+static void rearrange_driver_channels(bAnimContext *UNUSED(ac), AnimData *adt, short mode)
 {
        /* get rearranging function */
        AnimChanRearrangeFp rearrange_func = rearrange_get_mode_func(mode);
@@ -928,7 +928,7 @@ static void rearrange_driver_channels (bAnimContext *UNUSED(ac), AnimData *adt,
 /* Action Specific Stuff ------------------------------------------------- */
 
 /* make sure all action-channels belong to a group (and clear action's list) */
-static void split_groups_action_temp (bAction *act, bActionGroup *tgrp)
+static void split_groups_action_temp(bAction *act, bActionGroup *tgrp)
 {
        bActionGroup *agrp;
        FCurve *fcu;
@@ -937,37 +937,37 @@ static void split_groups_action_temp (bAction *act, bActionGroup *tgrp)
                return;
        
        /* Separate F-Curves into lists per group */
-       for (agrp= act->groups.first; agrp; agrp= agrp->next) {
+       for (agrp = act->groups.first; agrp; agrp = agrp->next) {
                if (agrp->channels.first) {
-                       fcu= agrp->channels.last;
-                       act->curves.first= fcu->next;
+                       fcu = agrp->channels.last;
+                       act->curves.first = fcu->next;
                        
-                       fcu= agrp->channels.first;
-                       fcu->prev= NULL;
+                       fcu = agrp->channels.first;
+                       fcu->prev = NULL;
                        
-                       fcu= agrp->channels.last;
-                       fcu->next= NULL;
+                       fcu = agrp->channels.last;
+                       fcu->next = NULL;
                }
        }
        
        /* Initialize memory for temp-group */
        memset(tgrp, 0, sizeof(bActionGroup));
-       tgrp->flag |= (AGRP_EXPANDED|AGRP_TEMP);
+       tgrp->flag |= (AGRP_EXPANDED | AGRP_TEMP);
        BLI_strncpy(tgrp->name, "#TempGroup", sizeof(tgrp->name));
        
        /* Move any action-channels not already moved, to the temp group */
        if (act->curves.first) {
                /* start of list */
-               fcu= act->curves.first;
-               fcu->prev= NULL;
-               tgrp->channels.first= fcu;
-               act->curves.first= NULL;
+               fcu = act->curves.first;
+               fcu->prev = NULL;
+               tgrp->channels.first = fcu;
+               act->curves.first = NULL;
                
                /* end of list */
-               fcu= act->curves.last;
-               fcu->next= NULL;
-               tgrp->channels.last= fcu;
-               act->curves.last= NULL;
+               fcu = act->curves.last;
+               fcu->next = NULL;
+               tgrp->channels.last = fcu;
+               act->curves.last = NULL;
        }
        
        /* Add temp-group to list */
@@ -975,17 +975,17 @@ static void split_groups_action_temp (bAction *act, bActionGroup *tgrp)
 }
 
 /* link lists of channels that groups have */
-static void join_groups_action_temp (bAction *act)
+static void join_groups_action_temp(bAction *act)
 {
        bActionGroup *agrp;
        
-       for (agrp= act->groups.first; agrp; agrp= agrp->next) {
+       for (agrp = act->groups.first; agrp; agrp = agrp->next) {
                ListBase tempGroup;
                
                /* add list of channels to action's channels */
-               tempGroup= agrp->channels;
+               tempGroup = agrp->channels;
                BLI_movelisttolist(&act->curves, &agrp->channels);
-               agrp->channels= tempGroup;
+               agrp->channels = tempGroup;
                
                /* clear moved flag */
                agrp->flag &= ~AGRP_MOVED;
@@ -1001,7 +1001,7 @@ static void join_groups_action_temp (bAction *act)
 /* Change the order of anim-channels within action 
  *     mode: REARRANGE_ANIMCHAN_*  
  */
-static void rearrange_action_channels (bAnimContext *ac, bAction *act, short mode)
+static void rearrange_action_channels(bAnimContext *ac, bAction *act, short mode)
 {
        bActionGroup tgrp;
        short do_channels;
@@ -1024,7 +1024,7 @@ static void rearrange_action_channels (bAnimContext *ac, bAction *act, short mod
        if (do_channels) {
                bActionGroup *agrp;
                
-               for (agrp= act->groups.first; agrp; agrp= agrp->next) {
+               for (agrp = act->groups.first; agrp; agrp = agrp->next) {
                        /* only consider F-Curves if they're visible (group expanded) */
                        if (EXPANDED_AGRP(ac, agrp)) {
                                rearrange_animchannel_islands(&agrp->channels, rearrange_func, mode, ANIMTYPE_FCURVE);
@@ -1048,7 +1048,7 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op)
                return OPERATOR_CANCELLED;
                
        /* get mode */
-       mode= RNA_enum_get(op->ptr, "direction");
+       mode = RNA_enum_get(op->ptr, "direction");
        
        /* method to move channels depends on the editor */
        if (ac.datatype == ANIMCONT_GPENCIL) {
@@ -1065,11 +1065,11 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op)
                int filter;
                
                /* get animdata blocks */
-               filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_ANIMDATA);
+               filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_ANIMDATA);
                ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
                
                for (ale = anim_data.first; ale; ale = ale->next) {
-                       AnimData *adt= ale->data;
+                       AnimData *adt = ale->data;
                        
                        switch (ac.datatype) {
                                case ANIMCONT_NLA: /* NLA-tracks only */
@@ -1096,12 +1096,12 @@ static int animchannels_rearrange_exec(bContext *C, wmOperator *op)
        }
        
        /* send notifier that things have changed */
-       WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
+       WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
 }
 
-static void ANIM_OT_channels_move (wmOperatorType *ot)
+static void ANIM_OT_channels_move(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Move Channels";
@@ -1113,7 +1113,7 @@ static void ANIM_OT_channels_move (wmOperatorType *ot)
        ot->poll = animedit_poll_channels_nla_tweakmode_off;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* props */
        ot->prop = RNA_def_enum(ot->srna, "direction", prop_animchannel_rearrange_types, REARRANGE_ANIMCHAN_DOWN, "Direction", "");
@@ -1140,15 +1140,15 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
        /* do groups only first (unless in Drivers mode, where there are none) */
        if (ac.datatype != ANIMCONT_DRIVERS) {
                /* filter data */
-               filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
+               filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
                ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
                
                /* delete selected groups and their associated channels */
-               for (ale= anim_data.first; ale; ale= ale->next) {
+               for (ale = anim_data.first; ale; ale = ale->next) {
                        /* only groups - don't check other types yet, since they may no-longer exist */
                        if (ale->type == ANIMTYPE_GROUP) {
-                               bActionGroup *agrp= (bActionGroup *)ale->data;
-                               AnimData *adt= ale->adt;
+                               bActionGroup *agrp = (bActionGroup *)ale->data;
+                               AnimData *adt = ale->adt;
                                FCurve *fcu, *fcn;
                                
                                /* skip this group if no AnimData available, as we can't safely remove the F-Curves */
@@ -1156,8 +1156,8 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
                                        continue;
                                
                                /* delete all of the Group's F-Curves, but no others */
-                               for (fcu= agrp->channels.first; fcu && fcu->grp==agrp; fcu= fcn) {
-                                       fcn= fcu->next;
+                               for (fcu = agrp->channels.first; fcu && fcu->grp == agrp; fcu = fcn) {
+                                       fcn = fcu->next;
                                        
                                        /* remove from group and action, then free */
                                        action_groups_remove_channel(adt->action, fcu);
@@ -1177,34 +1177,34 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
        }
        
        /* filter data */
-       filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
+       filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
        ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
        
        /* delete selected data channels */
-       for (ale= anim_data.first; ale; ale= ale->next) {
+       for (ale = anim_data.first; ale; ale = ale->next) {
                switch (ale->type) {
                        case ANIMTYPE_FCURVE: 
                        {
                                /* F-Curves if we can identify its parent */
-                               AnimData *adt= ale->adt;
-                               FCurve *fcu= (FCurve *)ale->data;
+                               AnimData *adt = ale->adt;
+                               FCurve *fcu = (FCurve *)ale->data;
                                
                                /* try to free F-Curve */
                                ANIM_fcurve_delete_from_animdata(&ac, adt, fcu);
                        }
-                               break;
+                       break;
                                
                        case ANIMTYPE_GPLAYER:
                        {
                                /* Grease Pencil layer */
-                               bGPdata *gpd= (bGPdata *)ale->id;
-                               bGPDlayer *gpl= (bGPDlayer *)ale->data;
+                               bGPdata *gpd = (bGPdata *)ale->id;
+                               bGPDlayer *gpl = (bGPDlayer *)ale->data;
                                
                                /* try to delete the layer's data and the layer itself */
                                free_gpencil_frames(gpl);
                                BLI_freelinkN(&gpd->layers, gpl);
                        }
-                               break;
+                       break;
                }
        }
        
@@ -1212,12 +1212,12 @@ static int animchannels_delete_exec(bContext *C, wmOperator *UNUSED(op))
        BLI_freelistN(&anim_data);
        
        /* send notifier that things have changed */
-       WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
+       WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
 }
  
-static void ANIM_OT_channels_delete (wmOperatorType *ot)
+static void ANIM_OT_channels_delete(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Delete Channels";
@@ -1229,7 +1229,7 @@ static void ANIM_OT_channels_delete (wmOperatorType *ot)
        ot->poll = animedit_poll_channels_active;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
 /* ******************** Set Channel Visibility Operator *********************** */
@@ -1250,7 +1250,7 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *UNUSED(op))
        /* get list of all channels that selection may need to be flushed to 
         * - hierarchy mustn't affect what we have access to here...
         */
-       filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_NODUPLIS);
+       filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_NODUPLIS);
        ANIM_animdata_filter(&ac, &all_data, filter, ac.data, ac.datatype);
                
        /* hide all channels not selected
@@ -1262,15 +1262,15 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *UNUSED(op))
         */
        if ((ac.spacetype == SPACE_IPO) && (ac.regiontype != RGN_TYPE_CHANNELS)) {
                /* graph editor (case 2) */
-               filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_UNSEL | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS);
+               filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_UNSEL | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS);
        }
        else {
                /* standard case */
-               filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_UNSEL | ANIMFILTER_NODUPLIS);
+               filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_UNSEL | ANIMFILTER_NODUPLIS);
        }
        ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
        
-       for (ale= anim_data.first; ale; ale= ale->next) {
+       for (ale = anim_data.first; ale; ale = ale->next) {
                /* clear setting first */
                ANIM_channel_setting_set(&ac, ale, ACHANNEL_SETTING_VISIBLE, ACHANNEL_SETFLAG_CLEAR);
                
@@ -1283,10 +1283,10 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *UNUSED(op))
        BLI_freelistN(&anim_data);
        
        /* make all the selected channels visible */
-       filter= (ANIMFILTER_SEL | ANIMFILTER_NODUPLIS);
+       filter = (ANIMFILTER_SEL | ANIMFILTER_NODUPLIS);
        ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
        
-       for (ale= anim_data.first; ale; ale= ale->next) {
+       for (ale = anim_data.first; ale; ale = ale->next) {
                /* hack: skip object channels for now, since flushing those will always flush everything, but they are always included */
                // TODO: find out why this is the case, and fix that
                if (ale->type == ANIMTYPE_OBJECT)
@@ -1304,12 +1304,12 @@ static int animchannels_visibility_set_exec(bContext *C, wmOperator *UNUSED(op))
        
        
        /* send notifier that things have changed */
-       WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
+       WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
 }
 
-static void ANIM_OT_channels_visibility_set (wmOperatorType *ot)
+static void ANIM_OT_channels_visibility_set(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Set Visibility";
@@ -1321,7 +1321,7 @@ static void ANIM_OT_channels_visibility_set (wmOperatorType *ot)
        ot->poll = ED_operator_graphedit_active;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
 
@@ -1335,7 +1335,7 @@ static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *UNUSED(o
        ListBase all_data = {NULL, NULL};
        bAnimListElem *ale;
        int filter;
-       short vis= ACHANNEL_SETFLAG_ADD;
+       short vis = ACHANNEL_SETFLAG_ADD;
        
        /* get editor data */
        if (ANIM_animdata_get_context(C, &ac) == 0)
@@ -1344,26 +1344,26 @@ static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *UNUSED(o
        /* get list of all channels that selection may need to be flushed to 
         * - hierarchy mustn't affect what we have access to here...
         */
-       filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_NODUPLIS);
+       filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_NODUPLIS);
        ANIM_animdata_filter(&ac, &all_data, filter, ac.data, ac.datatype);
                
        /* filter data
         * - restrict this to only applying on settings we can get to in the list
         */
-       filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_NODUPLIS);
+       filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_SEL | ANIMFILTER_NODUPLIS);
        ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
        
        /* See if we should be making showing all selected or hiding */
-       for (ale= anim_data.first; ale; ale= ale->next) {
+       for (ale = anim_data.first; ale; ale = ale->next) {
                /* set the setting in the appropriate way (if available) */
                if (ANIM_channel_setting_get(&ac, ale, ACHANNEL_SETTING_VISIBLE)) {
-                       vis= ACHANNEL_SETFLAG_CLEAR;
+                       vis = ACHANNEL_SETFLAG_CLEAR;
                        break;
                }
        }
 
        /* Now set the flags */
-       for (ale= anim_data.first; ale; ale= ale->next) {
+       for (ale = anim_data.first; ale; ale = ale->next) {
                /* hack: skip object channels for now, since flushing those will always flush everything, but they are always included */
                // TODO: find out why this is the case, and fix that
                if (ale->type == ANIMTYPE_OBJECT)
@@ -1381,12 +1381,12 @@ static int animchannels_visibility_toggle_exec(bContext *C, wmOperator *UNUSED(o
        BLI_freelistN(&all_data);
        
        /* send notifier that things have changed */
-       WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
+       WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
 }
 
-static void ANIM_OT_channels_visibility_toggle (wmOperatorType *ot)
+static void ANIM_OT_channels_visibility_toggle(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Toggle Visibility";
@@ -1398,7 +1398,7 @@ static void ANIM_OT_channels_visibility_toggle (wmOperatorType *ot)
        ot->poll = ED_operator_graphedit_active;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
 /* ********************** Set Flags Operator *********************** */
@@ -1429,7 +1429,7 @@ static EnumPropertyItem prop_animchannel_settings_types[] = {
  *     onlysel: only selected channels get the flag set
  */
 // TODO: enable a setting which turns flushing on/off?
-static void setflag_anim_channels (bAnimContext *ac, short setting, short mode, short onlysel, short flush)
+static void setflag_anim_channels(bAnimContext *ac, short setting, short mode, short onlysel, short flush)
 {
        ListBase anim_data = {NULL, NULL};
        ListBase all_data = {NULL, NULL};
@@ -1442,7 +1442,7 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode,
                 * - hierarchy visibility needs to be ignored so that settings can get flushed
                 *   "down" inside closed containers
                 */
-               filter= ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_CHANNELS;
+               filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_CHANNELS;
                ANIM_animdata_filter(ac, &all_data, filter, ac->data, ac->datatype);
        }
        
@@ -1455,11 +1455,11 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode,
         */
        if ((ac->spacetype == SPACE_IPO) && (ac->regiontype != RGN_TYPE_CHANNELS)) {
                /* graph editor (case 2) */
-               filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS);
+               filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS);
        }
        else {
                /* standard case */
-               filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_NODUPLIS);
+               filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS | ANIMFILTER_NODUPLIS);
        }
        if (onlysel) filter |= ANIMFILTER_SEL;
        ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
@@ -1467,20 +1467,20 @@ static void setflag_anim_channels (bAnimContext *ac, short setting, short mode,
        /* if toggling, check if disable or enable */
        if (mode == ACHANNEL_SETFLAG_TOGGLE) {
                /* default to turn all on, unless we encounter one that's on... */
-               mode= ACHANNEL_SETFLAG_ADD;
+               mode = ACHANNEL_SETFLAG_ADD;
                
                /* see if we should turn off instead... */
-               for (ale= anim_data.first; ale; ale= ale->next) {
+               for (ale = anim_data.first; ale; ale = ale->next) {
                        /* set the setting in the appropriate way (if available) */
                        if (ANIM_channel_setting_get(ac, ale, setting) > 0) {
-                               mode= ACHANNEL_SETFLAG_CLEAR;
+                               mode = ACHANNEL_SETFLAG_CLEAR;
                                break;
                        }
                }
        }
        
        /* apply the setting */
-       for (ale= anim_data.first; ale; ale= ale->next) {
+       for (ale = anim_data.first; ale; ale = ale->next) {
                /* skip channel if setting is not available */
                if (ANIM_channel_setting_get(ac, ale, setting) == -1)
                        continue;
@@ -1503,19 +1503,19 @@ static int animchannels_setflag_exec(bContext *C, wmOperator *op)
 {
        bAnimContext ac;
        short mode, setting;
-       short flush=1;
+       short flush = 1;
        
        /* get editor data */
        if (ANIM_animdata_get_context(C, &ac) == 0)
                return OPERATOR_CANCELLED;
                
        /* mode (eAnimChannels_SetFlag), setting (eAnimChannel_Settings) */
-       mode= RNA_enum_get(op->ptr, "mode");
-       setting= RNA_enum_get(op->ptr, "type");
+       mode = RNA_enum_get(op->ptr, "mode");
+       setting = RNA_enum_get(op->ptr, "type");
        
        /* check if setting is flushable */
        if (setting == ACHANNEL_SETTING_EXPAND)
-               flush= 0;
+               flush = 0;
        
        /* modify setting 
         *      - only selected channels are affected
@@ -1523,13 +1523,13 @@ static int animchannels_setflag_exec(bContext *C, wmOperator *op)
        setflag_anim_channels(&ac, setting, mode, 1, flush);
        
        /* send notifier that things have changed */
-       WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
+       WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
 }
 
 /* duplicate of 'ANIM_OT_channels_setting_toggle' for menu title only, weak! */
-static void ANIM_OT_channels_setting_enable (wmOperatorType *ot)
+static void ANIM_OT_channels_setting_enable(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Enable Channel Setting";
@@ -1542,16 +1542,16 @@ static void ANIM_OT_channels_setting_enable (wmOperatorType *ot)
        ot->poll = animedit_poll_channels_active;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* props */
-               /* flag-setting mode */
+       /* flag-setting mode */
        RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_ADD, "Mode", "");
-               /* setting to set */
+       /* setting to set */
        ot->prop = RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
 }
 /* duplicate of 'ANIM_OT_channels_setting_toggle' for menu title only, weak! */
-static void ANIM_OT_channels_setting_disable (wmOperatorType *ot)
+static void ANIM_OT_channels_setting_disable(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Disable Channel Setting";
@@ -1564,16 +1564,16 @@ static void ANIM_OT_channels_setting_disable (wmOperatorType *ot)
        ot->poll = animedit_poll_channels_active;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* props */
-               /* flag-setting mode */
+       /* flag-setting mode */
        RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_CLEAR, "Mode", "");
-               /* setting to set */
+       /* setting to set */
        ot->prop = RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
 }
 
-static void ANIM_OT_channels_setting_toggle (wmOperatorType *ot)
+static void ANIM_OT_channels_setting_toggle(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Toggle Channel Setting";
@@ -1586,16 +1586,16 @@ static void ANIM_OT_channels_setting_toggle (wmOperatorType *ot)
        ot->poll = animedit_poll_channels_active;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* props */
-               /* flag-setting mode */
+       /* flag-setting mode */
        RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_TOGGLE, "Mode", "");
-               /* setting to set */
+       /* setting to set */
        ot->prop = RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", "");
 }
 
-static void ANIM_OT_channels_editable_toggle (wmOperatorType *ot)
+static void ANIM_OT_channels_editable_toggle(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Toggle Channel Editability";
@@ -1607,21 +1607,21 @@ static void ANIM_OT_channels_editable_toggle (wmOperatorType *ot)
        ot->poll = animedit_poll_channels_active;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* props */
-               /* flag-setting mode */
+       /* flag-setting mode */
        RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_TOGGLE, "Mode", "");
-               /* setting to set */
+       /* setting to set */
        RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, ACHANNEL_SETTING_PROTECT, "Type", "");
 }
 
 /* ********************** Expand Channels Operator *********************** */
 
-static int animchannels_expand_exec (bContext *C, wmOperator *op)
+static int animchannels_expand_exec(bContext *C, wmOperator *op)
 {
        bAnimContext ac;
-       short onlysel= 1;
+       short onlysel = 1;
        
        /* get editor data */
        if (ANIM_animdata_get_context(C, &ac) == 0)
@@ -1629,18 +1629,18 @@ static int animchannels_expand_exec (bContext *C, wmOperator *op)
                
        /* only affect selected channels? */
        if (RNA_boolean_get(op->ptr, "all"))
-               onlysel= 0;
+               onlysel = 0;
        
        /* modify setting */
        setflag_anim_channels(&ac, ACHANNEL_SETTING_EXPAND, ACHANNEL_SETFLAG_ADD, onlysel, 0);
        
        /* send notifier that things have changed */
-       WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
+       WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
 }
 
-static void ANIM_OT_channels_expand (wmOperatorType *ot)
+static void ANIM_OT_channels_expand(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Expand Channels";
@@ -1652,7 +1652,7 @@ static void ANIM_OT_channels_expand (wmOperatorType *ot)
        ot->poll = animedit_poll_channels_active;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* props */
        ot->prop = RNA_def_boolean(ot->srna, "all", 1, "All", "Expand all channels (not just selected ones)");
@@ -1660,10 +1660,10 @@ static void ANIM_OT_channels_expand (wmOperatorType *ot)
 
 /* ********************** Collapse Channels Operator *********************** */
 
-static int animchannels_collapse_exec (bContext *C, wmOperator *op)
+static int animchannels_collapse_exec(bContext *C, wmOperator *op)
 {
        bAnimContext ac;
-       short onlysel= 1;
+       short onlysel = 1;
        
        /* get editor data */
        if (ANIM_animdata_get_context(C, &ac) == 0)
@@ -1671,18 +1671,18 @@ static int animchannels_collapse_exec (bContext *C, wmOperator *op)
                
        /* only affect selected channels? */
        if (RNA_boolean_get(op->ptr, "all"))
-               onlysel= 0;
+               onlysel = 0;
        
        /* modify setting */
        setflag_anim_channels(&ac, ACHANNEL_SETTING_EXPAND, ACHANNEL_SETFLAG_CLEAR, onlysel, 0);
        
        /* send notifier that things have changed */
-       WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
+       WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
 }
 
-static void ANIM_OT_channels_collapse (wmOperatorType *ot)
+static void ANIM_OT_channels_collapse(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Collapse Channels";
@@ -1694,7 +1694,7 @@ static void ANIM_OT_channels_collapse (wmOperatorType *ot)
        ot->poll = animedit_poll_channels_active;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* props */
        ot->prop = RNA_def_boolean(ot->srna, "all", 1, "All", "Collapse all channels (not just selected ones)");
@@ -1702,9 +1702,9 @@ static void ANIM_OT_channels_collapse (wmOperatorType *ot)
 
 /* ******************* Reenable Disabled Operator ******************* */
 
-static int animchannels_enable_poll (bContext *C)
+static int animchannels_enable_poll(bContext *C)
 {
-       ScrArea *sa= CTX_wm_area(C);
+       ScrArea *sa = CTX_wm_area(C);
        
        /* channels region test */
        // TODO: could enhance with actually testing if channels region?
@@ -1718,7 +1718,7 @@ static int animchannels_enable_poll (bContext *C)
        return 1;
 }
 
-static int animchannels_enable_exec (bContext *C, wmOperator *UNUSED(op))
+static int animchannels_enable_exec(bContext *C, wmOperator *UNUSED(op))
 {
        bAnimContext ac;
        
@@ -1731,11 +1731,11 @@ static int animchannels_enable_exec (bContext *C, wmOperator *UNUSED(op))
                return OPERATOR_CANCELLED;
        
        /* filter data */
-       filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_NODUPLIS);
+       filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_NODUPLIS);
        ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
        
        /* loop through filtered data and clean curves */
-       for (ale= anim_data.first; ale; ale= ale->next) {
+       for (ale = anim_data.first; ale; ale = ale->next) {
                FCurve *fcu = (FCurve *)ale->data;
                
                /* remove disabled flags from F-Curves */
@@ -1753,12 +1753,12 @@ static int animchannels_enable_exec (bContext *C, wmOperator *UNUSED(op))
        BLI_freelistN(&anim_data);
                
        /* send notifier that things have changed */
-       WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
+       WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
 }
 
-static void ANIM_OT_channels_fcurves_enable (wmOperatorType *ot)
+static void ANIM_OT_channels_fcurves_enable(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Revive Disabled F-Curves";
@@ -1770,12 +1770,12 @@ static void ANIM_OT_channels_fcurves_enable (wmOperatorType *ot)
        ot->poll = animchannels_enable_poll;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
 /* ********************** Select All Operator *********************** */
 
-static int animchannels_deselectall_exec (bContext *C, wmOperator *op)
+static int animchannels_deselectall_exec(bContext *C, wmOperator *op)
 {
        bAnimContext ac;
        
@@ -1790,12 +1790,12 @@ static int animchannels_deselectall_exec (bContext *C, wmOperator *op)
                ANIM_deselect_anim_channels(&ac, ac.data, ac.datatype, 1, ACHANNEL_SETFLAG_ADD);
        
        /* send notifier that things have changed */
-       WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_SELECTED, NULL);
+       WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
        
        return OPERATOR_FINISHED;
 }
  
-static void ANIM_OT_channels_select_all_toggle (wmOperatorType *ot)
+static void ANIM_OT_channels_select_all_toggle(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Select All";
@@ -1807,7 +1807,7 @@ static void ANIM_OT_channels_select_all_toggle (wmOperatorType *ot)
        ot->poll = animedit_poll_channels_nla_tweakmode_off;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* props */
        ot->prop = RNA_def_boolean(ot->srna, "invert", 0, "Invert", "");
@@ -1815,14 +1815,14 @@ static void ANIM_OT_channels_select_all_toggle (wmOperatorType *ot)
 
 /* ******************** Borderselect Operator *********************** */
 
-static void borderselect_anim_channels (bAnimContext *ac, rcti *rect, short selectmode)
+static void borderselect_anim_channels(bAnimContext *ac, rcti *rect, short selectmode)
 {
        ListBase anim_data = {NULL, NULL};
        bAnimListElem *ale;
        int filter;
        
        SpaceNla *snla = (SpaceNla *)ac->sl;
-       View2D *v2d= &ac->ar->v2d;
+       View2D *v2d = &ac->ar->v2d;
        rctf rectf;
        float ymin, ymax;
        
@@ -1837,19 +1837,19 @@ static void borderselect_anim_channels (bAnimContext *ac, rcti *rect, short sele
        }
        
        /* convert border-region to view coordinates */
-       UI_view2d_region_to_view(v2d, rect->xmin, rect->ymin+2, &rectf.xmin, &rectf.ymin);
-       UI_view2d_region_to_view(v2d, rect->xmax, rect->ymax-2, &rectf.xmax, &rectf.ymax);
+       UI_view2d_region_to_view(v2d, rect->xmin, rect->ymin + 2, &rectf.xmin, &rectf.ymin);
+       UI_view2d_region_to_view(v2d, rect->xmax, rect->ymax - 2, &rectf.xmax, &rectf.ymax);
        
        /* filter data */
-       filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
+       filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
        ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
        
        /* loop over data, doing border select */
-       for (ale= anim_data.first; ale; ale= ale->next) {
+       for (ale = anim_data.first; ale; ale = ale->next) {
                if (ac->datatype == ANIMCONT_NLA)
-                       ymin= ymax - NLACHANNEL_STEP(snla);
+                       ymin = ymax - NLACHANNEL_STEP(snla);
                else
-                       ymin= ymax - ACHANNEL_STEP;
+                       ymin = ymax - ACHANNEL_STEP;
                
                /* if channel is within border-select region, alter it */
                if (!((ymax < rectf.ymin) || (ymin > rectf.ymax))) {
@@ -1860,27 +1860,27 @@ static void borderselect_anim_channels (bAnimContext *ac, rcti *rect, short sele
                        switch (ale->type) {
                                case ANIMTYPE_GROUP:
                                {
-                                       bActionGroup *agrp= (bActionGroup *)ale->data;
+                                       bActionGroup *agrp = (bActionGroup *)ale->data;
                                        
                                        /* always clear active flag after doing this */
                                        agrp->flag &= ~AGRP_ACTIVE;
                                }
-                                       break;
+                               break;
                                case ANIMTYPE_NLATRACK:
                                {
-                                       NlaTrack *nlt= (NlaTrack *)ale->data;
+                                       NlaTrack *nlt = (NlaTrack *)ale->data;
                                        
                                        /* for now, it's easier just to do this here manually, as defining a new type 
                                         * currently adds complications when doing other stuff 
                                         */
                                        ACHANNEL_SET_FLAG(nlt, selectmode, NLATRACK_SELECTED);
                                }
-                                       break;
+                               break;
                        }
                }
                
                /* set minimum extent to be the maximum of the next channel */
-               ymax= ymin;
+               ymax = ymin;
        }
        
        /* cleanup */
@@ -1893,7 +1893,7 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
 {
        bAnimContext ac;
        rcti rect;
-       short selectmode=0;
+       short selectmode = 0;
        int gesture_mode, extend;
        
        /* get editor data */
@@ -1906,8 +1906,8 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
        rect.xmax = RNA_int_get(op->ptr, "xmax");
        rect.ymax = RNA_int_get(op->ptr, "ymax");
        
-       gesture_mode= RNA_int_get(op->ptr, "gesture_mode");
-       extend= RNA_boolean_get(op->ptr, "extend");
+       gesture_mode = RNA_int_get(op->ptr, "gesture_mode");
+       extend = RNA_boolean_get(op->ptr, "extend");
 
        if (!extend)
                ANIM_deselect_anim_channels(&ac, ac.data, ac.datatype, 1, ACHANNEL_SETFLAG_CLEAR);
@@ -1921,7 +1921,7 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op)
        borderselect_anim_channels(&ac, &rect, selectmode);
        
        /* send notifier that things have changed */
-       WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN|NA_SELECTED, NULL);
+       WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_SELECTED, NULL);
        
        return OPERATOR_FINISHED;
 } 
@@ -1942,7 +1942,7 @@ static void ANIM_OT_channels_select_border(wmOperatorType *ot)
        ot->poll = animedit_poll_channels_nla_tweakmode_off;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* rna */
        WM_operator_properties_gesture_border(ot, TRUE);
@@ -1951,7 +1951,7 @@ static void ANIM_OT_channels_select_border(wmOperatorType *ot)
 /* ******************* Rename Operator ***************************** */
 /* Allow renaming some channels by clicking on them */
 
-static void rename_anim_channels (bAnimContext *ac, int channel_index)
+static void rename_anim_channels(bAnimContext *ac, int channel_index)
 {
        ListBase anim_data = {NULL, NULL};
        bAnimChannelType *acf;
@@ -1959,12 +1959,12 @@ static void rename_anim_channels (bAnimContext *ac, int channel_index)
        int filter;
        
        /* get the channel that was clicked on */
-               /* filter channels */
-       filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
+       /* filter channels */
+       filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
        ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
        
-               /* get channel from index */
-       ale= BLI_findlink(&anim_data, channel_index);
+       /* get channel from index */
+       ale = BLI_findlink(&anim_data, channel_index);
        if (ale == NULL) {
                /* channel not found */
                if (G.debug & G_DEBUG)
@@ -2000,7 +2000,7 @@ static void rename_anim_channels (bAnimContext *ac, int channel_index)
        ED_region_tag_redraw(ac->ar);
 }
 
-static int animchannels_rename_invoke (bContext *C, wmOperator *UNUSED(op), wmEvent *evt)
+static int animchannels_rename_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *evt)
 {
        bAnimContext ac;
        ARegion *ar;
@@ -2013,8 +2013,8 @@ static int animchannels_rename_invoke (bContext *C, wmOperator *UNUSED(op), wmEv
                return OPERATOR_CANCELLED;
                
        /* get useful pointers from animation context data */
-       ar= ac.ar;
-       v2d= &ar->v2d;
+       ar = ac.ar;
+       v2d = &ar->v2d;
        
        /* figure out which channel user clicked in 
         * Note: although channels technically start at y= ACHANNEL_FIRST, we need to adjust by half a channel's height
@@ -2037,7 +2037,7 @@ static int animchannels_rename_invoke (bContext *C, wmOperator *UNUSED(op), wmEv
        return OPERATOR_FINISHED;
 }
 
-static void ANIM_OT_channels_rename (wmOperatorType *ot)
+static void ANIM_OT_channels_rename(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Rename Channels";
@@ -2052,7 +2052,7 @@ static void ANIM_OT_channels_rename (wmOperatorType *ot)
 /* ******************** Mouse-Click Operator *********************** */
 /* Handle selection changes due to clicking on channels. Settings will get caught by UI code... */
 
-static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_index, short selectmode)
+static int mouse_anim_channels(bAnimContext *ac, float UNUSED(x), int channel_index, short selectmode)
 {
        ListBase anim_data = {NULL, NULL};
        bAnimListElem *ale;
@@ -2060,12 +2060,12 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
        int notifierFlags = 0;
        
        /* get the channel that was clicked on */
-               /* filter channels */
-       filter= (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
+       /* filter channels */
+       filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_LIST_CHANNELS);
        ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
        
-               /* get channel from index */
-       ale= BLI_findlink(&anim_data, channel_index);
+       /* get channel from index */
+       ale = BLI_findlink(&anim_data, channel_index);
        if (ale == NULL) {
                /* channel not found */
                if (G.debug & G_DEBUG)
@@ -2088,8 +2088,8 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
        switch (ale->type) {
                case ANIMTYPE_SCENE:
                {
-                       Scene *sce= (Scene *)ale->data;
-                       AnimData *adt= sce->adt;
+                       Scene *sce = (Scene *)ale->data;
+                       AnimData *adt = sce->adt;
                        
                        /* set selection status */
                        if (selectmode == SELECT_INVERT) {
@@ -2102,22 +2102,22 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
                                if (adt) adt->flag |= ADT_UI_SELECTED;
                        }
                        
-                       notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
+                       notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
                }
-                       break;
+               break;
                case ANIMTYPE_OBJECT:
                {
-                       bDopeSheet *ads= (bDopeSheet *)ac->data;
-                       Scene *sce= (Scene *)ads->source;
-                       Base *base= (Base *)ale->data;
-                       Object *ob= base->object;
-                       AnimData *adt= ob->adt;
+                       bDopeSheet *ads = (bDopeSheet *)ac->data;
+                       Scene *sce = (Scene *)ads->source;
+                       Base *base = (Base *)ale->data;
+                       Object *ob = base->object;
+                       AnimData *adt = ob->adt;
                        
                        /* set selection status */
                        if (selectmode == SELECT_INVERT) {
                                /* swap select */
                                base->flag ^= SELECT;
-                               ob->flag= base->flag;
+                               ob->flag = base->flag;
                                
                                if (adt) adt->flag ^= ADT_UI_SELECTED;
                        }
@@ -2126,10 +2126,10 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
                                
                                /* deselect all */
                                // TODO: should this deselect all other types of channels too?
-                               for (b= sce->base.first; b; b= b->next) {
+                               for (b = sce->base.first; b; b = b->next) {
                                        b->flag &= ~SELECT;
-                                       b->object->flag= b->flag;
-                                       if (b->object->adt) b->object->adt->flag &= ~(ADT_UI_SELECTED|ADT_UI_ACTIVE);
+                                       b->object->flag = b->flag;
+                                       if (b->object->adt) b->object->adt->flag &= ~(ADT_UI_SELECTED | ADT_UI_ACTIVE);
                                }
                                
                                /* select object now */
@@ -2141,12 +2141,12 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
                        if ((adt) && (adt->flag & ADT_UI_SELECTED))
                                adt->flag |= ADT_UI_ACTIVE;
                        
-                       notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
+                       notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
                }
-                       break;
+               break;
                
                case ANIMTYPE_FILLACTD: /* Action Expander */
-               case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
+               case ANIMTYPE_DSMAT:    /* Datablock AnimData Expanders */
                case ANIMTYPE_DSLAM:
                case ANIMTYPE_DSCAM:
                case ANIMTYPE_DSCUR:
@@ -2179,13 +2179,13 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
                                        ale->adt->flag |= ADT_UI_ACTIVE;
                        }
                        
-                       notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
+                       notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
                }       
-                       break;
+               break;
                
                case ANIMTYPE_GROUP: 
                {
-                       bActionGroup *agrp= (bActionGroup *)ale->data;
+                       bActionGroup *agrp = (bActionGroup *)ale->data;
                        
                        /* select/deselect group */
                        if (selectmode == SELECT_INVERT) {
@@ -2200,7 +2200,7 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
                                ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
                                
                                /* only select channels in group and group itself */
-                               for (fcu= agrp->channels.first; fcu && fcu->grp==agrp; fcu= fcu->next)
+                               for (fcu = agrp->channels.first; fcu && fcu->grp == agrp; fcu = fcu->next)
                                        fcu->flag |= FCURVE_SELECTED;
                                agrp->flag |= AGRP_SELECTED;                                    
                        }
@@ -2214,12 +2214,12 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
                        if (agrp->flag & AGRP_SELECTED)
                                ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP);
                                
-                       notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
+                       notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
                }
-                       break;
+               break;
                case ANIMTYPE_FCURVE: 
                {
-                       FCurve *fcu= (FCurve *)ale->data;
+                       FCurve *fcu = (FCurve *)ale->data;
                        
                        /* select/deselect */
                        if (selectmode == SELECT_INVERT) {
@@ -2236,12 +2236,12 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
                        if (fcu->flag & FCURVE_SELECTED)
                                ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE);
                                
-                       notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
+                       notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
                }
-                       break;
+               break;
                case ANIMTYPE_SHAPEKEY: 
                {
-                       KeyBlock *kb= (KeyBlock *)ale->data;
+                       KeyBlock *kb = (KeyBlock *)ale->data;
                        
                        /* select/deselect */
                        if (selectmode == SELECT_INVERT) {
@@ -2254,24 +2254,24 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
                                kb->flag |= KEYBLOCK_SEL;
                        }
                                
-                       notifierFlags |= (ND_ANIMCHAN|NA_SELECTED);
+                       notifierFlags |= (ND_ANIMCHAN | NA_SELECTED);
                }
-                       break;
+               break;
                case ANIMTYPE_GPDATABLOCK:
                {
-                       bGPdata *gpd= (bGPdata *)ale->data;
+                       bGPdata *gpd = (bGPdata *)ale->data;
                        
                        /* toggle expand 
                         *      - although the triangle widget already allows this, the whole channel can also be used for this purpose
                         */
                        gpd->flag ^= GP_DATA_EXPAND;
                        
-                       notifierFlags |= (ND_ANIMCHAN|NA_EDITED);
+                       notifierFlags |= (ND_ANIMCHAN | NA_EDITED);
                }
-                       break;
+               break;
                case ANIMTYPE_GPLAYER:
                {
-                       bGPDlayer *gpl= (bGPDlayer *)ale->data;
+                       bGPDlayer *gpl = (bGPDlayer *)ale->data;
                        
                        /* select/deselect */
                        if (selectmode == SELECT_INVERT) {
@@ -2284,9 +2284,9 @@ static int mouse_anim_channels (bAnimContext *ac, float UNUSED(x), int channel_i
                                gpl->flag |= GP_LAYER_SELECT;
                        }
                        
-                       notifierFlags |= (ND_ANIMCHAN|NA_EDITED);
+                       notifierFlags |= (ND_ANIMCHAN | NA_EDITED);
                }
-                       break;
+               break;
                default:
                        if (G.debug & G_DEBUG)
                                printf("Error: Invalid channel type in mouse_anim_channels()\n");
@@ -2318,16 +2318,16 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *
                return OPERATOR_CANCELLED;
                
        /* get useful pointers from animation context data */
-       ar= ac.ar;
-       v2d= &ar->v2d;
+       ar = ac.ar;
+       v2d = &ar->v2d;
        
        /* select mode is either replace (deselect all, then add) or add/extend */
        if (RNA_boolean_get(op->ptr, "extend"))
-               selectmode= SELECT_INVERT;
+               selectmode = SELECT_INVERT;
        else if (RNA_boolean_get(op->ptr, "children_only"))
-               selectmode= -1; /* this is a bit of a special case for ActionGroups only... should it be removed or extended to all instead? */
+               selectmode = -1;  /* this is a bit of a special case for ActionGroups only... should it be removed or extended to all instead? */
        else
-               selectmode= SELECT_REPLACE;
+               selectmode = SELECT_REPLACE;
        
        /* figure out which channel user clicked in 
         * Note: although channels technically start at y= ACHANNEL_FIRST, we need to adjust by half a channel's height
@@ -2338,15 +2338,15 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *
        UI_view2d_listview_view_to_cell(v2d, ACHANNEL_NAMEWIDTH, ACHANNEL_STEP, 0, (float)ACHANNEL_HEIGHT_HALF, x, y, NULL, &channel_index);
        
        /* handle mouse-click in the relevant channel then */
-       notifierFlags= mouse_anim_channels(&ac, x, channel_index, selectmode);
+       notifierFlags = mouse_anim_channels(&ac, x, channel_index, selectmode);
        
        /* set notifier that things have changed */
-       WM_event_add_notifier(C, NC_ANIMATION|notifierFlags, NULL);
+       WM_event_add_notifier(C, NC_ANIMATION | notifierFlags, NULL);
        
        return OPERATOR_FINISHED;
 }
  
-static void ANIM_OT_channels_click (wmOperatorType *ot)
+static void ANIM_OT_channels_click(wmOperatorType *ot)
 {
        /* identifiers */
        ot->name = "Mouse Click on Channels";
@@ -2358,7 +2358,7 @@ static void ANIM_OT_channels_click (wmOperatorType *ot)
        ot->poll = animedit_poll_channels_active;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* id-props */
        RNA_def_boolean(ot->srna, "extend", 0, "Extend Select", ""); // SHIFTKEY
@@ -2382,7 +2382,7 @@ void ED_operatortypes_animchannels(void)
        
        WM_operatortype_append(ANIM_OT_channels_delete);
        
-               // XXX does this need to be a separate operator?
+       // XXX does this need to be a separate operator?
        WM_operatortype_append(ANIM_OT_channels_editable_toggle);
        
        WM_operatortype_append(ANIM_OT_channels_move);
@@ -2403,20 +2403,20 @@ void ED_keymap_animchannels(wmKeyConfig *keyconf)
        wmKeyMapItem *kmi;
 
        /* selection */
-               /* click-select */
-               // XXX for now, only leftmouse.... 
+       /* click-select */
+       // XXX for now, only leftmouse....
        WM_keymap_add_item(keymap, "ANIM_OT_channels_click", LEFTMOUSE, KM_PRESS, 0, 0);
        RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_click", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", TRUE);
-       RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_click", LEFTMOUSE, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "children_only", TRUE);
+       RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_click", LEFTMOUSE, KM_PRESS, KM_CTRL | KM_SHIFT, 0)->ptr, "children_only", TRUE);
        
-               /* rename */
+       /* rename */
        WM_keymap_add_item(keymap, "ANIM_OT_channels_rename", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
        
-               /* deselect all */
+       /* deselect all */
        WM_keymap_add_item(keymap, "ANIM_OT_channels_select_all_toggle", AKEY, KM_PRESS, 0, 0);
        RNA_boolean_set(WM_keymap_add_item(keymap, "ANIM_OT_channels_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", TRUE);
        
-               /* borderselect */
+       /* borderselect */
        WM_keymap_add_item(keymap, "ANIM_OT_channels_select_border", BKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "ANIM_OT_channels_select_border", EVT_TWEAK_L, KM_ANY, 0, 0);
        
@@ -2426,7 +2426,7 @@ void ED_keymap_animchannels(wmKeyConfig *keyconf)
        
        /* settings */
        WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_toggle", WKEY, KM_PRESS, KM_SHIFT, 0);
-       WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_enable", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
+       WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_enable", WKEY, KM_PRESS, KM_CTRL | KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "ANIM_OT_channels_setting_disable", WKEY, KM_PRESS, KM_ALT, 0);
        
        /* settings - specialized hotkeys */
index 5b8e696f05a1c0b327997609ae285c4a013e6e24..1db4e7016ebfc745ffe142bdb32615127b72320e 100644 (file)
@@ -67,17 +67,17 @@ void ANIM_list_elem_update(Scene *scene, bAnimListElem *ale)
        FCurve *fcu;
        AnimData *adt;
 
-       id= ale->id;
+       id = ale->id;
        if (!id)
                return;
        
        /* tag AnimData for refresh so that other views will update in realtime with these changes */
-       adt= BKE_animdata_from_id(id);
+       adt = BKE_animdata_from_id(id);
        if (adt)
                adt->recalc |= ADT_RECALC_ANIM;
 
        /* update data */
-       fcu= (ale->datatype == ALE_FCURVE)? ale->key_data: NULL;
+       fcu = (ale->datatype == ALE_FCURVE) ? ale->key_data : NULL;
                
        if (fcu && fcu->rna_path) {
                /* if we have an fcurve, call the update for the property we
@@ -94,7 +94,7 @@ void ANIM_list_elem_update(Scene *scene, bAnimListElem *ale)
        else {
                /* in other case we do standard depsgaph update, ideally
                 * we'd be calling property update functions here too ... */
-               DAG_id_tag_update(id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME); // XXX or do we want something more restrictive?
+               DAG_id_tag_update(id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); // XXX or do we want something more restrictive?
        }
 }
 
@@ -103,14 +103,14 @@ void ANIM_list_elem_update(Scene *scene, bAnimListElem *ale)
 void ANIM_id_update(Scene *UNUSED(scene), ID *id)
 {
        if (id) {
-               AnimData *adt= BKE_animdata_from_id(id);
+               AnimData *adt = BKE_animdata_from_id(id);
                
                /* tag AnimData for refresh so that other views will update in realtime with these changes */
                if (adt)
                        adt->recalc |= ADT_RECALC_ANIM;
                        
                /* set recalc flags */
-               DAG_id_tag_update(id, OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME); // XXX or do we want something more restrictive?
+               DAG_id_tag_update(id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME); // XXX or do we want something more restrictive?
        }
 }
 
@@ -125,10 +125,10 @@ void ANIM_id_update(Scene *UNUSED(scene), ID *id)
  */
 
 /* perform syncing updates for Action Groups */
-static void animchan_sync_group (bAnimContext *UNUSED(ac), bAnimListElem *ale)
+static void animchan_sync_group(bAnimContext *UNUSED(ac), bAnimListElem *ale)
 {
-       bActionGroup *agrp= (bActionGroup *)ale->data;
-       ID *owner_id= ale->id;
+       bActionGroup *agrp = (bActionGroup *)ale->data;
+       ID *owner_id = ale->id;
        
        /* major priority is selection status
         * so we need both a group and an owner
@@ -138,13 +138,13 @@ static void animchan_sync_group (bAnimContext *UNUSED(ac), bAnimListElem *ale)
                
        /* for standard Objects, check if group is the name of some bone */
        if (GS(owner_id->name) == ID_OB) {
-               Object *ob= (Object *)owner_id;
+               Object *ob = (Object *)owner_id;
                
                /* check if there are bones, and whether the name matches any 
                 * NOTE: this feature will only really work if groups by default contain the F-Curves for a single bone
                 */
                if (ob->pose) {
-                       bPoseChannel *pchan= BKE_pose_channel_find_name(ob->pose, agrp->name);
+                       bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, agrp->name);
                        
                        /* if one matches, sync the selection status */
                        if (pchan) {
@@ -158,10 +158,10 @@ static void animchan_sync_group (bAnimContext *UNUSED(ac), bAnimListElem *ale)
 }
  
 /* perform syncing updates for F-Curves */
-static void animchan_sync_fcurve (bAnimContext *UNUSED(ac), bAnimListElem *ale)
+static void animchan_sync_fcurve(bAnimContext *UNUSED(ac), bAnimListElem *ale)
 {
-       FCurve *fcu= (FCurve *)ale->data;
-       ID *owner_id= ale->id;
+       FCurve *fcu = (FCurve *)ale->data;
+       ID *owner_id = ale->id;
        
        /* major priority is selection status, so refer to the checks done in anim_filter.c 
         * skip_fcurve_selected_data() for reference about what's going on here...
@@ -170,7 +170,7 @@ static void animchan_sync_fcurve (bAnimContext *UNUSED(ac), bAnimListElem *ale)
                return;
                
        if (GS(owner_id->name) == ID_OB) {
-               Object *ob= (Object *)owner_id;
+               Object *ob = (Object *)owner_id;
                
                /* only affect if F-Curve involves pose.bones */
                if ((fcu->rna_path) && strstr(fcu->rna_path, "pose.bones")) {
@@ -178,8 +178,8 @@ static void animchan_sync_fcurve (bAnimContext *UNUSED(ac), bAnimListElem *ale)
                        char *bone_name;
                        
                        /* get bone-name, and check if this bone is selected */
-                       bone_name= BLI_getQuotedStr(fcu->rna_path, "pose.bones[");
-                       pchan= BKE_pose_channel_find_name(ob->pose, bone_name);
+                       bone_name = BLI_getQuotedStr(fcu->rna_path, "pose.bones[");
+                       pchan = BKE_pose_channel_find_name(ob->pose, bone_name);
                        if (bone_name) MEM_freeN(bone_name);
                        
                        /* F-Curve selection depends on whether the bone is selected */
@@ -196,12 +196,12 @@ static void animchan_sync_fcurve (bAnimContext *UNUSED(ac), bAnimListElem *ale)
                
                /* only affect if F-Curve involves sequence_editor.sequences */
                if ((fcu->rna_path) && strstr(fcu->rna_path, "sequences_all")) {
-                       Editing *ed= seq_give_editing(scene, FALSE);
+                       Editing *ed = seq_give_editing(scene, FALSE);
                        Sequence *seq;
                        char *seq_name;
                        
                        /* get strip name, and check if this strip is selected */
-                       seq_name= BLI_getQuotedStr(fcu->rna_path, "sequences_all[");
+                       seq_name = BLI_getQuotedStr(fcu->rna_path, "sequences_all[");
                        seq = get_seq_by_name(ed->seqbasep, seq_name, FALSE);
                        if (seq_name) MEM_freeN(seq_name);
                        
@@ -223,7 +223,7 @@ static void animchan_sync_fcurve (bAnimContext *UNUSED(ac), bAnimListElem *ale)
                        char *node_name;
                        
                        /* get strip name, and check if this strip is selected */
-                       node_name= BLI_getQuotedStr(fcu->rna_path, "nodes[");
+                       node_name = BLI_getQuotedStr(fcu->rna_path, "nodes[");
                        node = nodeFindNodebyName(ntree, node_name);
                        if (node_name) MEM_freeN(node_name);
                        
@@ -254,12 +254,12 @@ void ANIM_sync_animchannels_to_data(const bContext *C)
                return;
        
        /* filter data */
-               /* NOTE: we want all channels, since we want to be able to set selection status on some of them even when collapsed */
-       filter= ANIMFILTER_DATA_VISIBLE|ANIMFILTER_LIST_CHANNELS;
+       /* NOTE: we want all channels, since we want to be able to set selection status on some of them even when collapsed */
+       filter = ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_CHANNELS;
        ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
        
        /* flush settings as appropriate depending on the types of the channels */
-       for (ale= anim_data.first; ale; ale= ale->next) {
+       for (ale = anim_data.first; ale; ale = ale->next) {
                switch (ale->type) {
                        case ANIMTYPE_GROUP:
                                animchan_sync_group(&ac, ale);
index 236b8d18b783682b8a3073983a9eeb3756dd5068..0514700e120380bb0397a1a3e501af10ea41dfd0 100644 (file)
@@ -55,7 +55,7 @@
 /* TIME CODE FORMATTING */
 
 /* Generate timecode/frame number string and store in the supplied string 
- *     - buffer: must be at least 13 chars long 
+ *  - buffer: must be at least 13 chars long
  *     - power: special setting for View2D grid drawing, 
  *       used to specify how detailed we need to be
  *     - timecodes: boolean specifying whether timecodes or
 void ANIM_timecode_string_from_frame(char *str, Scene *scene, int power, short timecodes, float cfra)
 {
        if (timecodes) {
-               int hours=0, minutes=0, seconds=0, frames=0;
-               float raw_seconds= cfra;
-               char neg[2]= {'\0'};
+               int hours = 0, minutes = 0, seconds = 0, frames = 0;
+               float raw_seconds = cfra;
+               char neg[2] = {'\0'};
                
                /* get cframes */
                if (cfra < 0) {
                        /* correction for negative cfraues */
-                       neg[0]= '-';
+                       neg[0] = '-';
                        cfra = -cfra;
                }
                if (cfra >= 3600) {
                        /* hours */
                        /* XXX should we only display a single digit for hours since clips are 
-                        *         VERY UNLIKELY to be more than 1-2 hours max? However, that would 
+                        *     VERY UNLIKELY to be more than 1-2 hours max? However, that would
                         *         go against conventions...
                         */
-                       hours= (int)cfra / 3600;
-                       cfra= (float)fmod(cfra, 3600);
+                       hours = (int)cfra / 3600;
+                       cfra = (float)fmod(cfra, 3600);
                }
                if (cfra >= 60) {
                        /* minutes */
-                       minutes= (int)cfra / 60;
-                       cfra= (float)fmod(cfra, 60);
+                       minutes = (int)cfra / 60;
+                       cfra = (float)fmod(cfra, 60);
                }
                if (power <= 0) {
                        /* seconds + frames
                         *      Frames are derived from 'fraction' of second. We need to perform some additional rounding
                         *      to cope with 'half' frames, etc., which should be fine in most cases
                         */
-                       seconds= (int)cfra;
-                       frames= (int)floor( (((double)cfra - (double)seconds) * FPS) + 0.5 );
+                       seconds = (int)cfra;
+                       frames = (int)floor( (((double)cfra - (double)seconds) * FPS) + 0.5);
                }
                else {
                        /* seconds (with pixel offset rounding) */
-                       seconds= (int)floor(cfra + 0.375f);
+                       seconds = (int)floor(cfra + 0.375f);
                }
                
                switch (U.timecode_style) {
@@ -124,7 +124,7 @@ void ANIM_timecode_string_from_frame(char *str, Scene *scene, int power, short t
                                        else sprintf(str, "%s%02d:%02d", neg, minutes, seconds);
                                }
                        }
-                               break;
+                       break;
                                
                        case USER_TIMECODE_SMPTE_MSF:
                        {
@@ -132,27 +132,27 @@ void ANIM_timecode_string_from_frame(char *str, Scene *scene, int power, short t
                                if (hours) sprintf(str, "%s%02d:%02d:%02d:%02d", neg, hours, minutes, seconds, frames);
                                else sprintf(str, "%s%02d:%02d:%02d", neg, minutes, seconds, frames);
                        }
-                               break;
+                       break;
                        
                        case USER_TIMECODE_MILLISECONDS:
                        {
                                /* reduced SMPTE. Instead of frames, milliseconds are shown */
-                               int ms_dp= (power <= 0) ? (1 - power) : 1; /* precision of decimal part */
-                               int s_pad= ms_dp+3;     /* to get 2 digit whole-number part for seconds display (i.e. 3 is for 2 digits + radix, on top of full length) */
+                               int ms_dp = (power <= 0) ? (1 - power) : 1; /* precision of decimal part */
+                               int s_pad = ms_dp + 3; /* to get 2 digit whole-number part for seconds display (i.e. 3 is for 2 digits + radix, on top of full length) */
                                
                                if (hours) sprintf(str, "%s%02d:%02d:%0*.*f", neg, hours, minutes, s_pad, ms_dp, cfra);
                                else sprintf(str, "%s%02d:%0*.*f", neg, minutes, s_pad,  ms_dp, cfra);
                        }
-                               break;
+                       break;
                                
                        case USER_TIMECODE_SECONDS_ONLY:
                        {
                                /* only show the original seconds display */
                                /* round to whole numbers if power is >= 1 (i.e. scale is coarse) */
-                               if (power <= 0) sprintf(str, "%.*f", 1-power, raw_seconds);
+                               if (power <= 0) sprintf(str, "%.*f", 1 - power, raw_seconds);
                                else sprintf(str, "%d", (int)floor(raw_seconds + 0.375f));
                        }
-                               break;
+                       break;
                        
                        case USER_TIMECODE_SMPTE_FULL:
                        default:
@@ -160,12 +160,12 @@ void ANIM_timecode_string_from_frame(char *str, Scene *scene, int power, short t
                                /* full SMPTE format */
                                sprintf(str, "%s%02d:%02d:%02d:%02d", neg, hours, minutes, seconds, frames);
                        }
-                               break;
+                       break;
                }
        }
        else {
                /* round to whole numbers if power is >= 1 (i.e. scale is coarse) */
-               if (power <= 0) sprintf(str, "%.*f", 1-power, cfra);
+               if (power <= 0) sprintf(str, "%.*f", 1 - power, cfra);
                else sprintf(str, "%d", (int)floor(cfra + 0.375f));
        }
 } 
@@ -174,15 +174,15 @@ void ANIM_timecode_string_from_frame(char *str, Scene *scene, int power, short t
 /* CURRENT FRAME DRAWING */
 
 /* Draw current frame number in a little green box beside the current frame indicator */
-static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time)
+static void draw_cfra_number(Scene *scene, View2D *v2d, float cfra, short time)
 {
        float xscale, yscale, x, y;
-       char numstr[32] = "    t";      /* t is the character to start replacing from */
+       char numstr[32] = "    t";  /* t is the character to start replacing from */
        short slen;
        
        /* because the frame number text is subject to the same scaling as the contents of the view */
        UI_view2d_getscale(v2d, &xscale, &yscale);
-       glScalef(1.0f/xscale, 1.0f, 1.0f);
+       glScalef(1.0f / xscale, 1.0f, 1.0f);
        
        /* get timecode string 
         *      - padding on str-buf passed so that it doesn't sit on the frame indicator
@@ -193,19 +193,19 @@ static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time)
                ANIM_timecode_string_from_frame(&numstr[4], scene, 0, time, FRA2TIME(cfra));
        else    
                ANIM_timecode_string_from_frame(&numstr[4], scene, 1, time, cfra);
-       slen= (short)UI_GetStringWidth(numstr) - 1;
+       slen = (short)UI_GetStringWidth(numstr) - 1;
        
        /* get starting coordinates for drawing */
-       x= cfra * xscale;
-       y= 18;
+       x = cfra * xscale;
+       y = 18;
        
        /* draw green box around/behind text */
        UI_ThemeColorShade(TH_CFRAME, 0);
-       glRectf(x, y,  x+slen,  y+15);
+       glRectf(x, y,  x + slen,  y + 15);
        
        /* draw current frame number - black text */
        UI_ThemeColor(TH_TEXT);
-       UI_DrawString(x-5, y+3, numstr);
+       UI_DrawString(x - 5, y + 3, numstr);
        
        /* restore view transform */
        glScalef(xscale, 1.0, 1.0);
@@ -214,11 +214,11 @@ static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time)
 /* General call for drawing current frame indicator in animation editor */
 void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag)
 {
-       Scene *scene= CTX_data_scene(C);
+       Scene *scene = CTX_data_scene(C);
        float vec[2];
        
        /* Draw a light green line to indicate current frame */
-       vec[0]= (float)(scene->r.cfra * scene->r.framelen);
+       vec[0] = (float)(scene->r.cfra * scene->r.framelen);
        
        UI_ThemeColor(TH_CFRAME);
        if (flag & DRAWCFRA_WIDE)
@@ -227,11 +227,11 @@ void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag)
                glLineWidth(2.0);
        
        glBegin(GL_LINE_STRIP);
-               vec[1]= v2d->cur.ymin-500.0f;   /* XXX arbitrary... want it go to bottom */
-               glVertex2fv(vec);
+       vec[1] = v2d->cur.ymin - 500.0f;    /* XXX arbitrary... want it go to bottom */
+       glVertex2fv(vec);
                
-               vec[1]= v2d->cur.ymax;
-               glVertex2fv(vec);
+       vec[1] = v2d->cur.ymax;
+       glVertex2fv(vec);
        glEnd();
        
        glLineWidth(1.0);
@@ -250,7 +250,7 @@ void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag)
 /* Draw preview range 'curtains' for highlighting where the animation data is */
 void ANIM_draw_previewrange(const bContext *C, View2D *v2d)
 {
-       Scene *scene= CTX_data_scene(C);
+       Scene *scene = CTX_data_scene(C);
        
        /* only draw this if preview range is set */
        if (PRVRANGEON) {
@@ -298,16 +298,16 @@ AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale)
 static short bezt_nlamapping_restore(KeyframeEditData *ked, BezTriple *bezt)
 {
        /* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */
-       AnimData *adt= (AnimData *)ked->data;
-       short only_keys= (short)ked->i1;
+       AnimData *adt = (AnimData *)ked->data;
+       short only_keys = (short)ked->i1;
        
        /* adjust BezTriple handles only if allowed to */
        if (only_keys == 0) {
-               bezt->vec[0][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], NLATIME_CONVERT_UNMAP);
-               bezt->vec[2][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], NLATIME_CONVERT_UNMAP);
+               bezt->vec[0][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], NLATIME_CONVERT_UNMAP);
+               bezt->vec[2][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], NLATIME_CONVERT_UNMAP);
        }
        
-       bezt->vec[1][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], NLATIME_CONVERT_UNMAP);
+       bezt->vec[1][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], NLATIME_CONVERT_UNMAP);
        
        return 0;
 }
@@ -316,16 +316,16 @@ static short bezt_nlamapping_restore(KeyframeEditData *ked, BezTriple *bezt)
 static short bezt_nlamapping_apply(KeyframeEditData *ked, BezTriple *bezt)
 {
        /* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */
-       AnimData *adt= (AnimData*)ked->data;
-       short only_keys= (short)ked->i1;
+       AnimData *adt = (AnimData *)ked->data;
+       short only_keys = (short)ked->i1;
        
        /* adjust BezTriple handles only if allowed to */
        if (only_keys == 0) {
-               bezt->vec[0][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], NLATIME_CONVERT_MAP);
-               bezt->vec[2][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], NLATIME_CONVERT_MAP);
+               bezt->vec[0][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[0][0], NLATIME_CONVERT_MAP);
+               bezt->vec[2][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[2][0], NLATIME_CONVERT_MAP);
        }
        
-       bezt->vec[1][0]= BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], NLATIME_CONVERT_MAP);
+       bezt->vec[1][0] = BKE_nla_tweakedit_remap(adt, bezt->vec[1][0], NLATIME_CONVERT_MAP);
        
        return 0;
 }
@@ -333,25 +333,25 @@ static short bezt_nlamapping_apply(KeyframeEditData *ked, BezTriple *bezt)
 
 /* Apply/Unapply NLA mapping to all keyframes in the nominated F-Curve 
  *     - restore = whether to map points back to non-mapped time 
- *     - only_keys = whether to only adjust the location of the center point of beztriples
+ *  - only_keys = whether to only adjust the location of the center point of beztriples
  */
 void ANIM_nla_mapping_apply_fcurve(AnimData *adt, FCurve *fcu, short restore, short only_keys)
 {
-       KeyframeEditData ked= {{NULL}};
+       KeyframeEditData ked = {{NULL}};
        KeyframeEditFunc map_cb;
        
        /* init edit data 
         *      - AnimData is stored in 'data'
         *      - only_keys is stored in 'i1'
         */
-       ked.data= (void *)adt;
-       ked.i1= (int)only_keys;
+       ked.data = (void *)adt;
+       ked.i1 = (int)only_keys;
        
        /* get editing callback */
        if (restore)
-               map_cb= bezt_nlamapping_restore;
+               map_cb = bezt_nlamapping_restore;
        else
-               map_cb= bezt_nlamapping_apply;
+               map_cb = bezt_nlamapping_apply;
        
        /* apply to F-Curve */
        ANIM_fcurve_keyframes_loop(&ked, fcu, NULL, map_cb, NULL);
@@ -376,9 +376,9 @@ float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short rest
                                /* if the radians flag is not set, default to using degrees which need conversions */
                                if ((scene) && (scene->unit.system_rotation == USER_UNIT_ROT_RADIANS) == 0) {
                                        if (restore)
-                                               return DEG2RADF(1.0f);  /* degrees to radians */
+                                               return DEG2RADF(1.0f);  /* degrees to radians */
                                        else
-                                               return RAD2DEGF(1.0f);  /* radians to degrees */
+                                               return RAD2DEGF(1.0f);  /* radians to degrees */
                                }
                        }
                        
@@ -393,18 +393,18 @@ float ANIM_unit_mapping_get_factor(Scene *scene, ID *id, FCurve *fcu, short rest
 /* ----------------------- */
 
 /* helper function for ANIM_unit_mapping_apply_fcurve -> mapping callback for unit mapping */
-static short bezt_unit_mapping_apply (KeyframeEditData *ked, BezTriple *bezt)
+static short bezt_unit_mapping_apply(KeyframeEditData *ked, BezTriple *bezt)
 {
        /* mapping factor is stored in f1, flags are stored in i1 */
-       short only_keys= (ked->i1 & ANIM_UNITCONV_ONLYKEYS);
-       short sel_vs= (ked->i1 & ANIM_UNITCONV_SELVERTS);
-       float fac= ked->f1;
+       short only_keys = (ked->i1 & ANIM_UNITCONV_ONLYKEYS);
+       short sel_vs = (ked->i1 & ANIM_UNITCONV_SELVERTS);
+       float fac = ked->f1;
        
        /* adjust BezTriple handles only if allowed to */
        if (only_keys == 0) {
-               if ((sel_vs==0) || (bezt->f1 & SELECT)) 
+               if ((sel_vs == 0) || (bezt->f1 & SELECT))
                        bezt->vec[0][1] *= fac;
-               if ((sel_vs==0) || (bezt->f3 & SELECT)) 
+               if ((sel_vs == 0) || (bezt->f3 & SELECT))
                        bezt->vec[2][1] *= fac;
        }
        
@@ -425,7 +425,7 @@ void ANIM_unit_mapping_apply_fcurve(Scene *scene, ID *id, FCurve *fcu, short fla
        if (G.rendering) return;
        
        /* calculate mapping factor, and abort if nothing to change */
-       fac= ANIM_unit_mapping_get_factor(scene, id, fcu, (flag & ANIM_UNITCONV_RESTORE));
+       fac = ANIM_unit_mapping_get_factor(scene, id, fcu, (flag & ANIM_UNITCONV_RESTORE));
        if (fac == 1.0f)
                return;
        
@@ -434,14 +434,14 @@ void ANIM_unit_mapping_apply_fcurve(Scene *scene, ID *id, FCurve *fcu, short fla
         *      - flags are stored in 'i1'
         */
        memset(&ked, 0, sizeof(KeyframeEditData));
-       ked.f1= (float)fac;
-       ked.i1= (int)flag;
+       ked.f1 = (float)fac;
+       ked.i1 = (int)flag;
        
        /* only selected? */
        if (flag & ANIM_UNITCONV_ONLYSEL)
-               sel_cb= ANIM_editkeyframes_ok(BEZT_OK_SELECTED);
+               sel_cb = ANIM_editkeyframes_ok(BEZT_OK_SELECTED);
        else
-               sel_cb= NULL;
+               sel_cb = NULL;
        
        /* apply to F-Curve */
        ANIM_fcurve_keyframes_loop(&ked, fcu, sel_cb, bezt_unit_mapping_apply, NULL);
@@ -452,7 +452,7 @@ void ANIM_unit_mapping_apply_fcurve(Scene *scene, ID *id, FCurve *fcu, short fla
                FPoint *fpt;
                unsigned int i;
                
-               for (i=0, fpt=fcu->fpt; i < fcu->totvert; i++, fpt++) {
+               for (i = 0, fpt = fcu->fpt; i < fcu->totvert; i++, fpt++) {
                        /* apply unit mapping */
                        fpt->vec[1] *= fac;
                }
index d9f735f05590e90d14766ec8acb863b118a5508e..2392b872031fede068b8a716381353b87e4d4612 100644 (file)
@@ -99,9 +99,9 @@
 
 /* Get shapekey data being edited (for Action Editor -> ShapeKey mode) */
 /* Note: there's a similar function in key.c (ob_get_key) */
-static Key *actedit_get_shapekeys (bAnimContext *ac) 
+static Key *actedit_get_shapekeys(bAnimContext *ac)
 {
-       Scene *scene= ac->scene;
+       Scene *scene = ac->scene;
        Object *ob;
        Key *key;
        
@@ -113,7 +113,7 @@ static Key *actedit_get_shapekeys (bAnimContext *ac)
        //if (saction->pin) return NULL;
        
        /* shapekey data is stored with geometry data */
-       key= ob_get_key(ob);
+       key = ob_get_key(ob);
        
        if (key) {
                if (key->type == KEY_RELATIVE)
@@ -124,7 +124,7 @@ static Key *actedit_get_shapekeys (bAnimContext *ac)
 }
 
 /* Get data being edited in Action Editor (depending on current 'mode') */
-static short actedit_get_context (bAnimContext *ac, SpaceAction *saction)
+static short actedit_get_context(bAnimContext *ac, SpaceAction *saction)
 {
        /* get dopesheet */
        ac->ads = &saction->ads;
@@ -133,25 +133,25 @@ static short actedit_get_context (bAnimContext *ac, SpaceAction *saction)
        switch (saction->mode) {
                case SACTCONT_ACTION: /* 'Action Editor' */
                        /* if not pinned, sync with active object */
-                       if (/*saction->pin == 0*/1) {
+                       if (/*saction->pin == 0*/ 1) {
                                if (ac->obact && ac->obact->adt)
                                        saction->action = ac->obact->adt->action;
                                else
                                        saction->action = NULL;
                        }
                        
-                       ac->datatype= ANIMCONT_ACTION;
-                       ac->data= saction->action;
+                       ac->datatype = ANIMCONT_ACTION;
+                       ac->data = saction->action;
                        
-                       ac->mode= saction->mode;
+                       ac->mode = saction->mode;
                        return 1;
                        
                case SACTCONT_SHAPEKEY: /* 'ShapeKey Editor' */
-                       ac->datatype= ANIMCONT_SHAPEKEY;
-                       ac->data= actedit_get_shapekeys(ac);
+                       ac->datatype = ANIMCONT_SHAPEKEY;
+                       ac->data = actedit_get_shapekeys(ac);
                        
                        /* if not pinned, sync with active object */
-                       if (/*saction->pin == 0*/1) {
+                       if (/*saction->pin == 0*/ 1) {
                                Key *key = (Key *)ac->data;
                                
                                if (key && key->adt)
@@ -160,34 +160,34 @@ static short actedit_get_context (bAnimContext *ac, SpaceAction *saction)
                                        saction->action = NULL;
                        }
                        
-                       ac->mode= saction->mode;
+                       ac->mode = saction->mode;
                        return 1;
                        
                case SACTCONT_GPENCIL: /* Grease Pencil */ // XXX review how this mode is handled...
                        /* update scene-pointer (no need to check for pinning yet, as not implemented) */
-                       saction->ads.source= (ID *)ac->scene;
+                       saction->ads.source = (ID *)ac->scene;
                        
-                       ac->datatype= ANIMCONT_GPENCIL;
-                       ac->data= &saction->ads;
+                       ac->datatype = ANIMCONT_GPENCIL;
+                       ac->data = &saction->ads;
                        
-                       ac->mode= saction->mode;
+                       ac->mode = saction->mode;
                        return 1;
                        
                case SACTCONT_DOPESHEET: /* DopeSheet */
                        /* update scene-pointer (no need to check for pinning yet, as not implemented) */
-                       saction->ads.source= (ID *)ac->scene;
+                       saction->ads.source = (ID *)ac->scene;
                        
-                       ac->datatype= ANIMCONT_DOPESHEET;
-                       ac->data= &saction->ads;
+                       ac->datatype = ANIMCONT_DOPESHEET;
+                       ac->data = &saction->ads;
                        
-                       ac->mode= saction->mode;
+                       ac->mode = saction->mode;
                        return 1;
                
                default: /* unhandled yet */
-                       ac->datatype= ANIMCONT_NONE;
-                       ac->data= NULL;
+                       ac->datatype = ANIMCONT_NONE;
+                       ac->data = NULL;
                        
-                       ac->mode= -1;
+                       ac->mode = -1;
                        return 0;
        }
 }
@@ -195,12 +195,12 @@ static short actedit_get_context (bAnimContext *ac, SpaceAction *saction)
 /* ----------- Private Stuff - Graph Editor ------------- */
 
 /* Get data being edited in Graph Editor (depending on current 'mode') */
-static short graphedit_get_context (bAnimContext *ac, SpaceIpo *sipo)
+static short graphedit_get_context(bAnimContext *ac, SpaceIpo *sipo)
 {
        /* init dopesheet data if non-existant (i.e. for old files) */
        if (sipo->ads == NULL) {
-               sipo->ads= MEM_callocN(sizeof(bDopeSheet), "GraphEdit DopeSheet");
-               sipo->ads->source= (ID *)ac->scene;
+               sipo->ads = MEM_callocN(sizeof(bDopeSheet), "GraphEdit DopeSheet");
+               sipo->ads->source = (ID *)ac->scene;
        }
        ac->ads = sipo->ads;
        
@@ -212,33 +212,33 @@ static short graphedit_get_context (bAnimContext *ac, SpaceIpo *sipo)
        
        /* sync settings with current view status, then return appropriate data */
        switch (sipo->mode) {
-               case SIPO_MODE_ANIMATION:       /* Animation F-Curve Editor */
+               case SIPO_MODE_ANIMATION:  /* Animation F-Curve Editor */
                        /* update scene-pointer (no need to check for pinning yet, as not implemented) */
-                       sipo->ads->source= (ID *)ac->scene;
+                       sipo->ads->source = (ID *)ac->scene;
                        sipo->ads->filterflag &= ~ADS_FILTER_ONLYDRIVERS;
                        
-                       ac->datatype= ANIMCONT_FCURVES;
-                       ac->data= sipo->ads;
+                       ac->datatype = ANIMCONT_FCURVES;
+                       ac->data = sipo->ads;
                        
-                       ac->mode= sipo->mode;
+                       ac->mode = sipo->mode;
                        return 1;
                
-               case SIPO_MODE_DRIVERS:         /* Driver F-Curve Editor */
+               case SIPO_MODE_DRIVERS:  /* Driver F-Curve Editor */
                        /* update scene-pointer (no need to check for pinning yet, as not implemented) */
-                       sipo->ads->source= (ID *)ac->scene;
+                       sipo->ads->source = (ID *)ac->scene;
                        sipo->ads->filterflag |= ADS_FILTER_ONLYDRIVERS;
                        
-                       ac->datatype= ANIMCONT_DRIVERS;
-                       ac->data= sipo->ads;
+                       ac->datatype = ANIMCONT_DRIVERS;
+                       ac->data = sipo->ads;
                        
-                       ac->mode= sipo->mode;
+                       ac->mode = sipo->mode;
                        return 1;
                
                default: /* unhandled yet */
-                       ac->datatype= ANIMCONT_NONE;
-                       ac->data= NULL;
+                       ac->datatype = ANIMCONT_NONE;
+                       ac->data = NULL;
                        
-                       ac->mode= -1;
+                       ac->mode = -1;
                        return 0;
        }
 }
@@ -246,20 +246,20 @@ static short graphedit_get_context (bAnimContext *ac, SpaceIpo *sipo)
 /* ----------- Private Stuff - NLA Editor ------------- */
 
 /* Get data being edited in Graph Editor (depending on current 'mode') */
-static short nlaedit_get_context (bAnimContext *ac, SpaceNla *snla)
+static short nlaedit_get_context(bAnimContext *ac, SpaceNla *snla)
 {
        /* init dopesheet data if non-existant (i.e. for old files) */
        if (snla->ads == NULL)
-               snla->ads= MEM_callocN(sizeof(bDopeSheet), "NlaEdit DopeSheet");
+               snla->ads = MEM_callocN(sizeof(bDopeSheet), "NlaEdit DopeSheet");
        ac->ads = snla->ads;
        
        /* sync settings with current view status, then return appropriate data */
        /* update scene-pointer (no need to check for pinning yet, as not implemented) */
-       snla->ads->source= (ID *)ac->scene;
+       snla->ads->source = (ID *)ac->scene;
        snla->ads->filterflag |= ADS_FILTER_ONLYNLA;
        
-       ac->datatype= ANIMCONT_NLA;
-       ac->data= snla->ads;
+       ac->datatype = ANIMCONT_NLA;
+       ac->data = snla->ads;
        
        return 1;
 }
@@ -273,31 +273,31 @@ static short nlaedit_get_context (bAnimContext *ac, SpaceNla *snla)
 short ANIM_animdata_context_getdata(bAnimContext *ac)
 {
        SpaceLink *sl = ac->sl;
-       short ok= 0;
+       short ok = 0;
        
        /* context depends on editor we are currently in */
        if (sl) {
                switch (ac->spacetype) {
                        case SPACE_ACTION:
                        {
-                               SpaceAction *saction= (SpaceAction *)sl;
-                               ok= actedit_get_context(ac, saction);
+                               SpaceAction *saction = (SpaceAction *)sl;
+                               ok = actedit_get_context(ac, saction);
                        }
-                               break;
+                       break;
                                
                        case SPACE_IPO:
                        {
-                               SpaceIpo *sipo= (SpaceIpo *)sl;
-                               ok= graphedit_get_context(ac, sipo);
+                               SpaceIpo *sipo = (SpaceIpo *)sl;
+                               ok = graphedit_get_context(ac, sipo);
                        }
-                               break;
+                       break;
                                
                        case SPACE_NLA:
                        {
-                               SpaceNla *snla= (SpaceNla *)sl;
-                               ok= nlaedit_get_context(ac, snla);
+                               SpaceNla *snla = (SpaceNla *)sl;
+                               ok = nlaedit_get_context(ac, snla);
                        }
-                               break;
+                       break;
                }
        }
        
@@ -315,26 +315,26 @@ short ANIM_animdata_context_getdata(bAnimContext *ac)
  */
 short ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
 {
-       ScrArea *sa= CTX_wm_area(C);
-       ARegion *ar= CTX_wm_region(C);
-       SpaceLink *sl= CTX_wm_space_data(C);
-       Scene *scene= CTX_data_scene(C);
+       ScrArea *sa = CTX_wm_area(C);
+       ARegion *ar = CTX_wm_region(C);
+       SpaceLink *sl = CTX_wm_space_data(C);
+       Scene *scene = CTX_data_scene(C);
        
        /* clear old context info */
        if (ac == NULL) return 0;
        memset(ac, 0, sizeof(bAnimContext));
        
        /* get useful default context settings from context */
-       ac->scene= scene;
+       ac->scene = scene;
        if (scene) {
-               ac->markers= ED_context_get_markers(C);         
-               ac->obact= (scene->basact)?  scene->basact->object : NULL;
+               ac->markers = ED_context_get_markers(C);
+               ac->obact = (scene->basact) ?  scene->basact->object : NULL;
        }
-       ac->sa= sa;
-       ac->ar= ar;
-       ac->sl= sl;
-       ac->spacetype= (sa) ? sa->spacetype : 0;
-       ac->regiontype= (ar) ? ar->regiontype : 0;
+       ac->sa = sa;
+       ac->ar = ar;
+       ac->sl = sl;
+       ac->spacetype = (sa) ? sa->spacetype : 0;
+       ac->regiontype = (ar) ? ar->regiontype : 0;
        
        /* get data context info */
        return ANIM_animdata_context_getdata(ac);
@@ -355,28 +355,28 @@ short ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
  *        dealt with by the recursive detection idiom in place.
  *
  * Implementation Note:
- *     YES the _doSubChannels variable is NOT read anywhere. BUT, this is NOT an excuse
- *     to go steamrolling the logic into a single-line expression as from experience,
- *     those are notoriously difficult to read + debug when extending later on. The code
- *     below is purposefully laid out so that each case noted above corresponds clearly to
- *     one case below.
+ *  YES the _doSubChannels variable is NOT read anywhere. BUT, this is NOT an excuse
+ *  to go steamrolling the logic into a single-line expression as from experience,
+ *  those are notoriously difficult to read + debug when extending later on. The code
+ *  below is purposefully laid out so that each case noted above corresponds clearly to
+ *  one case below.
  */
 #define BEGIN_ANIMFILTER_SUBCHANNELS(expanded_check) \
        { \
                int _filter = filter_mode; \
                short _doSubChannels = 0; \
                if (!(filter_mode & ANIMFILTER_LIST_VISIBLE) || (expanded_check)) \
-                       _doSubChannels=1; \
+                       _doSubChannels = 1; \
                else if (!(filter_mode & ANIMFILTER_LIST_CHANNELS)) \
-                       _doSubChannels=2; \
-               else {\
+                       _doSubChannels = 2; \
+               else { \
                        filter_mode |= ANIMFILTER_TMP_PEEK; \
                } \
-                 \
+                \
                { \
                        (void) _doSubChannels; \
                }
-               /* ... standard sub-channel filtering can go on here now ... */
+/* ... standard sub-channel filtering can go on here now ... */
 #define END_ANIMFILTER_SUBCHANNELS \
                filter_mode = _filter; \
        }
@@ -402,9 +402,9 @@ short ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
  *     - ListBase anim_data;
  *     - bDopeSheet *ads;
  *     - bAnimListElem *ale;
- *     - size_t items;
+ *  - size_t items;
  *
- *     - id: ID block which should have an AnimData pointer following it immediately, to use
+ *  - 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
@@ -421,32 +421,32 @@ short ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
  *     4) normal keyframes: only when there is an active action
  */
 #define ANIMDATA_FILTER_CASES(id, adtOk, nlaOk, driversOk, keysOk) \
-       {\
-               if ((id)->adt) {\
-                       if (!(filter_mode & ANIMFILTER_CURVE_VISIBLE) || !((id)->adt->flag & ADT_CURVES_NOT_VISIBLE)) {\
-                               if (filter_mode & ANIMFILTER_ANIMDATA) {\
-                                       adtOk\
-                               }\
-                               else if (ads->filterflag & ADS_FILTER_ONLYNLA) {\
-                                       if (ANIMDATA_HAS_NLA(id)) {\
-                                               nlaOk\
-                                       }\
-                                       else if (!(ads->filterflag & ADS_FILTER_NLA_NOACT) && ANIMDATA_HAS_KEYS(id)) {\
-                                               nlaOk\
-                                       }\
-                               }\
-                               else if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) {\
-                                       if (ANIMDATA_HAS_DRIVERS(id)) {\
-                                               driversOk\
-                                       }\
-                               }\
-                               else {\
-                                       if (ANIMDATA_HAS_KEYS(id)) {\
-                                               keysOk\
-                                       }\
-                               }\
-                       }\
-               }\
+       { \
+               if ((id)->adt) { \
+                       if (!(filter_mode & ANIMFILTER_CURVE_VISIBLE) || !((id)->adt->flag & ADT_CURVES_NOT_VISIBLE)) { \
+                               if (filter_mode & ANIMFILTER_ANIMDATA) { \
+                                       adtOk \
+                               } \
+                               else if (ads->filterflag & ADS_FILTER_ONLYNLA) { \
+                                       if (ANIMDATA_HAS_NLA(id)) { \
+                                               nlaOk \
+                                       } \
+                                       else if (!(ads->filterflag & ADS_FILTER_NLA_NOACT) && ANIMDATA_HAS_KEYS(id)) { \
+                                               nlaOk \
+                                       } \
+                               } \
+                               else if (ads->filterflag & ADS_FILTER_ONLYDRIVERS) { \
+                                       if (ANIMDATA_HAS_DRIVERS(id)) { \
+                                               driversOk \
+                                       } \
+                               } \
+                               else { \
+                                       if (ANIMDATA_HAS_KEYS(id)) { \
+                                               keysOk \
+                                       } \
+                               } \
+                       } \
+               } \
        }
 
 /* ............................... */
@@ -461,10 +461,10 @@ short ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
        if (filter_mode & ANIMFILTER_TMP_PEEK) \
                return 1; \
        else { \
-               bAnimListElem *ale= make_new_animlistelem(channel_data, channel_type, (ID *)owner_id); \
-               if (ale) {\
+               bAnimListElem *ale = make_new_animlistelem(channel_data, channel_type, (ID *)owner_id); \
+               if (ale) { \
                        BLI_addtail(anim_data, ale); \
-                       items++; \
+                       items ++; \
                        ale_statement \
                } \
        }
@@ -476,13 +476,13 @@ short ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
        
 /* quick macro to test if an anim-channel representing an AnimData block is suitably active */
 #define ANIMCHANNEL_ACTIVEOK(ale) \
-       ( !(filter_mode & ANIMFILTER_ACTIVE) || !(ale->adt) || (ale->adt->flag & ADT_UI_ACTIVE) )
+       (!(filter_mode & ANIMFILTER_ACTIVE) || !(ale->adt) || (ale->adt->flag & ADT_UI_ACTIVE) )
 
 /* quick macro to test if an anim-channel (F-Curve, Group, etc.) is selected in an acceptable way */
 #define ANIMCHANNEL_SELOK(test_func) \
-               ( !(filter_mode & (ANIMFILTER_SEL|ANIMFILTER_UNSEL)) || \
-                 ((filter_mode & ANIMFILTER_SEL) && test_func) || \
-                 ((filter_mode & ANIMFILTER_UNSEL) && test_func==0) ) 
+       (!(filter_mode & (ANIMFILTER_SEL | ANIMFILTER_UNSEL)) || \
+        ((filter_mode & ANIMFILTER_SEL) && test_func) || \
+        ((filter_mode & ANIMFILTER_UNSEL) && test_func == 0) )
                  
 /* quick macro to test if an anim-channel (F-Curve) is selected ok for editing purposes 
  *     - _SELEDIT means that only selected curves will have visible+editable keyframes
@@ -493,29 +493,29 @@ short ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
  *     3) test_func (i.e. selection test) - only if selected, this test will pass
  */
 #define ANIMCHANNEL_SELEDITOK(test_func) \
-               ( !(filter_mode & ANIMFILTER_SELEDIT) || \
-                 !(filter_mode & ANIMFILTER_FOREDIT) || \
-                 (test_func) )
+       (!(filter_mode & ANIMFILTER_SELEDIT) || \
+        !(filter_mode & ANIMFILTER_FOREDIT) || \
+        (test_func) )
 
 /* ----------- 'Private' Stuff --------------- */
 
 /* this function allocates memory for a new bAnimListElem struct for the 
  * provided animation channel-data. 
  */
-static bAnimListElem *make_new_animlistelem (void *data, short datatype, ID *owner_id)
+static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owner_id)
 {
-       bAnimListElem *ale= NULL;
+       bAnimListElem *ale = NULL;
        
        /* only allocate memory if there is data to convert */
        if (data) {
                /* allocate and set generic data */
-               ale= MEM_callocN(sizeof(bAnimListElem), "bAnimListElem");
+               ale = MEM_callocN(sizeof(bAnimListElem), "bAnimListElem");
                
-               ale->data= data;
-               ale->type= datatype;
+               ale->data = data;
+               ale->type = datatype;
                
-               ale->id= owner_id;
-               ale->adt= BKE_animdata_from_id(owner_id);
+               ale->id = owner_id;
+               ale->adt = BKE_animdata_from_id(owner_id);
                
                /* do specifics */
                switch (datatype) {
@@ -524,307 +524,307 @@ static bAnimListElem *make_new_animlistelem (void *data, short datatype, ID *own
                                /* nothing to include for now... this is just a dummy wrappy around all the other channels 
                                 * in the DopeSheet, and gets included at the start of the list
                                 */
-                               ale->key_data= NULL;
-                               ale->datatype= ALE_ALL;
+                               ale->key_data = NULL;
+                               ale->datatype = ALE_ALL;
                        }
-                               break;
+                       break;
                        
                        case ANIMTYPE_SCENE:
                        {
-                               Scene *sce= (Scene *)data;
+                               Scene *sce = (Scene *)data;
                                
-                               ale->flag= sce->flag;
+                               ale->flag = sce->flag;
                                
-                               ale->key_data= sce;
-                               ale->datatype= ALE_SCE;
+                               ale->key_data = sce;
+                               ale->datatype = ALE_SCE;
                                
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_OBJECT:
                        {
-                               Base *base= (Base *)data;
-                               Object *ob= base->object;
+                               Base *base = (Base *)data;
+                               Object *ob = base->object;
                                
-                               ale->flag= ob->flag;
+                               ale->flag = ob->flag;
                                
-                               ale->key_data= ob;
-                               ale->datatype= ALE_OB;
+                               ale->key_data = ob;
+                               ale->datatype = ALE_OB;
                                
-                               ale->adt= BKE_animdata_from_id(&ob->id);
+                               ale->adt = BKE_animdata_from_id(&ob->id);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_FILLACTD:
                        {
-                               bAction *act= (bAction *)data;
+                               bAction *act = (bAction *)data;
                                
-                               ale->flag= act->flag;
+                               ale->flag = act->flag;
                                
-                               ale->key_data= act;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = act;
+                               ale->datatype = ALE_ACT;
                        }
-                               break;
+                       break;
                        case ANIMTYPE_FILLDRIVERS:
                        {
-                               AnimData *adt= (AnimData *)data;
+                               AnimData *adt = (AnimData *)data;
                                
-                               ale->flag= adt->flag;
+                               ale->flag = adt->flag;
                                
-                                       // XXX... drivers don't show summary for now
-                               ale->key_data= NULL;
-                               ale->datatype= ALE_NONE;
+                               // XXX... drivers don't show summary for now
+                               ale->key_data = NULL;
+                               ale->datatype = ALE_NONE;
                        }
-                               break;
+                       break;
                        
                        case ANIMTYPE_DSMAT:
                        {
-                               Material *ma= (Material *)data;
-                               AnimData *adt= ma->adt;
+                               Material *ma = (Material *)data;
+                               AnimData *adt = ma->adt;
                                
-                               ale->flag= FILTER_MAT_OBJD(ma);
+                               ale->flag = FILTER_MAT_OBJD(ma);
                                
-                               ale->key_data= (adt) ? adt->action : NULL;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = (adt) ? adt->action : NULL;
+                               ale->datatype = ALE_ACT;
                                
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_DSLAM:
                        {
-                               Lamp *la= (Lamp *)data;
-                               AnimData *adt= la->adt;
+                               Lamp *la = (Lamp *)data;
+                               AnimData *adt = la->adt;
                                
-                               ale->flag= FILTER_LAM_OBJD(la);
+                               ale->flag = FILTER_LAM_OBJD(la);
                                
-                               ale->key_data= (adt) ? adt->action : NULL;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = (adt) ? adt->action : NULL;
+                               ale->datatype = ALE_ACT;
                                
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_DSCAM:
                        {
-                               Camera *ca= (Camera *)data;
-                               AnimData *adt= ca->adt;
+                               Camera *ca = (Camera *)data;
+                               AnimData *adt = ca->adt;
                                
-                               ale->flag= FILTER_CAM_OBJD(ca);
+                               ale->flag = FILTER_CAM_OBJD(ca);
                                
-                               ale->key_data= (adt) ? adt->action : NULL;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = (adt) ? adt->action : NULL;
+                               ale->datatype = ALE_ACT;
                                
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_DSCUR:
                        {
-                               Curve *cu= (Curve *)data;
-                               AnimData *adt= cu->adt;
+                               Curve *cu = (Curve *)data;
+                               AnimData *adt = cu->adt;
                                
-                               ale->flag= FILTER_CUR_OBJD(cu);
+                               ale->flag = FILTER_CUR_OBJD(cu);
                                
-                               ale->key_data= (adt) ? adt->action : NULL;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = (adt) ? adt->action : NULL;
+                               ale->datatype = ALE_ACT;
                                
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_DSARM:
                        {
-                               bArmature *arm= (bArmature *)data;
-                               AnimData *adt= arm->adt;
+                               bArmature *arm = (bArmature *)data;
+                               AnimData *adt = arm->adt;
                                
-                               ale->flag= FILTER_ARM_OBJD(arm);
+                               ale->flag = FILTER_ARM_OBJD(arm);
                                
-                               ale->key_data= (adt) ? adt->action : NULL;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = (adt) ? adt->action : NULL;
+                               ale->datatype = ALE_ACT;
                                
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_DSMESH:
                        {
-                               Mesh *me= (Mesh *)data;
-                               AnimData *adt= me->adt;
+                               Mesh *me = (Mesh *)data;
+                               AnimData *adt = me->adt;
                                
-                               ale->flag= FILTER_MESH_OBJD(me);
+                               ale->flag = FILTER_MESH_OBJD(me);
                                
-                               ale->key_data= (adt) ? adt->action : NULL;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = (adt) ? adt->action : NULL;
+                               ale->datatype = ALE_ACT;
                                
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_DSLAT:
                        {
-                               Lattice *lt= (Lattice *)data;
-                               AnimData *adt= lt->adt;
+                               Lattice *lt = (Lattice *)data;
+                               AnimData *adt = lt->adt;
                                
-                               ale->flag= FILTER_LATTICE_OBJD(lt);
+                               ale->flag = FILTER_LATTICE_OBJD(lt);
                                
-                               ale->key_data= (adt) ? adt->action : NULL;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = (adt) ? adt->action : NULL;
+                               ale->datatype = ALE_ACT;
                                
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }       
-                               break;
+                       break;
                        case ANIMTYPE_DSSPK:
                        {
-                               Speaker *spk= (Speaker *)data;
-                               AnimData *adt= spk->adt;
+                               Speaker *spk = (Speaker *)data;
+                               AnimData *adt = spk->adt;
 
-                               ale->flag= FILTER_SPK_OBJD(spk);
+                               ale->flag = FILTER_SPK_OBJD(spk);
 
-                               ale->key_data= (adt) ? adt->action : NULL;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = (adt) ? adt->action : NULL;
+                               ale->datatype = ALE_ACT;
 
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_DSSKEY:
                        {
-                               Key *key= (Key *)data;
-                               AnimData *adt= key->adt;
+                               Key *key = (Key *)data;
+                               AnimData *adt = key->adt;
                                
-                               ale->flag= FILTER_SKE_OBJD(key); 
+                               ale->flag = FILTER_SKE_OBJD(key);
                                
-                               ale->key_data= (adt) ? adt->action : NULL;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = (adt) ? adt->action : NULL;
+                               ale->datatype = ALE_ACT;
                                
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_DSWOR:
                        {
-                               World *wo= (World *)data;
-                               AnimData *adt= wo->adt;
+                               World *wo = (World *)data;
+                               AnimData *adt = wo->adt;
                                
-                               ale->flag= FILTER_WOR_SCED(wo); 
+                               ale->flag = FILTER_WOR_SCED(wo);
                                
-                               ale->key_data= (adt) ? adt->action : NULL;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = (adt) ? adt->action : NULL;
+                               ale->datatype = ALE_ACT;
                                
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_DSNTREE:
                        {
-                               bNodeTree *ntree= (bNodeTree *)data;
-                               AnimData *adt= ntree->adt;
+                               bNodeTree *ntree = (bNodeTree *)data;
+                               AnimData *adt = ntree->adt;
                                
-                               ale->flag= FILTER_NTREE_DATA(ntree); 
+                               ale->flag = FILTER_NTREE_DATA(ntree);
                                
-                               ale->key_data= (adt) ? adt->action : NULL;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = (adt) ? adt->action : NULL;
+                               ale->datatype = ALE_ACT;
                                
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_DSPART:
                        {
-                               ParticleSettings *part= (ParticleSettings*)ale->data;
-                               AnimData *adt= part->adt;
+                               ParticleSettings *part = (ParticleSettings *)ale->data;
+                               AnimData *adt = part->adt;
                                
-                               ale->flag= FILTER_PART_OBJD(part); 
+                               ale->flag = FILTER_PART_OBJD(part);
                                
-                               ale->key_data= (adt) ? adt->action : NULL;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = (adt) ? adt->action : NULL;
+                               ale->datatype = ALE_ACT;
                                
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }
-                               break;
+                       break;
                        case ANIMTYPE_DSTEX:
                        {
-                               Tex *tex= (Tex *)data;
-                               AnimData *adt= tex->adt;
+                               Tex *tex = (Tex *)data;
+                               AnimData *adt = tex->adt;
                                
-                               ale->flag= FILTER_TEX_DATA(tex); 
+                               ale->flag = FILTER_TEX_DATA(tex);
                                
-                               ale->key_data= (adt) ? adt->action : NULL;
-                               ale->datatype= ALE_ACT;
+                               ale->key_data = (adt) ? adt->action : NULL;
+                               ale->datatype = ALE_ACT;
                                
-                               ale->adt= BKE_animdata_from_id(data);
+                               ale->adt = BKE_animdata_from_id(data);
                        }
-                               break;
+                       break;
                                
                        case ANIMTYPE_GROUP:
                        {
-                               bActionGroup *agrp= (bActionGroup *)data;
+                               bActionGroup *agrp = (bActionGroup *)data;
                                
-                               ale->flag= agrp->flag;
+                               ale->flag = agrp->flag;
                                
-                               ale->key_data= NULL;
-                               ale->datatype= ALE_GROUP;
+                               ale->key_data = NULL;
+                               ale->datatype = ALE_GROUP;
                        }
-                               break;
+                       break;
                        case ANIMTYPE_FCURVE:
                        {
-                               FCurve *fcu= (FCurve *)data;
+                               FCurve *fcu = (FCurve *)data;
                                
-                               ale->flag= fcu->flag;
+                               ale->flag = fcu->flag;
                                
-                               ale->key_data= fcu;
-                               ale->datatype= ALE_FCURVE;
+                               ale->key_data = fcu;
+                               ale->datatype = ALE_FCURVE;
                        }
-                               break;
+                       break;
                                
                        case ANIMTYPE_SHAPEKEY:
                        {
-                               KeyBlock *kb= (KeyBlock *)data;
-                               Key *key= (Key *)ale->id;
+                               KeyBlock *kb = (KeyBlock *)data;
+                               Key *key = (Key *)ale->id;
                                
-                               ale->flag= kb->flag;
+                               ale->flag = kb->flag;
                                
                                /* whether we have keyframes depends on whether there is a Key block to find it from */
                                if (key) {
                                        /* index of shapekey is defined by place in key's list */
-                                       ale->index= BLI_findindex(&key->block, kb);
+                                       ale->index = BLI_findindex(&key->block, kb);
                                        
                                        /* the corresponding keyframes are from the animdata */
                                        if (ale->adt && ale->adt->action) {
-                                               bAction *act= ale->adt->action;
+                                               bAction *act = ale->adt->action;
                                                char *rna_path = key_get_curValue_rnaPath(key, kb);
                                                
                                                /* try to find the F-Curve which corresponds to this exactly,
                                                 * then free the MEM_alloc'd string
                                                 */
                                                if (rna_path) {
-                                                       ale->key_data= (void *)list_find_fcurve(&act->curves, rna_path, 0);
+                                                       ale->key_data = (void *)list_find_fcurve(&act->curves, rna_path, 0);
                                                        MEM_freeN(rna_path);
                                                }
                                        }
-                                       ale->datatype= (ale->key_data)? ALE_FCURVE : ALE_NONE;
+                                       ale->datatype = (ale->key_data) ? ALE_FCURVE : ALE_NONE;
                                }
                        }       
-                               break;
+                       break;
                        
                        case ANIMTYPE_GPLAYER:
                        {
-                               bGPDlayer *gpl= (bGPDlayer *)data;
+                               bGPDlayer *gpl = (bGPDlayer *)data;
                                
-                               ale->flag= gpl->flag;
+                               ale->flag = gpl->flag;
                                
-                               ale->key_data= NULL;
-                               ale->datatype= ALE_GPFRAME;
+                               ale->key_data = NULL;
+                               ale->datatype = ALE_GPFRAME;
                        }
-                               break;
+                       break;
                                
                        case ANIMTYPE_NLATRACK:
                        {
-                               NlaTrack *nlt= (NlaTrack *)data;
+                               NlaTrack *nlt = (NlaTrack *)data;
                                
-                               ale->flag= nlt->flag;
+                               ale->flag = nlt->flag;
                                
-                               ale->key_data= &nlt->strips;
-                               ale->datatype= ALE_NLASTRIP;
+                               ale->key_data = &nlt->strips;
+                               ale->datatype = ALE_NLASTRIP;
                        }
-                               break;
+                       break;
                        case ANIMTYPE_NLAACTION:
                        {
                                /* nothing to include for now... nothing editable from NLA-perspective here */
-                               ale->key_data= NULL;
-                               ale->datatype= ALE_NONE;
+                               ale->key_data = NULL;
+                               ale->datatype = ALE_NONE;
                        }
-                               break;
+                       break;
                }
        }
        
@@ -837,13 +837,13 @@ static bAnimListElem *make_new_animlistelem (void *data, short datatype, ID *own
 /* 'Only Selected' selected data and/or 'Include Hidden' filtering
  * NOTE: when this function returns true, the F-Curve is to be skipped 
  */
-static short skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner_id, int filter_mode)
+static short skip_fcurve_selected_data(bDopeSheet *ads, FCurve *fcu, ID *owner_id, int filter_mode)
 {
        /* hidden items should be skipped if we only care about visible data, but we aren't interested in hidden stuff */
        short skip_hidden = (filter_mode & ANIMFILTER_DATA_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN);
        
        if (GS(owner_id->name) == ID_OB) {
-               Object *ob= (Object *)owner_id;
+               Object *ob = (Object *)owner_id;
                
                /* only consider if F-Curve involves pose.bones */
                if ((fcu->rna_path) && strstr(fcu->rna_path, "pose.bones")) {
@@ -851,15 +851,15 @@ static short skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner_
                        char *bone_name;
                        
                        /* get bone-name, and check if this bone is selected */
-                       bone_name= BLI_getQuotedStr(fcu->rna_path, "pose.bones[");
-                       pchan= BKE_pose_channel_find_name(ob->pose, bone_name);
+                       bone_name = BLI_getQuotedStr(fcu->rna_path, "pose.bones[");
+                       pchan = BKE_pose_channel_find_name(ob->pose, bone_name);
                        if (bone_name) MEM_freeN(bone_name);
                        
                        /* check whether to continue or skip */
                        if ((pchan) && (pchan->bone)) {
                                /* if only visible channels, skip if bone not visible unless user wants channels from hidden data too */
                                if (skip_hidden) {
-                                       bArmature *arm= (bArmature *)ob->data;
+                                       bArmature *arm = (bArmature *)ob->data;
                                        
                                        /* skipping - not visible on currently visible layers */
                                        if ((arm->layer & pchan->bone->layer) == 0)
@@ -882,18 +882,18 @@ static short skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner_
                
                /* only consider if F-Curve involves sequence_editor.sequences */
                if ((fcu->rna_path) && strstr(fcu->rna_path, "sequences_all")) {
-                       Editing *ed= seq_give_editing(scene, FALSE);
+                       Editing *ed = seq_give_editing(scene, FALSE);
                        Sequence *seq;
                        char *seq_name;
                        
                        /* get strip name, and check if this strip is selected */
-                       seq_name= BLI_getQuotedStr(fcu->rna_path, "sequences_all[");
+                       seq_name = BLI_getQuotedStr(fcu->rna_path, "sequences_all[");
                        seq = get_seq_by_name(ed->seqbasep, seq_name, FALSE);
                        if (seq_name) MEM_freeN(seq_name);
                        
                        /* can only add this F-Curve if it is selected */
                        if (ads->filterflag & ADS_FILTER_ONLYSEL) {
-                               if ((seq == NULL) || (seq->flag & SELECT)==0)
+                               if ((seq == NULL) || (seq->flag & SELECT) == 0)
                                        return 1;
                        }
                }
@@ -907,13 +907,13 @@ static short skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner_
                        char *node_name;
                        
                        /* get strip name, and check if this strip is selected */
-                       node_name= BLI_getQuotedStr(fcu->rna_path, "nodes[");
+                       node_name = BLI_getQuotedStr(fcu->rna_path, "nodes[");
                        node = nodeFindNodebyName(ntree, node_name);
                        if (node_name) MEM_freeN(node_name);
                        
                        /* can only add this F-Curve if it is selected */
                        if (ads->filterflag & ADS_FILTER_ONLYSEL) {
-                               if ((node) && (node->flag & NODE_SELECT)==0)
+                               if ((node) && (node->flag & NODE_SELECT) == 0)
                                        return 1;
                        }
                }
@@ -924,7 +924,7 @@ static short skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner_
 /* (Display-)Name-based F-Curve filtering
  * NOTE: when this function returns true, the F-Curve is to be skipped 
  */
-static short skip_fcurve_with_name (bDopeSheet *ads, FCurve *fcu, ID *owner_id)
+static short skip_fcurve_with_name(bDopeSheet *ads, FCurve *fcu, ID *owner_id)
 {
        bAnimListElem ale_dummy = {NULL};
        bAnimChannelType *acf;
@@ -953,14 +953,14 @@ static short skip_fcurve_with_name (bDopeSheet *ads, FCurve *fcu, ID *owner_id)
 }
 
 /* find the next F-Curve that is usable for inclusion */
-static FCurve *animfilter_fcurve_next (bDopeSheet *ads, FCurve *first, bActionGroup *grp, int filter_mode, ID *owner_id)
+static FCurve *animfilter_fcurve_next(bDopeSheet *ads, FCurve *first, bActionGroup *grp, int filter_mode, ID *owner_id)
 {
        FCurve *fcu = NULL;
        
        /* loop over F-Curves - assume that the caller of this has already checked that these should be included 
         * NOTE: we need to check if the F-Curves belong to the same group, as this gets called for groups too...
         */
-       for (fcu= first; ((fcu) && (fcu->grp==grp)); fcu= fcu->next) {
+       for (fcu = first; ((fcu) && (fcu->grp == grp)); fcu = fcu->next) {
                /* special exception for Pose-Channel/Sequence-Strip/Node Based F-Curves:
                 *      - the 'Only Selected' and 'Include Hidden' data filters should be applied to sub-ID data which
                 *        can be independently selected/hidden, such as Pose-Channels, Sequence Strips, and Nodes.
@@ -970,7 +970,7 @@ static FCurve *animfilter_fcurve_next (bDopeSheet *ads, FCurve *first, bActionGr
                 *      - this will also affect things like Drivers, and also works for Bone Constraints
                 */
                if (ads && owner_id) {
-                       if ((ads->filterflag & ADS_FILTER_ONLYSEL) || (ads->filterflag & ADS_FILTER_INCL_HIDDEN)==0) {
+                       if ((ads->filterflag & ADS_FILTER_ONLYSEL) || (ads->filterflag & ADS_FILTER_INCL_HIDDEN) == 0) {
                                if (skip_fcurve_selected_data(ads, fcu, owner_id, filter_mode))
                                        continue;
                        }
@@ -1002,7 +1002,7 @@ static FCurve *animfilter_fcurve_next (bDopeSheet *ads, FCurve *first, bActionGr
        return NULL;
 }
 
-static size_t animfilter_fcurves (ListBase *anim_data, bDopeSheet *ads, FCurve *first, bActionGroup *grp, int filter_mode, ID *owner_id)
+static size_t animfilter_fcurves(ListBase *anim_data, bDopeSheet *ads, FCurve *first, bActionGroup *grp, int filter_mode, ID *owner_id)
 {
        FCurve *fcu;
        size_t items = 0;
@@ -1024,7 +1024,7 @@ static size_t animfilter_fcurves (ListBase *anim_data, bDopeSheet *ads, FCurve *
        return items;
 }
 
-static size_t animfilter_act_group (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, bAction *UNUSED(act), bActionGroup *agrp, int filter_mode, ID *owner_id)
+static size_t animfilter_act_group(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, bAction *UNUSED(act), bActionGroup *agrp, int filter_mode, ID *owner_id)
 {
        ListBase tmp_data = {NULL, NULL};
        size_t tmp_items = 0;
@@ -1033,12 +1033,12 @@ static size_t animfilter_act_group (bAnimContext *ac, ListBase *anim_data, bDope
        
        /* if we care about the selection status of the channels, 
         * but the group isn't expanded (1)...
-        *      (1) this only matters if we actually care about the hierarchy though.
+        *  (1) this only matters if we actually care about the hierarchy though.
         *              - Hierarchy matters: this hack should be applied
         *              - Hierarchy ignored: cases like [#21276] won't work properly, unless we skip this hack
         */
-       if ( ((filter_mode & ANIMFILTER_LIST_VISIBLE) && EXPANDED_AGRP(ac, agrp)==0) &&         /* care about hierarchy but group isn't expanded */
-                 (filter_mode & (ANIMFILTER_SEL|ANIMFILTER_UNSEL)) )                                                   /* care about selection status */        
+       if ( ((filter_mode & ANIMFILTER_LIST_VISIBLE) && EXPANDED_AGRP(ac, agrp) == 0) &&     /* care about hierarchy but group isn't expanded */
+            (filter_mode & (ANIMFILTER_SEL | ANIMFILTER_UNSEL)) )                          /* care about selection status */
        {
                /* if the group itself isn't selected appropriately, we shouldn't consider it's children either */
                if (ANIMCHANNEL_SELOK(SEL_AGRP(agrp)) == 0)
@@ -1052,7 +1052,7 @@ static size_t animfilter_act_group (bAnimContext *ac, ListBase *anim_data, bDope
                 *      - pasting keyframes
                 *      - creating ghost curves in Graph Editor
                 */
-               filter_mode &= ~(ANIMFILTER_SEL|ANIMFILTER_UNSEL|ANIMFILTER_LIST_VISIBLE);
+               filter_mode &= ~(ANIMFILTER_SEL | ANIMFILTER_UNSEL | ANIMFILTER_LIST_VISIBLE);
        }
        
        /* add grouped F-Curves */
@@ -1086,7 +1086,7 @@ static size_t animfilter_act_group (bAnimContext *ac, ListBase *anim_data, bDope
                        //filter_mode = ofilter;
                        
                        /* filter selection of channel specially here again, since may be open and not subject to previous test */
-                       if ( ANIMCHANNEL_SELOK(SEL_AGRP(agrp)) ) {
+                       if (ANIMCHANNEL_SELOK(SEL_AGRP(agrp)) ) {
                                ANIMCHANNEL_NEW_CHANNEL(agrp, ANIMTYPE_GROUP, owner_id);
                        }
                }
@@ -1101,7 +1101,7 @@ static size_t animfilter_act_group (bAnimContext *ac, ListBase *anim_data, bDope
        return items;
 }
 
-static size_t animfilter_action (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, bAction *act, int filter_mode, ID *owner_id)
+static size_t animfilter_action(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, bAction *act, int filter_mode, ID *owner_id)
 {
        bActionGroup *agrp;
        FCurve *lastchan = NULL;
@@ -1119,7 +1119,7 @@ static size_t animfilter_action (bAnimContext *ac, ListBase *anim_data, bDopeShe
        for (agrp = act->groups.first; agrp; agrp = agrp->next) {
                /* store reference to last channel of group */
                if (agrp->channels.last) 
-                       lastchan= agrp->channels.last;
+                       lastchan = agrp->channels.last;
                        
                /* action group's channels */
                items += animfilter_act_group(ac, anim_data, ads, act, agrp, filter_mode, owner_id);
@@ -1127,7 +1127,7 @@ static size_t animfilter_action (bAnimContext *ac, ListBase *anim_data, bDopeShe
        
        /* un-grouped F-Curves (only if we're not only considering those channels in the active group) */
        if (!(filter_mode & ANIMFILTER_ACTGROUPED)) {
-               FCurve *firstfcu = (lastchan)? (lastchan->next) : (act->curves.first);
+               FCurve *firstfcu = (lastchan) ? (lastchan->next) : (act->curves.first);
                items += animfilter_fcurves(anim_data, ads, firstfcu, NULL, filter_mode, owner_id);
        }
        
@@ -1143,10 +1143,10 @@ static size_t animfilter_action (bAnimContext *ac, ListBase *anim_data, bDopeShe
  *     - for normal filtering (i.e. for editing), we only need the NLA-tracks but they can be in 'normal' evaluation
  *       order, i.e. first to last. Otherwise, some tools may get screwed up.
  */
-static size_t animfilter_nla (bAnimContext *UNUSED(ac), ListBase *anim_data, bDopeSheet *ads, AnimData *adt, int filter_mode, ID *owner_id)
+static size_t animfilter_nla(bAnimContext *UNUSED(ac), ListBase *anim_data, bDopeSheet *ads, AnimData *adt, int filter_mode, ID *owner_id)
 {
        NlaTrack *nlt;
-       NlaTrack *first=NULL, *next=NULL;
+       NlaTrack *first = NULL, *next = NULL;
        size_t items = 0;
        
        /* if showing channels, include active action */
@@ -1163,26 +1163,26 @@ static size_t animfilter_nla (bAnimContext *UNUSED(ac), ListBase *anim_data, bDo
                                 */
                                ANIMCHANNEL_NEW_CHANNEL_FULL((void *)(&adt->action), ANIMTYPE_NLAACTION, owner_id, 
                                        {
-                                               ale->data= adt->action ? adt->action : NULL; 
+                                               ale->data = adt->action ? adt->action : NULL; 
                                        });
                        }
                }
                
                /* first track to include will be the last one if we're filtering by channels */
-               first= adt->nla_tracks.last;
+               first = adt->nla_tracks.last;
        }
        else {
                /* first track to include will the the first one (as per normal) */
-               first= adt->nla_tracks.first;
+               first = adt->nla_tracks.first;
        }
        
        /* loop over NLA Tracks - assume that the caller of this has already checked that these should be included */
-       for (nlt= first; nlt; nlt= next) {
+       for (nlt = first; nlt; nlt = next) {
                /* 'next' NLA-Track to use depends on whether we're filtering for drawing or not */
                if (filter_mode & ANIMFILTER_LIST_CHANNELS) 
-                       next= nlt->prev;
+                       next = nlt->prev;
                else
-                       next= nlt->next;
+                       next = nlt->next;
                
                /* if we're in NLA-tweakmode, don't show this track if it was disabled (due to tweaking) for now 
                 *      - active track should still get shown though (even though it has disabled flag set)
@@ -1208,14 +1208,14 @@ static size_t animfilter_nla (bAnimContext *UNUSED(ac), ListBase *anim_data, bDo
 }
 
 /* determine what animation data from AnimData block should get displayed */
-static size_t animfilter_block_data (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *id, int filter_mode)
+static size_t animfilter_block_data(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *id, int filter_mode)
 {
        AnimData *adt = BKE_animdata_from_id(id);
        size_t items = 0;
 
        /* image object datablocks have no anim-data so check for NULL */
        if (adt) {
-               IdAdtTemplate *iat = (IdAdtTemplate*)id;
+               IdAdtTemplate *iat = (IdAdtTemplate *)id;
 
                /* NOTE: this macro is used instead of inlining the logic here, since this sort of filtering is still needed
                 * in a few places in he rest of the code still - notably for the few cases where special mode-based
@@ -1244,7 +1244,7 @@ static size_t animfilter_block_data (bAnimContext *ac, ListBase *anim_data, bDop
 
 
 /* Include ShapeKey Data for ShapeKey Editor */
-static size_t animdata_filter_shapekey (bAnimContext *ac, ListBase *anim_data, Key *key, int filter_mode)
+static size_t animdata_filter_shapekey(bAnimContext *ac, ListBase *anim_data, Key *key, int filter_mode)
 {
        size_t items = 0;
        
@@ -1253,7 +1253,7 @@ static size_t animdata_filter_shapekey (bAnimContext *ac, ListBase *anim_data, K
                KeyBlock *kb;
                
                /* loop through the channels adding ShapeKeys as appropriate */
-               for (kb= key->block.first; kb; kb= kb->next) {
+               for (kb = key->block.first; kb; kb = kb->next) {
                        /* skip the first one, since that's the non-animatable basis */
                        // XXX maybe in future this may become handy?
                        if (kb == key->block.first) continue;
@@ -1261,7 +1261,7 @@ static size_t animdata_filter_shapekey (bAnimContext *ac, ListBase *anim_data, K
                        /* only work with this channel and its subchannels if it is editable */
                        if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_SHAPEKEY(kb)) {
                                /* only include this track if selected in a way consistent with the filtering requirements */
-                               if ( ANIMCHANNEL_SELOK(SEL_SHAPEKEY(kb)) ) {
+                               if (ANIMCHANNEL_SELOK(SEL_SHAPEKEY(kb)) ) {
                                        // TODO: consider 'active' too?
                                        
                                        /* owner-id here must be key so that the F-Curve can be resolved... */
@@ -1278,7 +1278,7 @@ static size_t animdata_filter_shapekey (bAnimContext *ac, ListBase *anim_data, K
                                ANIMCHANNEL_NEW_CHANNEL(key->adt, ANIMTYPE_ANIMDATA, key);
                        }
                        else if (key->adt->action) {
-                               items= animfilter_action(ac, anim_data, NULL, key->adt->action, filter_mode, (ID *)key);
+                               items = animfilter_action(ac, anim_data, NULL, key->adt->action, filter_mode, (ID *)key);
                        }
                }
        }
@@ -1287,15 +1287,15 @@ static size_t animdata_filter_shapekey (bAnimContext *ac, ListBase *anim_data, K
        return items;
 }
 
-static size_t animdata_filter_gpencil_data (ListBase *anim_data, bGPdata *gpd, int filter_mode)
+static size_t animdata_filter_gpencil_data(ListBase *anim_data, bGPdata *gpd, int filter_mode)
 {
        bGPDlayer *gpl;
        size_t items = 0;
        
        /* loop over layers as the conditions are acceptable */
-       for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
+       for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
                /* only if selected */
-               if ( ANIMCHANNEL_SELOK(SEL_GPL(gpl)) ) {
+               if (ANIMCHANNEL_SELOK(SEL_GPL(gpl)) ) {
                        /* only if editable */
                        if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_GPL(gpl)) {
                                /* active... */
@@ -1312,7 +1312,7 @@ static size_t animdata_filter_gpencil_data (ListBase *anim_data, bGPdata *gpd, i
 
 /* Grab all Grease Pencil datablocks in file */
 // TODO: should this be amalgamated with the dopesheet filtering code?
-static size_t animdata_filter_gpencil (ListBase *anim_data, void *UNUSED(data), int filter_mode)
+static size_t animdata_filter_gpencil(ListBase *anim_data, void *UNUSED(data), int filter_mode)
 {
        bGPdata *gpd;
        size_t items = 0;
@@ -1355,7 +1355,7 @@ static size_t animdata_filter_gpencil (ListBase *anim_data, void *UNUSED(data),
 
 /* NOTE: owner_id is scene, material, or texture block, which is the direct owner of the node tree in question */
 // TODO: how to handle group nodes is still unclear...
-static size_t animdata_filter_ds_nodetree (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *owner_id, bNodeTree *ntree, int filter_mode)
+static size_t animdata_filter_ds_nodetree(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *owner_id, bNodeTree *ntree, int filter_mode)
 {
        ListBase tmp_data = {NULL, NULL};
        size_t tmp_items = 0;
@@ -1390,11 +1390,11 @@ static size_t animdata_filter_ds_nodetree (bAnimContext *ac, ListBase *anim_data
 }
 
 /* NOTE: owner_id is either material, lamp, or world block, which is the direct owner of the texture stack in question */
-static size_t animdata_filter_ds_textures (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *owner_id, int filter_mode)
+static size_t animdata_filter_ds_textures(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, ID *owner_id, int filter_mode)
 {
        MTex **mtex = NULL;
-       size_t items=0;
-       int a=0;
+       size_t items = 0;
+       int a = 0;
        
        /* get datatype specific data first */
        if (owner_id == NULL)
@@ -1403,22 +1403,22 @@ static size_t animdata_filter_ds_textures (bAnimContext *ac, ListBase *anim_data
        switch (GS(owner_id->name)) {
                case ID_MA:
                {
-                       Material *ma= (Material *)owner_id;
-                       mtex= (MTex**)(&ma->mtex);
+                       Material *ma = (Material *)owner_id;
+                       mtex = (MTex **)(&ma->mtex);
                }
-                       break;
+               break;
                case ID_LA:
                {
-                       Lamp *la= (Lamp *)owner_id;
-                       mtex= (MTex**)(&la->mtex);
+                       Lamp *la = (Lamp *)owner_id;
+                       mtex = (MTex **)(&la->mtex);
                }
-                       break;
+               break;
                case ID_WO:
                {
-                       World *wo= (World *)owner_id;
-                       mtex= (MTex**)(&wo->mtex);
+                       World *wo = (World *)owner_id;
+                       mtex = (MTex **)(&wo->mtex);
                }
-                       break;
+               break;
                default: 
                {
                        /* invalid/unsupported option */
@@ -1429,8 +1429,8 @@ static size_t animdata_filter_ds_textures (bAnimContext *ac, ListBase *anim_data
        }
        
        /* firstly check that we actuallly have some textures, by gathering all textures in a temp list */
-       for (a=0; a < MAX_MTEX; a++) {
-               Tex *tex= (mtex[a]) ? mtex[a]->tex : NULL;
+       for (a = 0; a < MAX_MTEX; a++) {
+               Tex *tex = (mtex[a]) ? mtex[a]->tex : NULL;
                ListBase tmp_data = {NULL, NULL};
                size_t tmp_items = 0;
                
@@ -1476,7 +1476,7 @@ static size_t animdata_filter_ds_textures (bAnimContext *ac, ListBase *anim_data
 }
 
 
-static size_t animdata_filter_ds_material (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Material *ma, int filter_mode)
+static size_t animdata_filter_ds_material(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Material *ma, int filter_mode)
 {
        ListBase tmp_data = {NULL, NULL};
        size_t tmp_items = 0;
@@ -1518,7 +1518,7 @@ static size_t animdata_filter_ds_material (bAnimContext *ac, ListBase *anim_data
        return items;
 }
 
-static size_t animdata_filter_ds_materials (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
+static size_t animdata_filter_ds_materials(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
 {
        short has_nested = 0;
        size_t items = 0;
@@ -1559,12 +1559,12 @@ static size_t animdata_filter_ds_materials (bAnimContext *ac, ListBase *anim_dat
        return items;
 }
 
-static size_t animdata_filter_ds_particles (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
+static size_t animdata_filter_ds_particles(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
 {
        ParticleSystem *psys;
-       size_t items= 0;
+       size_t items = 0;
 
-       for (psys = ob->particlesystem.first; psys; psys=psys->next) {
+       for (psys = ob->particlesystem.first; psys; psys = psys->next) {
                ListBase tmp_data = {NULL, NULL};
                size_t tmp_items = 0;
                
@@ -1601,85 +1601,85 @@ static size_t animdata_filter_ds_particles (bAnimContext *ac, ListBase *anim_dat
        return items;
 }
 
-static size_t animdata_filter_ds_obdata (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
+static size_t animdata_filter_ds_obdata(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
 {
        ListBase tmp_data = {NULL, NULL};
        size_t tmp_items = 0;
-       size_t items= 0;
+       size_t items = 0;
        
-       IdAdtTemplate *iat= ob->data;
-       short type=0, expanded=0;
+       IdAdtTemplate *iat = ob->data;
+       short type = 0, expanded = 0;
        
        /* get settings based on data type */
        switch (ob->type) {
                case OB_CAMERA: /* ------- Camera ------------ */
                {
-                       Camera *ca= (Camera *)ob->data;
+                       Camera *ca = (Camera *)ob->data;
                        
                        if (ads->filterflag & ADS_FILTER_NOCAM)
                                return 0;
                        
-                       type= ANIMTYPE_DSCAM;
-                       expanded= FILTER_CAM_OBJD(ca);
+                       type = ANIMTYPE_DSCAM;
+                       expanded = FILTER_CAM_OBJD(ca);
                }
-                       break;
+               break;
                case OB_LAMP: /* ---------- Lamp ----------- */
                {
-                       Lamp *la= (Lamp *)ob->data;
+                       Lamp *la = (Lamp *)ob->data;
                        
                        if (ads->filterflag & ADS_FILTER_NOLAM)
                                return 0;
                        
-                       type= ANIMTYPE_DSLAM;
-                       expanded= FILTER_LAM_OBJD(la);
+                       type = ANIMTYPE_DSLAM;
+                       expanded = FILTER_LAM_OBJD(la);
                }
-                       break;
+               break;
                case OB_CURVE: /* ------- Curve ---------- */
                case OB_SURF: /* ------- Nurbs Surface ---------- */
                case OB_FONT: /* ------- Text Curve ---------- */
                {
-                       Curve *cu= (Curve *)ob->data;
+                       Curve *cu = (Curve *)ob->data;
                        
                        if (ads->filterflag & ADS_FILTER_NOCUR)
                                return 0;
                        
-                       type= ANIMTYPE_DSCUR;
-                       expanded= FILTER_CUR_OBJD(cu);
+                       type = ANIMTYPE_DSCUR;
+                       expanded = FILTER_CUR_OBJD(cu);
                }
-                       break;
+               break;
                case OB_MBALL: /* ------- MetaBall ---------- */
                {
-                       MetaBall *mb= (MetaBall *)ob->data;
+                       MetaBall *mb = (MetaBall *)ob->data;
                        
                        if (ads->filterflag & ADS_FILTER_NOMBA)
                                return 0;
                        
-                       type= ANIMTYPE_DSMBALL;
-                       expanded= FILTER_MBALL_OBJD(mb);
+                       type = ANIMTYPE_DSMBALL;
+                       expanded = FILTER_MBALL_OBJD(mb);
                }
-                       break;
+               break;
                case OB_ARMATURE: /* ------- Armature ---------- */
                {
-                       bArmature *arm= (bArmature *)ob->data;
+                       bArmature *arm = (bArmature *)ob->data;
                        
                        if (ads->filterflag & ADS_FILTER_NOARM)
                                return 0;
                        
-                       type= ANIMTYPE_DSARM;
-                       expanded= FILTER_ARM_OBJD(arm);
+                       type = ANIMTYPE_DSARM;
+                       expanded = FILTER_ARM_OBJD(arm);
                }
-                       break;
+               break;
                case OB_MESH: /* ------- Mesh ---------- */
                {
-                       Mesh *me= (Mesh *)ob->data;
+                       Mesh *me = (Mesh *)ob->data;
                        
                        if (ads->filterflag & ADS_FILTER_NOMESH)
                                return 0;
                        
-                       type= ANIMTYPE_DSMESH;
-                       expanded= FILTER_MESH_OBJD(me);
+                       type = ANIMTYPE_DSMESH;
+                       expanded = FILTER_MESH_OBJD(me);
                }
-                       break;
+               break;
                case OB_LATTICE: /* ---- Lattice ---- */
                {
                        Lattice *lt = (Lattice *)ob->data;
@@ -1687,18 +1687,18 @@ static size_t animdata_filter_ds_obdata (bAnimContext *ac, ListBase *anim_data,
                        if (ads->filterflag & ADS_FILTER_NOLAT)
                                return 0;
                        
-                       type= ANIMTYPE_DSLAT;
-                       expanded= FILTER_LATTICE_OBJD(lt);
+                       type = ANIMTYPE_DSLAT;
+                       expanded = FILTER_LATTICE_OBJD(lt);
                }
-                       break;
+               break;
                case OB_SPEAKER: /* ---------- Speaker ----------- */
                {
-                       Speaker *spk= (Speaker *)ob->data;
+                       Speaker *spk = (Speaker *)ob->data;
                        
-                       type= ANIMTYPE_DSSPK;
-                       expanded= FILTER_SPK_OBJD(spk);
+                       type = ANIMTYPE_DSSPK;
+                       expanded = FILTER_SPK_OBJD(spk);
                }
-                       break;
+               break;
        }
        
        /* add object data animation channels */
@@ -1709,13 +1709,13 @@ static size_t animdata_filter_ds_obdata (bAnimContext *ac, ListBase *anim_data,
                
                /* sub-data filtering... */
                switch (ob->type) {
-                       case OB_LAMP:   /* lamp - textures */
+                       case OB_LAMP:  /* lamp - textures */
                        {
                                /* textures */
                                if (!(ads->filterflag & ADS_FILTER_NOTEX))
                                        tmp_items += animdata_filter_ds_textures(ac, &tmp_data, ads, ob->data, filter_mode);
                        }
-                               break;
+                       break;
                }
        }
        END_ANIMFILTER_SUBCHANNELS;
@@ -1741,7 +1741,7 @@ static size_t animdata_filter_ds_obdata (bAnimContext *ac, ListBase *anim_data,
 }
 
 /* shapekey-level animation */
-static size_t animdata_filter_ds_keyanim (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, Key *key, int filter_mode)
+static size_t animdata_filter_ds_keyanim(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, Key *key, int filter_mode)
 {
        ListBase tmp_data = {NULL, NULL};
        size_t tmp_items = 0;
@@ -1775,27 +1775,27 @@ static size_t animdata_filter_ds_keyanim (bAnimContext *ac, ListBase *anim_data,
 }
 
 /* object-level animation */
-static size_t animdata_filter_ds_obanim (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
+static size_t animdata_filter_ds_obanim(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Object *ob, int filter_mode)
 {
        ListBase tmp_data = {NULL, NULL};
        size_t tmp_items = 0;
        size_t items = 0;
        
        AnimData *adt = ob->adt;
-       short type=0, expanded=1;
+       short type = 0, expanded = 1;
        void *cdata = NULL;
        
        /* determine the type of expander channels to use */
        // this is the best way to do this for now...
        ANIMDATA_FILTER_CASES(ob,
-               {/* AnimData - no channel, but consider data */},
-               {/* NLA - no channel, but consider data */},
-               {/* Drivers */
+               { /* AnimData - no channel, but consider data */ },
+               { /* NLA - no channel, but consider data */ },
+               { /* Drivers */
                        type = ANIMTYPE_FILLDRIVERS;
                        cdata = adt;
                        expanded = EXPANDED_DRVD(adt);
                },
-               {/* Keyframes */
+               { /* Keyframes */
                        type = ANIMTYPE_FILLACTD;
                        cdata = adt->action;
                        expanded = EXPANDED_ACTC(adt->action);
@@ -1830,17 +1830,17 @@ static size_t animdata_filter_ds_obanim (bAnimContext *ac, ListBase *anim_data,
 }
 
 /* get animation channels from object2 */
-static size_t animdata_filter_dopesheet_ob (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
+static size_t animdata_filter_dopesheet_ob(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Base *base, int filter_mode)
 {
        ListBase tmp_data = {NULL, NULL};
-       Object *ob= base->object;
+       Object *ob = base->object;
        size_t tmp_items = 0;
        size_t items = 0;
        
        /* filter data contained under object first */
        BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_OBJC(ob))
        {
-               Key *key= ob_get_key(ob);
+               Key *key = ob_get_key(ob);
                
                /* object-level animation */
                if ((ob->adt) && !(ads->filterflag & ADS_FILTER_NOOBJ)) {
@@ -1894,7 +1894,7 @@ static size_t animdata_filter_dopesheet_ob (bAnimContext *ac, ListBase *anim_dat
        return items;
 }
 
-static size_t animdata_filter_ds_world (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, World *wo, int filter_mode)
+static size_t animdata_filter_ds_world(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, World *wo, int filter_mode)
 {
        ListBase tmp_data = {NULL, NULL};
        size_t tmp_items = 0;
@@ -1936,27 +1936,27 @@ static size_t animdata_filter_ds_world (bAnimContext *ac, ListBase *anim_data, b
        return items;
 }
 
-static size_t animdata_filter_ds_scene (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode)
+static size_t animdata_filter_ds_scene(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode)
 {
        ListBase tmp_data = {NULL, NULL};
        size_t tmp_items = 0;
        size_t items = 0;
        
        AnimData *adt = sce->adt;
-       short type=0, expanded=1;
+       short type = 0, expanded = 1;
        void *cdata = NULL;
        
        /* determine the type of expander channels to use */
        // this is the best way to do this for now...
        ANIMDATA_FILTER_CASES(sce,
-               {/* AnimData - no channel, but consider data */},
-               {/* NLA - no channel, but consider data */},
-               {/* Drivers */
+               { /* AnimData - no channel, but consider data */},
+               { /* NLA - no channel, but consider data */},
+               { /* Drivers */
                        type = ANIMTYPE_FILLDRIVERS;
                        cdata = adt;
                        expanded = EXPANDED_DRVD(adt);
                },
-               {/* Keyframes */
+               { /* Keyframes */
                        type = ANIMTYPE_FILLACTD;
                        cdata = adt->action;
                        expanded = EXPANDED_ACTC(adt->action);
@@ -1990,7 +1990,7 @@ static size_t animdata_filter_ds_scene (bAnimContext *ac, ListBase *anim_data, b
        return items;
 }
 
-static size_t animdata_filter_dopesheet_scene (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode)
+static size_t animdata_filter_dopesheet_scene(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, Scene *sce, int filter_mode)
 {
        ListBase tmp_data = {NULL, NULL};
        size_t tmp_items = 0;
@@ -1999,8 +1999,8 @@ static size_t animdata_filter_dopesheet_scene (bAnimContext *ac, ListBase *anim_
        /* filter data contained under object first */
        BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_SCEC(sce))
        {
-               bNodeTree *ntree= sce->nodetree;
-               World *wo= sce->world;
+               bNodeTree *ntree = sce->nodetree;
+               World *wo = sce->world;
                
                /* Action, Drivers, or NLA for Scene */
                if ((ads->filterflag & ADS_FILTER_NOSCE) == 0) {
@@ -2043,17 +2043,17 @@ static size_t animdata_filter_dopesheet_scene (bAnimContext *ac, ListBase *anim_
 }
 
 // TODO: implement pinning... (if and when pinning is done, what we need to do is to provide freeing mechanisms - to protect against data that was deleted)
-static size_t animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, int filter_mode)
+static size_t animdata_filter_dopesheet(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, int filter_mode)
 {
-       Scene *sce= (Scene *)ads->source;
+       Scene *sce = (Scene *)ads->source;
        Base *base;
        size_t items = 0;
        
        /* check that we do indeed have a scene */
-       if ((ads->source == NULL) || (GS(ads->source->name)!=ID_SCE)) {
+       if ((ads->source == NULL) || (GS(ads->source->name) != ID_SCE)) {
                printf("DopeSheet Error: Not scene!\n");
                if (G.debug & G_DEBUG)
-                       printf("\tPointer = %p, Name = '%s'\n", (void *)ads->source, (ads->source)?ads->source->name:NULL);
+                       printf("\tPointer = %p, Name = '%s'\n", (void *)ads->source, (ads->source) ? ads->source->name : NULL);
                return 0;
        }
        
@@ -2069,10 +2069,10 @@ static size_t animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data,
        items += animdata_filter_dopesheet_scene(ac, anim_data, ads, sce, filter_mode);
        
        /* loop over all bases (i.e.objects) in the scene */
-       for (base= sce->base.first; base; base= base->next) {
+       for (base = sce->base.first; base; base = base->next) {
                /* check if there's an object (all the relevant checks are done in the ob-function) */
                if (base->object) {
-                       Object *ob= base->object;
+                       Object *ob = base->object;
                        
                        /* firstly, check if object can be included, by the following factors:
                         *      - if only visible, must check for layer and also viewport visibility
@@ -2085,7 +2085,7 @@ static size_t animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data,
                         */
                        if ((filter_mode & ANIMFILTER_DATA_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN)) {
                                /* layer visibility - we check both object and base, since these may not be in sync yet */
-                               if ((sce->lay & (ob->lay|base->lay))==0) continue;
+                               if ((sce->lay & (ob->lay | base->lay)) == 0) continue;
                                
                                /* outliner restrict-flag */
                                if (ob->restrictflag & OB_RESTRICT_VIEW) continue;
@@ -2124,9 +2124,9 @@ static size_t animdata_filter_dopesheet (bAnimContext *ac, ListBase *anim_data,
 }
 
 /* Summary track for DopeSheet/Action Editor 
- *     - return code is whether the summary lets the other channels get drawn
+ *  - return code is whether the summary lets the other channels get drawn
  */
-static short animdata_filter_dopesheet_summary (bAnimContext *ac, ListBase *anim_data, int filter_mode, size_t *items)
+static short animdata_filter_dopesheet_summary(bAnimContext *ac, ListBase *anim_data, int filter_mode, size_t *items)
 {
        bDopeSheet *ads = NULL;
        
@@ -2136,8 +2136,8 @@ static short animdata_filter_dopesheet_summary (bAnimContext *ac, ListBase *anim
         *        being applicable.
         */
        if ((ac && ac->sl) && (ac->spacetype == SPACE_ACTION)) {
-               SpaceAction *saction= (SpaceAction *)ac->sl;
-               ads= &saction->ads;
+               SpaceAction *saction = (SpaceAction *)ac->sl;
+               ads = &saction->ads;
        }
        else {
                /* invalid space type - skip this summary channels */
@@ -2149,7 +2149,7 @@ static short animdata_filter_dopesheet_summary (bAnimContext *ac, ListBase *anim
         *      - only useful for DopeSheet/Action/etc. editors where it is actually useful
         */
        if ((filter_mode & ANIMFILTER_LIST_CHANNELS) && (ads->filterflag & ADS_FILTER_SUMMARY)) {
-               bAnimListElem *ale= make_new_animlistelem(ac, ANIMTYPE_SUMMARY, NULL);
+               bAnimListElem *ale = make_new_animlistelem(ac, ANIMTYPE_SUMMARY, NULL);
                if (ale) {
                        BLI_addtail(anim_data, ale);
                        (*items)++;
@@ -2169,7 +2169,7 @@ static short animdata_filter_dopesheet_summary (bAnimContext *ac, ListBase *anim
 /* ......................... */
 
 /* filter data associated with a channel - usually for handling summary-channels in DopeSheet */
-static size_t animdata_filter_animchan (bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, bAnimListElem *channel, int filter_mode)
+static size_t animdata_filter_animchan(bAnimContext *ac, ListBase *anim_data, bDopeSheet *ads, bAnimListElem *channel, int filter_mode)
 {
        size_t items = 0;
        
@@ -2195,14 +2195,14 @@ static size_t animdata_filter_animchan (bAnimContext *ac, ListBase *anim_data, b
 /* ----------- Cleanup API --------------- */
 
 /* Remove entries with invalid types in animation channel list */
-static size_t animdata_filter_remove_invalid (ListBase *anim_data)
+static size_t animdata_filter_remove_invalid(ListBase *anim_data)
 {
        bAnimListElem *ale, *next;
        size_t items = 0;
        
        /* only keep entries with valid types */
-       for (ale= anim_data->first; ale; ale= next) {
-               next= ale->next;
+       for (ale = anim_data->first; ale; ale = next) {
+               next = ale->next;
                
                if (ale->type == ANIMTYPE_NONE)
                        BLI_freelinkN(anim_data, ale);
@@ -2214,7 +2214,7 @@ static size_t animdata_filter_remove_invalid (ListBase *anim_data)
 }
 
 /* Remove duplicate entries in animation channel list */
-static size_t animdata_filter_remove_duplis (ListBase *anim_data)
+static size_t animdata_filter_remove_duplis(ListBase *anim_data)
 {
        bAnimListElem *ale, *next;
        GHash *gh;
@@ -2223,7 +2223,7 @@ static size_t animdata_filter_remove_duplis (ListBase *anim_data)
        /* build new hashtable to efficiently store and retrieve which entries have been 
         * encountered already while searching
         */
-       gh= BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "animdata_filter_duplis_remove gh");
+       gh = BLI_ghash_new(BLI_ghashutil_ptrhash, BLI_ghashutil_ptrcmp, "animdata_filter_duplis_remove gh");
        
        /* loop through items, removing them from the list if a similar item occurs already */
        for (ale = anim_data->first; ale; ale = next) {
@@ -2256,7 +2256,7 @@ static size_t animdata_filter_remove_duplis (ListBase *anim_data)
 /* This function filters the active data source to leave only animation channels suitable for
  * usage by the caller. It will return the length of the list 
  * 
- *     *anim_data: is a pointer to a ListBase, to which the filtered animation channels
+ *  *anim_data: is a pointer to a ListBase, to which the filtered animation channels
  *             will be placed for use.
  *     filter_mode: how should the data be filtered - bitmapping accessed flags
  */
@@ -2269,31 +2269,31 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mo
                
                /* firstly filter the data */
                switch (datatype) {
-                       case ANIMCONT_ACTION:   /* 'Action Editor' */
+                       case ANIMCONT_ACTION:   /* 'Action Editor' */
                        {
-                               Object *obact= ac->obact;
+                               Object *obact = ac->obact;
                                SpaceAction *saction = (SpaceAction *)ac->sl;
-                               bDopeSheet *ads = (saction)? &saction->ads : NULL;
+                               bDopeSheet *ads = (saction) ? &saction->ads : NULL;
                                
                                /* the check for the DopeSheet summary is included here since the summary works here too */
                                if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
                                        items += animfilter_action(ac, anim_data, ads, data, filter_mode, (ID *)obact);
                        }
-                               break;
+                       break;
                                
                        case ANIMCONT_SHAPEKEY: /* 'ShapeKey Editor' */
                        {
                                /* the check for the DopeSheet summary is included here since the summary works here too */
                                if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
-                                       items= animdata_filter_shapekey(ac, anim_data, data, filter_mode);
+                                       items = animdata_filter_shapekey(ac, anim_data, data, filter_mode);
                        }
-                               break;
+                       break;
                                
                        case ANIMCONT_GPENCIL:
                        {
-                               items= animdata_filter_gpencil(anim_data, data, filter_mode);
+                               items = animdata_filter_gpencil(anim_data, data, filter_mode);
                        }
-                               break;
+                       break;
                                
                        case ANIMCONT_DOPESHEET: /* 'DopeSheet Editor' */
                        {
@@ -2301,7 +2301,7 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mo
                                if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
                                        items += animdata_filter_dopesheet(ac, anim_data, data, filter_mode);
                        }
-                               break;
+                       break;
                                
                        case ANIMCONT_FCURVES: /* Graph Editor -> FCurves/Animation Editing */
                        case ANIMCONT_DRIVERS: /* Graph Editor -> Drivers Editing */
@@ -2310,7 +2310,7 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mo
                                /* all of these editors use the basic DopeSheet data for filtering options, but don't have all the same features */
                                items = animdata_filter_dopesheet(ac, anim_data, data, filter_mode);
                        }
-                               break;
+                       break;
                        
                        case ANIMCONT_CHANNEL: /* animation channel */
                        {
@@ -2319,7 +2319,7 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mo
                                /* based on the channel type, filter relevant data for this */
                                items = animdata_filter_animchan(ac, anim_data, ads, data, filter_mode);
                        }
-                               break;
+                       break;
                }
                        
                /* remove any 'weedy' entries */
index bfc70c794043eb43af5bda033671a9e04d6957e1..7d1209a3033cc7c19bf357f5092cf591c4f39111 100644 (file)
@@ -40,14 +40,14 @@ extern ListBase builtin_keyingsets;
 
 /* Main Keyframe Management operators: 
  *     These handle keyframes management from various spaces. They only make use of
- *     Keying Sets.
+ *  Keying Sets.
  */
 void ANIM_OT_keyframe_insert(struct wmOperatorType *ot);
 void ANIM_OT_keyframe_delete(struct wmOperatorType *ot);
 
 /* Main Keyframe Management operators: 
  *     These handle keyframes management from various spaces. They will handle the menus 
- *     required for each space.
+ *  required for each space.
  */
 void ANIM_OT_keyframe_insert_menu(struct wmOperatorType *ot);
 void ANIM_OT_keyframe_delete_v3d(struct wmOperatorType *ot);
index 4be3f79060e88d97689cebbc71b335566e4c705b..593010fae0966603b15102bde38791c5cf536f0f 100644 (file)
@@ -78,9 +78,9 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
                
                /* try to resolve the path */
                if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) {
-                       const char *structname=NULL, *propname=NULL;
+                       const char *structname = NULL, *propname = NULL;
                        char arrayindbuf[16];
-                       const char *arrayname=NULL;
+                       const char *arrayname = NULL;
                        short free_structname = 0;
                        
                        /* For now, name will consist of 3 parts: struct-name, property name, array index
@@ -104,44 +104,44 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
                         */
                        if (strstr(fcu->rna_path, "bones") && strstr(fcu->rna_path, "constraints")) {
                                /* perform string 'chopping' to get "Bone Name : Constraint Name" */
-                               char *pchanName= BLI_getQuotedStr(fcu->rna_path, "bones[");
-                               char *constName= BLI_getQuotedStr(fcu->rna_path, "constraints[");
+                               char *pchanName = BLI_getQuotedStr(fcu->rna_path, "bones[");
+                               char *constName = BLI_getQuotedStr(fcu->rna_path, "constraints[");
                                
                                /* assemble the string to display in the UI... */
-                               structname= BLI_sprintfN("%s : %s", pchanName, constName);
-                               free_structname= 1;
+                               structname = BLI_sprintfN("%s : %s", pchanName, constName);
+                               free_structname = 1;
                                
                                /* free the temp names */
                                if (pchanName) MEM_freeN(pchanName);
                                if (constName) MEM_freeN(constName);
                        }
                        else if (ptr.data != ptr.id.data) {
-                               PropertyRNA *nameprop= RNA_struct_name_property(ptr.type);
+                               PropertyRNA *nameprop = RNA_struct_name_property(ptr.type);
                                if (nameprop) {
                                        /* this gets a string which will need to be freed */
-                                       structname= RNA_property_string_get_alloc(&ptr, nameprop, NULL, 0, NULL);
-                                       free_structname= 1;
+                                       structname = RNA_property_string_get_alloc(&ptr, nameprop, NULL, 0, NULL);
+                                       free_structname = 1;
                                }
                                else
-                                       structname= RNA_struct_ui_name(ptr.type);
+                                       structname = RNA_struct_ui_name(ptr.type);
                        }
                        
                        /* Property Name is straightforward */
-                       propname= RNA_property_ui_name(prop);
+                       propname = RNA_property_ui_name(prop);
                        
                        /* Array Index - only if applicable */
                        if (RNA_property_array_length(&ptr, prop)) {
-                               char c= RNA_property_array_item_char(prop, fcu->array_index);
+                               char c = RNA_property_array_item_char(prop, fcu->array_index);
                                
                                /* we need to write the index to a temp buffer (in py syntax) */
                                if (c) BLI_snprintf(arrayindbuf, sizeof(arrayindbuf), "%c ", c);
                                else BLI_snprintf(arrayindbuf, sizeof(arrayindbuf), "[%d]", fcu->array_index);
                                
-                               arrayname= &arrayindbuf[0];
+                               arrayname = &arrayindbuf[0];
                        }
                        else {
                                /* no array index */
-                               arrayname= "";
+                               arrayname = "";
                        }
                        
                        /* putting this all together into the buffer */
@@ -160,7 +160,7 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
                        /* Icon for this property's owner:
                         *      use the struct's icon if it is set
                         */
-                       icon= RNA_struct_ui_icon(ptr.type);
+                       icon = RNA_struct_ui_icon(ptr.type);
                        
                        /* valid path - remove the invalid tag since we now know how to use it saving
                         * users manual effort to reenable using "Revive Disabled FCurves" [#29629]
@@ -173,7 +173,7 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
                        
                        /* icon for this should be the icon for the base ID */
                        // TODO: or should we just use the error icon?
-                       icon= RNA_struct_ui_icon(id_ptr.type);
+                       icon = RNA_struct_ui_icon(id_ptr.type);
                        
                        /* tag F-Curve as disabled - as not usable path */
                        fcu->flag |= FCURVE_DISABLED;
@@ -187,7 +187,7 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu)
 /* ------------------------------- Color Codes for F-Curve Channels ---------------------------- */
 
 /* step between the major distinguishable color bands of the primary colors */
-#define HSV_BANDWIDTH  0.3f
+#define HSV_BANDWIDTH   0.3f
 
 /* used to determine the color of F-Curves with FCURVE_COLOR_AUTO_RAINBOW set */
 //void fcurve_rainbow (unsigned int cur, unsigned int tot, float *out)
@@ -202,8 +202,8 @@ void getcolor_fcurve_rainbow(int cur, int tot, float *out)
         *      4 - for 'even' numbers of curves - there should be a majority of quartets of curves
         * so the base color is simply one of the three primary colors
         */
-       grouping= (4 - (tot % 2));
-       hue= HSV_BANDWIDTH * (float)(cur % grouping);
+       grouping = (4 - (tot % 2));
+       hue = HSV_BANDWIDTH * (float)(cur % grouping);
        
        /* 'Value' (i.e. darkness) needs to vary so that larger sets of three will be 
         * 'darker' (i.e. smaller value), so that they don't look that similar to previous ones.
@@ -214,15 +214,15 @@ void getcolor_fcurve_rainbow(int cur, int tot, float *out)
        
        /* the base color can get offset a bit so that the colors aren't so identical */
        hue += fac * HSV_BANDWIDTH; 
-       if (hue > 1.0f) hue= fmod(hue, 1.0f);
+       if (hue > 1.0f) hue = fmod(hue, 1.0f);
        
        /* saturation adjustments for more visible range */
-       if ((hue > 0.5f) && (hue < 0.8f)) sat= 0.5f;
-       else sat= 0.6f;
+       if ((hue > 0.5f) && (hue < 0.8f)) sat = 0.5f;
+       else sat = 0.6f;
        
        /* value is fixed at 1.0f, otherwise we cannot clearly see the curves... */
-       val= 1.0f;
+       val = 1.0f;
        
        /* finally, conver this to RGB colors */
-       hsv_to_rgb(hue, sat, val, out, out+1, out+2); 
+       hsv_to_rgb(hue, sat, val, out, out + 1, out + 2);
 }
index 1db43177ef09f91ae436572b253b35f8342abb70..ea344e7e33289e2c296b6fb5f617d9400853993d 100644 (file)
@@ -81,7 +81,7 @@ static ListBase *context_get_markers(Scene *scene, ScrArea *sa)
                        SpaceAction *saction = (SpaceAction *)sa->spacedata.first;
                        
                        /* local markers can only be shown when there's only a single active action to grab them from 
-                        *      - flag only takes effect when there's an action, otherwise it can get too confusing?
+                        * - flag only takes effect when there's an action, otherwise it can get too confusing?
                         */
                        if (ELEM(saction->mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY) && (saction->action)) {
                                if (saction->flag & SACTION_POSEMARKERS_SHOW) {
@@ -139,23 +139,23 @@ int ED_markers_post_apply_transform(ListBase *markers, Scene *scene, int mode, f
                                case TFM_TIME_EXTEND:
                                {
                                        /* apply delta if marker is on the right side of the current frame */
-                                       if ((side=='B') ||
-                                               (side=='L' && marker->frame < cfra) || 
-                                           (side=='R' && marker->frame >= cfra))
+                                       if ((side == 'B') ||
+                                           (side == 'L' && marker->frame < cfra) ||
+                                           (side == 'R' && marker->frame >= cfra))
                                        {
                                                marker->frame += (int)floorf(value + 0.5f);
                                                changed++;
                                        }
                                }
-                                       break;
+                               break;
                                        
                                case TFM_TIME_SCALE:
                                {       
                                        /* rescale the distance between the marker and the current frame */
-                                       marker->frame= cfra + (int)floorf(((float)(marker->frame - cfra) * value) + 0.5f);
+                                       marker->frame = cfra + (int)floorf(((float)(marker->frame - cfra) * value) + 0.5f);
                                        changed++;
                                }
-                                       break;
+                               break;
                        }
                }
        }
@@ -167,18 +167,18 @@ int ED_markers_post_apply_transform(ListBase *markers, Scene *scene, int mode, f
 
 /* Get the marker that is closest to this point */
 /* XXX for select, the min_dist should be small */
-TimeMarker *ED_markers_find_nearest_marker (ListBase *markers, float x) 
+TimeMarker *ED_markers_find_nearest_marker(ListBase *markers, float x)
 {
-       TimeMarker *marker, *nearest=NULL;
-       float dist, min_dist= 1000000;
+       TimeMarker *marker, *nearest = NULL;
+       float dist, min_dist = 1000000;
        
        if (markers) {
-               for (marker= markers->first; marker; marker= marker->next) {
+               for (marker = markers->first; marker; marker = marker->next) {
                        dist = ABS((float)marker->frame - x);
                        
                        if (dist < min_dist) {
-                               min_dist= dist;
-                               nearest= marker;
+                               min_dist = dist;
+                               nearest = marker;
                        }
                }
        }
@@ -189,7 +189,7 @@ TimeMarker *ED_markers_find_nearest_marker (ListBase *markers, float x)
 /* Return the time of the marker that occurs on a frame closest to the given time */
 int ED_markers_find_nearest_marker_time(ListBase *markers, float x)
 {
-       TimeMarker *nearest= ED_markers_find_nearest_marker(markers, x);
+       TimeMarker *nearest = ED_markers_find_nearest_marker(markers, x);
        return (nearest) ? (nearest->frame) : (int)floor(x + 0.5f);
 }
 
@@ -209,11 +209,11 @@ void ED_markers_get_minmax(ListBase *markers, short sel, float *first, float *la
        }
        
        if (markers->first && markers->last) {
-               TimeMarker *fm= markers->first;
-               TimeMarker *lm= markers->last;
+               TimeMarker *fm = markers->first;
+               TimeMarker *lm = markers->last;
                
-               min= (float)fm->frame;
-               max= (float)lm->frame;
+               min = (float)fm->frame;
+               max = (float)lm->frame;
        }
        else {
                *first = 0.0f;
@@ -223,39 +223,39 @@ void ED_markers_get_minmax(ListBase *markers, short sel, float *first, float *la
        
        /* count how many markers are usable - see later */
        if (sel) {
-               for (marker= markers->first; marker; marker= marker->next) {
+               for (marker = markers->first; marker; marker = marker->next) {
                        if (marker->flag & SELECT)
                                selcount++;
                }
        }
        else
-               selcount= BLI_countlist(markers);
+               selcount = BLI_countlist(markers);
        
        /* if only selected are to be considered, only consider the selected ones
         * (optimization for not searching list)
         */
        if (selcount > 1) {
-               for (marker= markers->first; marker; marker= marker->next) {
+               for (marker = markers->first; marker; marker = marker->next) {
                        if (sel) {
                                if (marker->flag & SELECT) {
                                        if (marker->frame < min)
-                                               min= (float)marker->frame;
+                                               min = (float)marker->frame;
                                        if (marker->frame > max)
-                                               max= (float)marker->frame;
+                                               max = (float)marker->frame;
                                }
                        }
                        else {
                                if (marker->frame < min)
-                                       min= (float)marker->frame;
+                                       min = (float)marker->frame;
                                if (marker->frame > max)
-                                       max= (float)marker->frame;
+                                       max = (float)marker->frame;
                        }       
                }
        }
        
        /* set the min/max values */
-       *first= min;
-       *last= max;
+       *first = min;
+       *last = max;
 }
 
 /* --------------------------------- */
@@ -266,26 +266,26 @@ static void add_marker_to_cfra_elem(ListBase *lb, TimeMarker *marker, short only
        CfraElem *ce, *cen;
        
        /* should this one only be considered if it is selected? */
-       if ((only_sel) && ((marker->flag & SELECT)==0))
+       if ((only_sel) && ((marker->flag & SELECT) == 0))
                return;
        
        /* insertion sort - try to find a previous cfra elem */
-       for (ce= lb->first; ce; ce= ce->next) {
+       for (ce = lb->first; ce; ce = ce->next) {
                if (ce->cfra == marker->frame) {
                        /* do because of double keys */
                        if (marker->flag & SELECT) 
-                               ce->sel= marker->flag;
+                               ce->sel = marker->flag;
                        return;
                }
                else if (ce->cfra > marker->frame) break;
        }       
        
-       cen= MEM_callocN(sizeof(CfraElem), "add_to_cfra_elem"); 
+       cen = MEM_callocN(sizeof(CfraElem), "add_to_cfra_elem");
        if (ce) BLI_insertlinkbefore(lb, ce, cen);
        else BLI_addtail(lb, cen);
 
-       cen->cfra= marker->frame;
-       cen->sel= marker->flag;
+       cen->cfra = marker->frame;
+       cen->sel = marker->flag;
 }
 
 /* This function makes a list of all the markers. The only_sel
@@ -299,7 +299,7 @@ void ED_markers_make_cfra_list(ListBase *markers, ListBase *lb, short only_sel)
        if (markers == NULL)
                return;
        
-       for (marker= markers->first; marker; marker= marker->next)
+       for (marker = markers->first; marker; marker = marker->next)
                add_marker_to_cfra_elem(lb, marker, only_sel);
 }
 
@@ -349,15 +349,15 @@ void debug_markers_print_list(ListBase *markers)
 static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
 {
        float xpos, ypixels, xscale, yscale;
-       int icon_id= 0;
+       int icon_id = 0;
        
        xpos = marker->frame;
        
        /* no time correction for framelen! space is drawn with old values */
-       ypixels= v2d->mask.ymax-v2d->mask.ymin;
+       ypixels = v2d->mask.ymax - v2d->mask.ymin;
        UI_view2d_getscale(v2d, &xscale, &yscale);
        
-       glScalef(1.0f/xscale, 1.0f, 1.0f);
+       glScalef(1.0f / xscale, 1.0f, 1.0f);
        
        glEnable(GL_BLEND);
        glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);                      
@@ -377,8 +377,8 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
                        glColor4ub(0, 0, 0, 96);
                
                glBegin(GL_LINES);
-                       glVertex2f((xpos*xscale)+0.5f, 12.0f);
-                       glVertex2f((xpos*xscale)+0.5f, (v2d->cur.ymax+12.0f)*yscale);
+               glVertex2f((xpos * xscale) + 0.5f, 12.0f);
+               glVertex2f((xpos * xscale) + 0.5f, (v2d->cur.ymax + 12.0f) * yscale);
                glEnd();
                
                setlinestyle(0);
@@ -386,16 +386,16 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
        
        /* 5 px to offset icon to align properly, space / pixels corrects for zoom */
        if (flag & DRAW_MARKERS_LOCAL) {
-               icon_id= (marker->flag & ACTIVE) ? ICON_PMARKER_ACT : 
-               (marker->flag & SELECT) ? ICON_PMARKER_SEL : 
-               ICON_PMARKER;
+               icon_id = (marker->flag & ACTIVE) ? ICON_PMARKER_ACT :
+                         (marker->flag & SELECT) ? ICON_PMARKER_SEL :
+                         ICON_PMARKER;
        }
        else {
-               icon_id= (marker->flag & SELECT) ? ICON_MARKER_HLT : 
-               ICON_MARKER;
+               icon_id = (marker->flag & SELECT) ? ICON_MARKER_HLT :
+                         ICON_MARKER;
        }
        
-       UI_icon_draw(xpos*xscale-5.0f, 16.0f, icon_id);
+       UI_icon_draw(xpos * xscale - 5.0f, 16.0f, icon_id);
        
        glDisable(GL_BLEND);
        
@@ -405,18 +405,18 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
                
                if (marker->flag & SELECT) {
                        UI_ThemeColor(TH_TEXT_HI);
-                       x= xpos*xscale + 4.0f;
-                       y= (ypixels <= 39.0f)? (ypixels-10.0f) : 29.0f;
+                       x = xpos * xscale + 4.0f;
+                       y = (ypixels <= 39.0f) ? (ypixels - 10.0f) : 29.0f;
                }
                else {
                        UI_ThemeColor(TH_TEXT);
-                       if ((marker->frame <= cfra) && (marker->frame+5 > cfra)) {
-                               x= xpos*xscale + 4.0f;
-                               y= (ypixels <= 39.0f)? (ypixels - 10.0f) : 29.0f;
+                       if ((marker->frame <= cfra) && (marker->frame + 5 > cfra)) {
+                               x = xpos * xscale + 4.0f;
+                               y = (ypixels <= 39.0f) ? (ypixels - 10.0f) : 29.0f;
                        }
                        else {
-                               x= xpos*xscale + 4.0f;
-                               y= 17.0f;
+                               x = xpos * xscale + 4.0f;
+                               y = 17.0f;
                        }
                }
 
@@ -424,7 +424,7 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
                if (marker->camera && (marker->camera->restrictflag & OB_RESTRICT_RENDER)) {
                        float col[4];
                        glGetFloatv(GL_CURRENT_COLOR, col);
-                       col[3]= 0.4;
+                       col[3] = 0.4;
                        glColor4fv(col);
                }
 #endif
@@ -438,7 +438,7 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag)
 /* Draw Scene-Markers in time window */
 void draw_markers_time(const bContext *C, int flag)
 {
-       ListBase *markers= ED_context_get_markers(C);
+       ListBase *markers = ED_context_get_markers(C);
        View2D *v2d;
        TimeMarker *marker;
        Scene *scene;
@@ -450,14 +450,14 @@ void draw_markers_time(const bContext *C, int flag)
        v2d = UI_view2d_fromcontext(C);
 
        /* unselected markers are drawn at the first time */
-       for (marker= markers->first; marker; marker= marker->next) {
+       for (marker = markers->first; marker; marker = marker->next) {
                if ((marker->flag & SELECT) == 0) {
                        draw_marker(v2d, marker, scene->r.cfra, flag);
                }
        }
        
        /* selected markers are drawn later */
-       for (marker= markers->first; marker; marker= marker->next) {
+       for (marker = markers->first; marker; marker = marker->next) {
                if (marker->flag & SELECT) {
                        draw_marker(v2d, marker, scene->r.cfra, flag);
                }
@@ -549,32 +549,32 @@ static int ed_markers_opwrap_invoke(bContext *C, wmOperator *op, wmEvent *evt)
 /* add TimeMarker at curent frame */
 static int ed_marker_add(bContext *C, wmOperator *UNUSED(op))
 {
-       ListBase *markers= ED_context_get_markers(C);
+       ListBase *markers = ED_context_get_markers(C);
        TimeMarker *marker;
-       int frame= CTX_data_scene(C)->r.cfra;
+       int frame = CTX_data_scene(C)->r.cfra;
        
        if (markers == NULL)
                return OPERATOR_CANCELLED;
        
        /* prefer not having 2 markers at the same place,
         * though the user can move them to overlap once added */
-       for (marker= markers->first; marker; marker= marker->next) {
+       for (marker = markers->first; marker; marker = marker->next) {
                if (marker->frame == frame) 
                        return OPERATOR_CANCELLED;
        }
        
        /* deselect all */
-       for (marker= markers->first; marker; marker= marker->next)
+       for (marker = markers->first; marker; marker = marker->next)
                marker->flag &= ~SELECT;
        
        marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
-       marker->flag= SELECT;
-       marker->frame= frame;
+       marker->flag = SELECT;
+       marker->frame = frame;
        BLI_snprintf(marker->name, sizeof(marker->name), "F_%02d", frame); // XXX - temp code only
        BLI_addtail(markers, marker);
        
-       WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
-       WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL);
+       WM_event_add_notifier(C, NC_SCENE | ND_MARKERS, NULL);
+       WM_event_add_notifier(C, NC_ANIMATION | ND_MARKERS, NULL);
        
        return OPERATOR_FINISHED;
 }
@@ -592,7 +592,7 @@ static void MARKER_OT_add(wmOperatorType *ot)
        ot->poll = ED_operator_animview_active;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
 }
 
 /* ************************** transform markers *************************** */
@@ -623,7 +623,7 @@ static void MARKER_OT_add(wmOperatorType *ot)
 typedef struct MarkerMove {
        SpaceLink *slink;
        ListBase *markers;
-       int event_type;         /* store invoke-event, to verify */
+       int event_type;     /* store invoke-event, to verify */
        int *oldframe, evtx, firstx;
        NumInput num;
 } MarkerMove;
@@ -632,32 +632,32 @@ typedef struct MarkerMove {
 /* return 0 if not OK */
 static int ed_marker_move_init(bContext *C, wmOperator *op)
 {
-       ListBase *markers= ED_context_get_markers(C);
+       ListBase *markers = ED_context_get_markers(C);
        MarkerMove *mm;
        TimeMarker *marker;
-       int totmark=0;
+       int totmark = 0;
        int a;
 
        if (markers == NULL) return 0;
        
-       for (marker= markers->first; marker; marker= marker->next)
+       for (marker = markers->first; marker; marker = marker->next)
                if (marker->flag & SELECT) totmark++;
        
-       if (totmark==0) return 0;
+       if (totmark == 0) return 0;
        
-       op->customdata= mm= MEM_callocN(sizeof(MarkerMove), "Markermove");
-       mm->slink= CTX_wm_space_data(C);
-       mm->markers= markers;
-       mm->oldframe= MEM_callocN(totmark*sizeof(int), "MarkerMove oldframe");
+       op->customdata = mm = MEM_callocN(sizeof(MarkerMove), "Markermove");
+       mm->slink = CTX_wm_space_data(C);
+       mm->markers = markers;
+       mm->oldframe = MEM_callocN(totmark * sizeof(int), "MarkerMove oldframe");
 
        initNumInput(&mm->num);
        mm->num.idx_max = 0; /* one axis */
        mm->num.flag |= NUM_NO_FRACTION;
        mm->num.increment = 1.0f;
        
-       for (a=0, marker= markers->first; marker; marker= marker->next) {
+       for (a = 0, marker = markers->first; marker; marker = marker->next) {
                if (marker->flag & SELECT) {
-                       mm->oldframe[a]= marker->frame;
+                       mm->oldframe[a] = marker->frame;
                        a++;
                }
        }
@@ -668,12 +668,12 @@ static int ed_marker_move_init(bContext *C, wmOperator *op)
 /* free stuff */
 static void ed_marker_move_exit(bContext *C, wmOperator *op)
 {
-       MarkerMove *mm= op->customdata;
+       MarkerMove *mm = op->customdata;
        
        /* free data */
        MEM_freeN(mm->oldframe);
        MEM_freeN(op->customdata);
-       op->customdata= NULL;
+       op->customdata = NULL;
        
        /* clear custom header prints */
        ED_area_headerprint(CTX_wm_area(C), NULL);
@@ -682,11 +682,11 @@ static void ed_marker_move_exit(bContext *C, wmOperator *op)
 static int ed_marker_move_invoke(bContext *C, wmOperator *op, wmEvent *evt)
 {
        if (ed_marker_move_init(C, op)) {
-               MarkerMove *mm= op->customdata;
+               MarkerMove *mm = op->customdata;
                
-               mm->evtx= evt->x;
-               mm->firstx= evt->x;
-               mm->event_type= evt->type;
+               mm->evtx = evt->x;
+               mm->firstx = evt->x;
+               mm->event_type = evt->type;
                
                /* add temp handler */
                WM_event_add_modal_handler(C, op);
@@ -708,14 +708,14 @@ static int ed_marker_move_invoke_wrapper(bContext *C, wmOperator *op, wmEvent *e
 /* note, init has to be called succesfully */
 static void ed_marker_move_apply(wmOperator *op)
 {
-       MarkerMove *mm= op->customdata;
+       MarkerMove *mm = op->customdata;
        TimeMarker *marker;
        int a, offs;
        
-       offs= RNA_int_get(op->ptr, "frames");
-       for (a=0, marker= mm->markers->first; marker; marker= marker->next) {
+       offs = RNA_int_get(op->ptr, "frames");
+       for (a = 0, marker = mm->markers->first; marker; marker = marker->next) {
                if (marker->flag & SELECT) {
-                       marker->frame= mm->oldframe[a] + offs;
+                       marker->frame = mm->oldframe[a] + offs;
                        a++;
                }
        }
@@ -728,8 +728,8 @@ static int ed_marker_move_cancel(bContext *C, wmOperator *op)
        ed_marker_move_apply(op);
        ed_marker_move_exit(C, op);     
        
-       WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
-       WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL);
+       WM_event_add_notifier(C, NC_SCENE | ND_MARKERS, NULL);
+       WM_event_add_notifier(C, NC_ANIMATION | ND_MARKERS, NULL);
 
        return OPERATOR_CANCELLED;
 }
@@ -738,10 +738,10 @@ static int ed_marker_move_cancel(bContext *C, wmOperator *op)
 
 static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
 {
-       Scene *scene= CTX_data_scene(C);
-       MarkerMove *mm= op->customdata;
-       View2D *v2d= UI_view2d_fromcontext(C);
-       TimeMarker *marker, *selmarker=NULL;
+       Scene *scene = CTX_data_scene(C);
+       MarkerMove *mm = op->customdata;
+       View2D *v2d = UI_view2d_fromcontext(C);
+       TimeMarker *marker, *selmarker = NULL;
        float dx, fac;
        char str[256];
                
@@ -756,7 +756,7 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
                                ed_marker_move_cancel(C, op);
                                return OPERATOR_CANCELLED;
                        }
-                       /* else continue; <--- see if release event should be caught for tweak-end */
+               /* else continue; <--- see if release event should be caught for tweak-end */
                
                case RETKEY:
                case PADENTER:
@@ -764,8 +764,8 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
                case MIDDLEMOUSE:
                        if (WM_modal_tweak_exit(evt, mm->event_type)) {
                                ed_marker_move_exit(C, op);
-                               WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
-                               WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL);
+                               WM_event_add_notifier(C, NC_SCENE | ND_MARKERS, NULL);
+                               WM_event_add_notifier(C, NC_ANIMATION | ND_MARKERS, NULL);
                                return OPERATOR_FINISHED;
                        }
                        break;
@@ -773,44 +773,44 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
                        if (hasNumInput(&mm->num))
                                break;
                        
-                       dx= v2d->mask.xmax-v2d->mask.xmin;
-                       dx= (v2d->cur.xmax-v2d->cur.xmin)/dx;
+                       dx = v2d->mask.xmax - v2d->mask.xmin;
+                       dx = (v2d->cur.xmax - v2d->cur.xmin) / dx;
                        
-                       if (evt->x != mm->evtx) {       /* XXX maybe init for firsttime */
-                               int a, offs, totmark=0;
+                       if (evt->x != mm->evtx) {   /* XXX maybe init for first time */
+                               int a, offs, totmark = 0;
                                
-                               mm->evtx= evt->x;
+                               mm->evtx = evt->x;
                                
-                               fac= ((float)(evt->x - mm->firstx)*dx);
+                               fac = ((float)(evt->x - mm->firstx) * dx);
                                
                                if (mm->slink->spacetype == SPACE_TIME) 
-                                       apply_keyb_grid(evt->shift, evt->ctrl, &fac, 0.0, FPS, 0.1*FPS, 0);
+                                       apply_keyb_grid(evt->shift, evt->ctrl, &fac, 0.0, FPS, 0.1 * FPS, 0);
                                else
                                        apply_keyb_grid(evt->shift, evt->ctrl, &fac, 0.0, 1.0, 0.1, 0 /*was: U.flag & USER_AUTOGRABGRID*/);
                                
-                               offs= (int)fac;
+                               offs = (int)fac;
                                RNA_int_set(op->ptr, "frames", offs);
                                ed_marker_move_apply(op);
                                
                                /* cruft below is for header print */
-                               for (a=0, marker= mm->markers->first; marker; marker= marker->next) {
+                               for (a = 0, marker = mm->markers->first; marker; marker = marker->next) {
                                        if (marker->flag & SELECT) {
-                                               selmarker= marker;
+                                               selmarker = marker;
                                                a++; totmark++;
                                        }
                                }
                                
-                               if (totmark==1) {       
+                               if (totmark == 1) {
                                        /* we print current marker value */
                                        if (mm->slink->spacetype == SPACE_TIME) {
-                                               SpaceTime *stime= (SpaceTime *)mm->slink;
+                                               SpaceTime *stime = (SpaceTime *)mm->slink;
                                                if (stime->flag & TIME_DRAWFRAMES) 
                                                        BLI_snprintf(str, sizeof(str), "Marker %d offset %d", selmarker->frame, offs);
                                                else 
                                                        BLI_snprintf(str, sizeof(str), "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs));
                                        }
                                        else if (mm->slink->spacetype == SPACE_ACTION) {
-                                               SpaceAction *saction= (SpaceAction *)mm->slink;
+                                               SpaceAction *saction = (SpaceAction *)mm->slink;
                                                if (saction->flag & SACTION_DRAWTIME)
                                                        BLI_snprintf(str, sizeof(str), "Marker %.2f offset %.2f", FRA2TIME(selmarker->frame), FRA2TIME(offs));
                                                else
@@ -823,14 +823,14 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
                                else {
                                        /* we only print the offset */
                                        if (mm->slink->spacetype == SPACE_TIME) { 
-                                               SpaceTime *stime= (SpaceTime *)mm->slink;
+                                               SpaceTime *stime = (SpaceTime *)mm->slink;
                                                if (stime->flag & TIME_DRAWFRAMES) 
                                                        BLI_snprintf(str, sizeof(str), "Marker offset %d ", offs);
                                                else 
                                                        BLI_snprintf(str, sizeof(str), "Marker offset %.2f ", FRA2TIME(offs));
                                        }
                                        else if (mm->slink->spacetype == SPACE_ACTION) {
-                                               SpaceAction *saction= (SpaceAction *)mm->slink;
+                                               SpaceAction *saction = (SpaceAction *)mm->slink;
                                                if (saction->flag & SACTION_DRAWTIME)
                                                        BLI_snprintf(str, sizeof(str), "Marker offset %.2f ", FRA2TIME(offs));
                                                else
@@ -841,13 +841,13 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
                                        }
                                }
                                
-                               WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
-                               WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL);
+                               WM_event_add_notifier(C, NC_SCENE | ND_MARKERS, NULL);
+                               WM_event_add_notifier(C, NC_ANIMATION | ND_MARKERS, NULL);
                                ED_area_headerprint(CTX_wm_area(C), str);
                        }
        }
 
-       if (evt->val==KM_PRESS) {
+       if (evt->val == KM_PRESS) {
                float vec[3];
                char str_tx[256];
                
@@ -862,8 +862,8 @@ static int ed_marker_move_modal(bContext *C, wmOperator *op, wmEvent *evt)
                        BLI_snprintf(str, sizeof(str), "Marker offset %s", str_tx);
                        ED_area_headerprint(CTX_wm_area(C), str);
                        
-                       WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
-                       WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL);
+                       WM_event_add_notifier(C, NC_SCENE | ND_MARKERS, NULL);
+                       WM_event_add_notifier(C, NC_ANIMATION | ND_MARKERS, NULL);
                }
        }
 
@@ -895,7 +895,7 @@ static void MARKER_OT_move(wmOperatorType *ot)
        ot->cancel = ed_marker_move_cancel;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_BLOCKING | OPTYPE_GRAB_POINTER;
        
        /* rna storage */
        RNA_def_int(ot->srna, "frames", 0, INT_MIN, INT_MAX, "Frames", "", INT_MIN, INT_MAX);
@@ -922,7 +922,7 @@ static void MARKER_OT_move(wmOperatorType *ot)
 /* duplicate selected TimeMarkers */
 static void ed_marker_duplicate_apply(bContext *C)
 {
-       ListBase *markers= ED_context_get_markers(C);
+       ListBase *markers = ED_context_get_markers(C);
        TimeMarker *marker, *newmarker;
        
        if (markers == NULL) 
@@ -931,19 +931,19 @@ static void ed_marker_duplicate_apply(bContext *C)
        /* go through the list of markers, duplicate selected markers and add duplicated copies
         * to the beginning of the list (unselect original markers)
         */
-       for (marker= markers->first; marker; marker= marker->next) {
+       for (marker = markers->first; marker; marker = marker->next) {
                if (marker->flag & SELECT) {
                        /* unselect selected marker */
                        marker->flag &= ~SELECT;
                        
                        /* create and set up new marker */
                        newmarker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
-                       newmarker->flag= SELECT;
-                       newmarker->frame= marker->frame;
+                       newmarker->flag = SELECT;
+                       newmarker->frame = marker->frame;
                        BLI_strncpy(newmarker->name, marker->name, sizeof(marker->name));
                        
 #ifdef DURIAN_CAMERA_SWITCH
-                       newmarker->camera= marker->camera;
+                       newmarker->camera = marker->camera;
 #endif
 
                        /* new marker is added to the beginning of list */
@@ -956,7 +956,7 @@ static void ed_marker_duplicate_apply(bContext *C)
 static int ed_marker_duplicate_exec(bContext *C, wmOperator *op)
 {
        ed_marker_duplicate_apply(C);
-       ed_marker_move_exec(C, op);     /* assumes frs delta set */
+       ed_marker_move_exec(C, op); /* assumes frs delta set */
        
        return OPERATOR_FINISHED;
        
@@ -988,7 +988,7 @@ static void MARKER_OT_duplicate(wmOperatorType *ot)
        ot->cancel = ed_marker_move_cancel;
        
        /* flags */
-       ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO;
+       ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
        
        /* rna storage */
        RNA_def_int(ot->srna, "frames", 0, INT_MIN, INT_MAX, "Frames", "", INT_MIN, INT_MAX);
@@ -1000,9 +1000,9 @@ static void MARKER_OT_duplicate(wmOperatorType *ot)
 static void select_timeline_marker_frame(ListBase *markers, int frame, unsigned char shift)
 {
        TimeMarker *marker;
-       int select=0;
+       int select = 0;
        
-       for (marker= markers->first; marker; marker= marker->next) {
+       for (marker = markers->first; marker; marker = marker->next) {
                /* if Shift is not set, then deselect Markers */
                if (!shift) marker->flag &= ~SELECT;
                
@@ -1019,20 +1019,20 @@ static void select_timeline_marker_frame(ListBase *markers, int frame, unsigned
 
 static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera)
 {
-       ListBase *markers= ED_context_get_markers(C);
-       View2D *v2d= UI_view2d_fromcontext(C);
+       ListBase *markers = ED_context_get_markers(C);
+      &n