[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49079] trunk/blender/source/blender/ editors/animation: Code cleanup - missing indention be gone!

Joshua Leung aligorith at gmail.com
Fri Jul 20 14:29:56 CEST 2012


Revision: 49079
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49079
Author:   aligorith
Date:     2012-07-20 12:29:56 +0000 (Fri, 20 Jul 2012)
Log Message:
-----------
Code cleanup - missing indention be gone!

(And fixed some incorrect comments)

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/anim_channels_defines.c
    trunk/blender/source/blender/editors/animation/anim_filter.c

Modified: trunk/blender/source/blender/editors/animation/anim_channels_defines.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_channels_defines.c	2012-07-20 12:18:45 UTC (rev 49078)
+++ trunk/blender/source/blender/editors/animation/anim_channels_defines.c	2012-07-20 12:29:56 UTC (rev 49079)
@@ -2507,11 +2507,11 @@
 	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 @@
 		case ACHANNEL_SETTING_SELECT:
 		case ACHANNEL_SETTING_EXPAND:
 			return 1;
-
+		
 		default:
 			return 0;
 	}
@@ -2552,15 +2552,15 @@
 {
 	/* 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 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 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 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 @@
 	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 @@
 		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 @@
 {
 	/* 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 @@
 		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 @@
 		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 */

Modified: trunk/blender/source/blender/editors/animation/anim_filter.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_filter.c	2012-07-20 12:18:45 UTC (rev 49078)
+++ trunk/blender/source/blender/editors/animation/anim_filter.c	2012-07-20 12:29:56 UTC (rev 49079)
@@ -417,16 +417,16 @@
  *
  * 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 @@
 	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 @@
 	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 @@
 				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 @@
 	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 @@
 				/* 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 @@
 					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 @@
 					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 */




More information about the Bf-blender-cvs mailing list