Code cleanup - missing indention be gone!
authorJoshua Leung <aligorith@gmail.com>
Fri, 20 Jul 2012 12:29:56 +0000 (12:29 +0000)
committerJoshua Leung <aligorith@gmail.com>
Fri, 20 Jul 2012 12:29:56 +0000 (12:29 +0000)
(And fixed some incorrect comments)

source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_filter.c

index fe5558c6f537527f254b8e66762c053b13e24677..d4b30814403f1796c896798416efef230c8f4bd3 100644 (file)
@@ -2507,11 +2507,11 @@ static bAnimChannelType ACF_GPL =
        acf_generic_channel_backdrop,   /* backdrop */
        acf_generic_indention_flexible, /* indent level */
        acf_generic_group_offset,       /* offset */
-
+       
        acf_gpl_name,                   /* name */
        acf_gpl_name_prop,              /* name prop */
        NULL,                           /* icon */
-
+       
        acf_gpl_setting_valid,          /* has setting */
        acf_gpl_setting_flag,           /* flag for setting */
        acf_gpl_setting_ptr             /* pointer for setting */
@@ -2541,7 +2541,7 @@ static short acf_mask_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *UNU
                case ACHANNEL_SETTING_SELECT:
                case ACHANNEL_SETTING_EXPAND:
                        return 1;
-
+               
                default:
                        return 0;
        }
@@ -2552,15 +2552,15 @@ static int acf_mask_setting_flag(bAnimContext *UNUSED(ac), int setting, short *n
 {
        /* clear extra return data first */
        *neg = 0;
-
+       
        switch (setting) {
                case ACHANNEL_SETTING_SELECT: /* selected */
                        return AGRP_SELECTED;
-
+               
                case ACHANNEL_SETTING_EXPAND: /* expanded */
                        return MASK_ANIMF_EXPAND;
        }
-
+       
        /* this shouldn't happen */
        return 0;
 }
@@ -2569,7 +2569,7 @@ static int acf_mask_setting_flag(bAnimContext *UNUSED(ac), int setting, short *n
 static void *acf_mask_setting_ptr(bAnimListElem *ale, int UNUSED(setting), short *type)
 {
        Mask *mask = (Mask *)ale->data;
-
+       
        /* all flags are just in mask->flag for now... */
        return GET_ACF_FLAG_PTR(mask->flag, type);
 }
@@ -2578,16 +2578,16 @@ static void *acf_mask_setting_ptr(bAnimListElem *ale, int UNUSED(setting), short
 static bAnimChannelType ACF_MASKDATA =
 {
        "Mask Datablock",            /* type name */
-
+       
        acf_mask_color,                  /* backdrop color */
        acf_group_backdrop,             /* backdrop */
        acf_generic_indention_0,        /* indent level */
        acf_generic_group_offset,       /* offset */
-
+       
        acf_generic_idblock_name,       /* name */
        acf_generic_idfill_nameprop,    /* name prop */
        acf_mask_icon,                   /* icon */
-
+       
        acf_mask_setting_valid,          /* has setting */
        acf_mask_setting_flag,           /* flag for setting */
        acf_mask_setting_ptr             /* pointer for setting */
@@ -2599,7 +2599,7 @@ static bAnimChannelType ACF_MASKDATA =
 static void acf_masklay_name(bAnimListElem *ale, char *name)
 {
        MaskLayer *masklay = (MaskLayer *)ale->data;
-
+       
        if (masklay && name)
                BLI_strncpy(name, masklay->name, ANIM_CHAN_NAME_SIZE);
 }
@@ -2610,7 +2610,7 @@ static short acf_masklay_name_prop(bAnimListElem *ale, PointerRNA *ptr, Property
        if (ale->data) {
                RNA_pointer_create(ale->id, &RNA_MaskLayer, ale->data, ptr);
                *prop = RNA_struct_name_property(ptr->type);
-
+               
                return (*prop != NULL);
        }
 
@@ -2625,7 +2625,7 @@ static short acf_masklay_setting_valid(bAnimContext *UNUSED(ac), bAnimListElem *
                case ACHANNEL_SETTING_EXPAND: /* mask layers are more like F-Curves than groups */
                case ACHANNEL_SETTING_VISIBLE: /* graph editor only */
                        return 0;
-
+               
                /* always available */
                default:
                        return 1;
@@ -2637,18 +2637,18 @@ static int acf_masklay_setting_flag(bAnimContext *UNUSED(ac), int setting, short
 {
        /* clear extra return data first */
        *neg = 0;
-
+       
        switch (setting) {
                case ACHANNEL_SETTING_SELECT: /* selected */
                        return MASK_LAYERFLAG_SELECT;
-
+               
 //             case ACHANNEL_SETTING_MUTE: /* muted */
 //                     return GP_LAYER_HIDE;
-
+               
                case ACHANNEL_SETTING_PROTECT: /* protected */
                        // *neg = 1; - if we change this to edtiability
                        return MASK_LAYERFLAG_LOCKED;
-
+               
                default: /* unsupported */
                        return 0;
        }
@@ -2702,17 +2702,17 @@ static void ANIM_init_channel_typeinfo_data(void)
                animchannelTypeInfo[type++] = NULL;              /* None */
                animchannelTypeInfo[type++] = NULL;              /* AnimData */
                animchannelTypeInfo[type++] = NULL;              /* Special */
-
+               
                animchannelTypeInfo[type++] = &ACF_SUMMARY;      /* Motion Summary */
-
+               
                animchannelTypeInfo[type++] = &ACF_SCENE;        /* Scene */
                animchannelTypeInfo[type++] = &ACF_OBJECT;       /* Object */
                animchannelTypeInfo[type++] = &ACF_GROUP;        /* Group */
                animchannelTypeInfo[type++] = &ACF_FCURVE;       /* F-Curve */
-
+               
                animchannelTypeInfo[type++] = &ACF_FILLACTD;     /* Object Action Expander */
                animchannelTypeInfo[type++] = &ACF_FILLDRIVERS;  /* Drivers Expander */
-
+               
                animchannelTypeInfo[type++] = &ACF_DSMAT;        /* Material Channel */
                animchannelTypeInfo[type++] = &ACF_DSLAM;        /* Lamp Channel */
                animchannelTypeInfo[type++] = &ACF_DSCAM;        /* Camera Channel */
@@ -2727,15 +2727,15 @@ static void ANIM_init_channel_typeinfo_data(void)
                animchannelTypeInfo[type++] = &ACF_DSTEX;        /* Texture Channel */
                animchannelTypeInfo[type++] = &ACF_DSLAT;        /* Lattice Channel */
                animchannelTypeInfo[type++] = &ACF_DSSPK;        /* Speaker Channel */
-
+               
                animchannelTypeInfo[type++] = &ACF_SHAPEKEY;     /* ShapeKey */
-
+               
                animchannelTypeInfo[type++] = &ACF_GPD;          /* Grease Pencil Datablock */
                animchannelTypeInfo[type++] = &ACF_GPL;          /* Grease Pencil Layer */
-
+               
                animchannelTypeInfo[type++] = &ACF_MASKDATA;     /* Mask Datablock */
                animchannelTypeInfo[type++] = &ACF_MASKLAYER;    /* Mask Layer */
-
+               
                // TODO: these types still need to be implemented!!!
                // probably need a few extra flags for these special cases...
                animchannelTypeInfo[type++] = NULL;              /* NLA Track */
index 6144cc4ecc1a4223df6ed8db40fba0077d9cff6a..1dcb9f79a0953e4de02ec7ac21ab4f06b5b3c79c 100644 (file)
@@ -417,16 +417,16 @@ short ANIM_animdata_get_context(const bContext *C, bAnimContext *ac)
  *
  * For this to work correctly, a standard set of data needs to be available within the scope that this
  * gets called in: 
- *     - ListBase anim_data;
- *     - bDopeSheet *ads;
- *     - bAnimListElem *ale;
+ *  - ListBase anim_data;
+ *  - bDopeSheet *ads;
+ *  - bAnimListElem *ale;
  *  - size_t items;
  *
  *  - id: ID block which should have an AnimData pointer following it immediately, to use
- *     - adtOk: line or block of code to execute for AnimData-blocks case (usually ANIMDATA_ADD_ANIMDATA)
- *     - nlaOk: line or block of code to execute for NLA tracks+strips case
- *     - driversOk: line or block of code to execute for Drivers case
- *     - keysOk: line or block of code for Keyframes case
+ *  - adtOk: line or block of code to execute for AnimData-blocks case (usually ANIMDATA_ADD_ANIMDATA)
+ *  - nlaOk: line or block of code to execute for NLA tracks+strips case
+ *  - driversOk: line or block of code to execute for Drivers case
+ *  - keysOk: line or block of code for Keyframes case
  *
  * The checks for the various cases are as follows:
  *     0) top level: checks for animdata and also that all the F-Curves for the block will be visible
@@ -1316,6 +1316,7 @@ static size_t animdata_filter_shapekey(bAnimContext *ac, ListBase *anim_data, Ke
        return items;
 }
 
+/* Helper for Grease Pencil - layers within a datablock */
 static size_t animdata_filter_gpencil_data(ListBase *anim_data, bGPdata *gpd, int filter_mode)
 {
        bGPDlayer *gpl;
@@ -1382,6 +1383,7 @@ static size_t animdata_filter_gpencil(ListBase *anim_data, void *UNUSED(data), i
        return items;
 }
 
+/* Helper for Mask Editing - mask layers */
 static size_t animdata_filter_mask_data(ListBase *anim_data, Mask *mask, const int filter_mode)
 {
        MaskLayer *masklay_act = BKE_mask_layer_active(mask);
@@ -1398,18 +1400,6 @@ static size_t animdata_filter_mask_data(ListBase *anim_data, Mask *mask, const i
                                if (!(filter_mode & ANIMFILTER_ACTIVE) || (masklay_act == masklay)) {
                                        /* add to list */
                                        ANIMCHANNEL_NEW_CHANNEL(masklay, ANIMTYPE_MASKLAYER, mask);
-
-
-//                                     if (filter_mode & ANIMFILTER_TMP_PEEK)
-//                                             return 1;
-//                                     else {
-//                                             bAnimListElem *ale = make_new_animlistelem(masklay, channel_type, (ID *)owner_id);
-//                                             if (ale) {
-//                                                     BLI_addtail(anim_data, ale);
-//                                                     items ++;
-//                                             }
-//                                     }
-
                                }
 //                     }
                }
@@ -1418,28 +1408,29 @@ static size_t animdata_filter_mask_data(ListBase *anim_data, Mask *mask, const i
        return items;
 }
 
+/* Grab all mask data */
 static size_t animdata_filter_mask(ListBase *anim_data, void *UNUSED(data), int filter_mode)
 {
        Mask *mask;
        size_t items = 0;
-
-       /* for now, grab grease pencil datablocks directly from main */
+       
+       /* for now, grab mask datablocks directly from main */
        // XXX: this is not good...
        for (mask = G.main->mask.first; mask; mask = mask->id.next) {
                ListBase tmp_data = {NULL, NULL};
                size_t tmp_items = 0;
-
-               /* only show if gpd is used by something... */
+               
+               /* only show if mask is used by something... */
                if (ID_REAL_USERS(mask) < 1)
                        continue;
-
-               /* add gpencil animation channels */
+               
+               /* add mask animation channels */
                BEGIN_ANIMFILTER_SUBCHANNELS(EXPANDED_MASK(mask))
                {
                        tmp_items += animdata_filter_mask_data(&tmp_data, mask, filter_mode);
                }
                END_ANIMFILTER_SUBCHANNELS;
-
+               
                /* did we find anything? */
                if (tmp_items) {
                        /* include data-expand widget first */
@@ -1447,14 +1438,14 @@ static size_t animdata_filter_mask(ListBase *anim_data, void *UNUSED(data), int
                                /* add gpd as channel too (if for drawing, and it has layers) */
                                ANIMCHANNEL_NEW_CHANNEL(mask, ANIMTYPE_MASKDATABLOCK, NULL);
                        }
-
+                       
                        /* now add the list of collected channels */
                        BLI_movelisttolist(anim_data, &tmp_data);
                        BLI_assert((tmp_data.first == tmp_data.last) && (tmp_data.first == NULL));
                        items += tmp_items;
                }
        }
-
+       
        /* return the number of items added to the list */
        return items;
 }
@@ -2386,7 +2377,7 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mo
                                        items += animfilter_action(ac, anim_data, ads, data, filter_mode, (ID *)obact);
                        }
                        break;
-
+                       
                        case ANIMCONT_SHAPEKEY: /* 'ShapeKey Editor' */
                        {
                                /* the check for the DopeSheet summary is included here since the summary works here too */
@@ -2401,14 +2392,14 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, int filter_mo
                                        items = animdata_filter_gpencil(anim_data, data, filter_mode);
                        }
                        break;
-
+                       
                        case ANIMCONT_MASK:
                        {
                                if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
                                        items = animdata_filter_mask(anim_data, data, filter_mode);
                        }
                        break;
-
+                       
                        case ANIMCONT_DOPESHEET: /* 'DopeSheet Editor' */
                        {
                                /* the DopeSheet editor is the primary place where the DopeSheet summaries are useful */