[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50653] trunk/blender/source/blender/ editors/animation: Code cleanup - Remove/ update outdated comments and whitespace tweaks

Joshua Leung aligorith at gmail.com
Sun Sep 16 13:19:37 CEST 2012


Revision: 50653
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50653
Author:   aligorith
Date:     2012-09-16 11:19:36 +0000 (Sun, 16 Sep 2012)
Log Message:
-----------
Code cleanup - Remove/update outdated comments and whitespace tweaks

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/anim_channels_defines.c
    trunk/blender/source/blender/editors/animation/anim_deps.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-09-16 10:39:19 UTC (rev 50652)
+++ trunk/blender/source/blender/editors/animation/anim_channels_defines.c	2012-09-16 11:19:36 UTC (rev 50653)
@@ -84,6 +84,7 @@
 /* size of indent steps */
 #define INDENT_STEP_SIZE    7
 
+/* size of string buffers used for animation channel displayed names */
 #define ANIM_CHAN_NAME_SIZE 256
 
 /* get the pointer used for some flag */
@@ -292,7 +293,7 @@
 		}
 	}
 	
-	// unknown
+	/* unknown */
 	return 0;
 }
 
@@ -422,7 +423,7 @@
 		BLI_strncpy(name, "DopeSheet Summary", ANIM_CHAN_NAME_SIZE);
 }
 
-// TODO: this is really a temp icon I think
+// FIXME: this is really a temp icon I think
 static int acf_summary_icon(bAnimListElem *UNUSED(ale))
 {
 	return ICON_BORDERMOVE;
@@ -601,7 +602,6 @@
 	Object *ob = base->object;
 	
 	/* icon depends on object-type */
-
 	switch (ob->type) {
 		case OB_LAMP:
 			return ICON_OUTLINER_OB_LAMP;
@@ -628,7 +628,6 @@
 		default:
 			return ICON_OBJECT_DATA;
 	}
-	
 }
 
 /* name for object */
@@ -2178,7 +2177,7 @@
 {
 	/* clear extra return data first */
 	*neg = 0;
-
+	
 	switch (setting) {
 		case ACHANNEL_SETTING_EXPAND: /* expanded */
 			return SPK_DS_EXPAND;
@@ -2202,10 +2201,10 @@
 static void *acf_dsspk_setting_ptr(bAnimListElem *ale, int setting, short *type)
 {
 	Speaker *spk = (Speaker *)ale->data;
-
+	
 	/* clear extra return data first */
 	*type = 0;
-
+	
 	switch (setting) {
 		case ACHANNEL_SETTING_EXPAND: /* expanded */
 			return GET_ACF_FLAG_PTR(spk->flag, type);
@@ -2477,7 +2476,7 @@
 			return GP_LAYER_HIDE;
 			
 		case ACHANNEL_SETTING_PROTECT: /* protected */
-			// *neg = 1; - if we change this to edtiability
+			// *neg = 1; - if we change this to editability
 			return GP_LAYER_LOCKED;
 			
 		default: /* unsupported */
@@ -2526,7 +2525,7 @@
 // TODO: just get this from RNA?
 static int acf_mask_icon(bAnimListElem *UNUSED(ale))
 {
-	return ICON_GREASEPENCIL; // MASK_TODO - need real icon
+	return ICON_MOD_MASK;
 }
 
 /* check if some setting exists for this channel */
@@ -2573,15 +2572,15 @@
 /* mask datablock type define */
 static bAnimChannelType ACF_MASKDATA =
 {
-	"Mask Datablock",            /* type name */
+	"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_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_generic_idblock_name,        /* name */
+	acf_generic_idfill_nameprop,     /* name prop */
 	acf_mask_icon,                   /* icon */
 	
 	acf_mask_setting_valid,          /* has setting */
@@ -2642,7 +2641,7 @@
 //			return GP_LAYER_HIDE;
 		
 		case ACHANNEL_SETTING_PROTECT: /* protected */
-			// *neg = 1; - if we change this to edtiability
+			// *neg = 1; - if we change this to editability
 			return MASK_LAYERFLAG_LOCKED;
 		
 		default: /* unsupported */
@@ -2654,7 +2653,7 @@
 static void *acf_masklay_setting_ptr(bAnimListElem *ale, int UNUSED(setting), short *type)
 {
 	MaskLayer *masklay = (MaskLayer *)ale->data;
-
+	
 	/* all flags are just in agrp->flag for now... */
 	return GET_ACF_FLAG_PTR(masklay->flag, type);
 }
@@ -2662,20 +2661,20 @@
 /* grease pencil layer type define */
 static bAnimChannelType ACF_MASKLAYER =
 {
-	"Mask Layer",                /* type name */
-
+	"Mask Layer",                   /* type name */
+	
 	acf_generic_channel_color,      /* backdrop color */
 	acf_generic_channel_backdrop,   /* backdrop */
 	acf_generic_indention_flexible, /* indent level */
 	acf_generic_group_offset,       /* offset */
-
-	acf_masklay_name,                   /* name */
-	acf_masklay_name_prop,              /* name prop */
+	
+	acf_masklay_name,               /* name */
+	acf_masklay_name_prop,          /* name prop */
 	NULL,                           /* icon */
-
-	acf_masklay_setting_valid,          /* has setting */
-	acf_masklay_setting_flag,           /* flag for setting */
-	acf_masklay_setting_ptr             /* pointer for setting */
+	
+	acf_masklay_setting_valid,      /* has setting */
+	acf_masklay_setting_flag,       /* flag for setting */
+	acf_masklay_setting_ptr         /* pointer for setting */
 };
 
 
@@ -2776,7 +2775,7 @@
 			acf->name(ale, name);
 		else
 			BLI_strncpy(name, "<No name>", sizeof(name));
-
+		
 		/* print type name + ui name */
 		printf("ChanType: <%s> Name: \"%s\"\n", acf->channel_type_name, name);
 	}
@@ -2920,7 +2919,6 @@
 #define RENAME_TEXT_WIDTH 100
 
 /* Draw the given channel */
-// TODO: make this use UI controls for the buttons
 void ANIM_channel_draw(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
 {
 	bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale);
@@ -3010,20 +3008,20 @@
 	/* TODO: when renaming, we might not want to draw this, especially if name happens to be longer than channel */
 	if (acf->name) {
 		char name[ANIM_CHAN_NAME_SIZE]; /* hopefully this will be enough! */
-
+		
 		/* set text color */
 		/* XXX: if active, highlight differently? */
 		if (selected)
 			UI_ThemeColor(TH_TEXT_HI);
 		else
 			UI_ThemeColor(TH_TEXT);
-
+		
 		/* get name */
 		acf->name(ale, name);
-
+		
 		offset += 3;
 		UI_DrawString(offset, ytext, name);
-
+		
 		/* draw red underline if channel is disabled */
 		if ((ale->type == ANIMTYPE_FCURVE) && (ale->flag & FCURVE_DISABLED)) {
 			/* FIXME: replace hardcoded color here, and check on extents! */
@@ -3153,7 +3151,6 @@
 	ads->renameIndex = 0;
 	
 	/* send notifiers */
-	// XXX: right notifier?
 	WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_RENAME, NULL);
 }
 
@@ -3437,7 +3434,6 @@
 	offset = 0;
 	
 	// TODO: when drawing sliders, make those draw instead of these toggles if not enough space
-	
 	if (v2d) {
 		short draw_sliders = 0;
 		

Modified: trunk/blender/source/blender/editors/animation/anim_deps.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_deps.c	2012-09-16 10:39:19 UTC (rev 50652)
+++ trunk/blender/source/blender/editors/animation/anim_deps.c	2012-09-16 11:19:36 UTC (rev 50653)
@@ -142,7 +142,6 @@
 		/* 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
 		 */
-		// TODO: if bone gets renamed, it would be best to be able to rename the group
 		if (ob->pose) {
 			bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, agrp->name);
 			bArmature *arm = ob->data;
@@ -319,7 +318,6 @@
 	FCurve *active_fcurve = NULL;
 	
 	/* get animation context info for filtering the channels */
-	// TODO: check on whether we need to set the area specially instead, since active area might not be ok?
 	if (ANIM_animdata_get_context(C, &ac) == 0)
 		return;
 	

Modified: trunk/blender/source/blender/editors/animation/anim_filter.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_filter.c	2012-09-16 10:39:19 UTC (rev 50652)
+++ trunk/blender/source/blender/editors/animation/anim_filter.c	2012-09-16 11:19:36 UTC (rev 50653)
@@ -163,30 +163,30 @@
 			
 			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;
-
+			
 			ac->datatype = ANIMCONT_GPENCIL;
 			ac->data = &saction->ads;
-
+			
 			ac->mode = saction->mode;
 			return 1;
-
-		case SACTCONT_MASK: /* Grease Pencil */ /* XXX review how this mode is handled... */
-			/* update scene-pointer (no need to check for pinning yet, as not implemented) */
+			
+		case SACTCONT_MASK: /* Mask */ /* XXX review how this mode is handled... */
 {
 			/* TODO, other methods to get the mask */
 			// Sequence *seq = BKE_sequencer_active_get(ac->scene);
 			//MovieClip *clip = ac->scene->clip;
 //			struct Mask *mask = seq ? seq->mask : NULL;
-
+			
+			/* update scene-pointer (no need to check for pinning yet, as not implemented) */
 			saction->ads.source = (ID *)ac->scene;
-
+			
 			ac->datatype = ANIMCONT_MASK;
 			ac->data = &saction->ads;
-
+			
 			ac->mode = saction->mode;
 			return 1;
 }
@@ -688,12 +688,12 @@
 			{
 				Speaker *spk = (Speaker *)data;
 				AnimData *adt = spk->adt;
-
+				
 				ale->flag = FILTER_SPK_OBJD(spk);
-
+				
 				ale->key_data = (adt) ? adt->action : NULL;
 				ale->datatype = ALE_ACT;
-
+				
 				ale->adt = BKE_animdata_from_id(data);
 			}
 			break;
@@ -824,18 +824,18 @@
 				ale->datatype = ALE_GPFRAME;
 			}
 			break;
-
+			
 			case ANIMTYPE_MASKLAYER:
 			{
 				MaskLayer *masklay = (MaskLayer *)data;
-
+				
 				ale->flag = masklay->flag;
-
+				
 				ale->key_data = NULL;
 				ale->datatype = ALE_MASKLAY;
 			}
 			break;
-
+			
 			case ANIMTYPE_NLATRACK:
 			{
 				NlaTrack *nlt = (NlaTrack *)data;
@@ -1138,7 +1138,6 @@
 	/* don't include anything from this action if it is linked in from another file,
 	 * and we're getting stuff for editing...
 	 */
-	// TODO: need a way of tagging other channels that may also be affected...
 	if ((filter_mode & ANIMFILTER_FOREDIT) && (act->id.lib))
 		return 0;
 		
@@ -1240,11 +1239,11 @@
 {
 	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;
-
+		
 		/* 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
 		 * different types of data expanders are required.
@@ -1265,7 +1264,7 @@
 			}
 		);
 	}
-
+	
 	return items;
 }
 
@@ -1283,7 +1282,6 @@
 		/* loop through the channels adding ShapeKeys as appropriate */
 		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;
 			

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list