[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46430] trunk/blender/source/blender/ editors/space_nla: style cleanup: nla

Campbell Barton ideasman42 at gmail.com
Tue May 8 20:05:58 CEST 2012


Revision: 46430
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46430
Author:   campbellbarton
Date:     2012-05-08 18:05:57 +0000 (Tue, 08 May 2012)
Log Message:
-----------
style cleanup: nla

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_nla/nla_buttons.c
    trunk/blender/source/blender/editors/space_nla/nla_channels.c
    trunk/blender/source/blender/editors/space_nla/nla_draw.c
    trunk/blender/source/blender/editors/space_nla/nla_edit.c
    trunk/blender/source/blender/editors/space_nla/nla_intern.h
    trunk/blender/source/blender/editors/space_nla/nla_ops.c
    trunk/blender/source/blender/editors/space_nla/nla_select.c
    trunk/blender/source/blender/editors/space_nla/space_nla.c

Modified: trunk/blender/source/blender/editors/space_nla/nla_buttons.c
===================================================================
--- trunk/blender/source/blender/editors/space_nla/nla_buttons.c	2012-05-08 18:05:44 UTC (rev 46429)
+++ trunk/blender/source/blender/editors/space_nla/nla_buttons.c	2012-05-08 18:05:57 UTC (rev 46430)
@@ -62,13 +62,13 @@
 #include "UI_interface.h"
 #include "UI_resources.h"
 
-#include "nla_intern.h"	// own include
+#include "nla_intern.h" // own include
 
 
 /* ******************* nla editor space & buttons ************** */
 
-#define B_NOP		1
-#define B_REDR		2
+#define B_NOP       1
+#define B_REDR      2
 
 /* -------------- */
 
@@ -81,16 +81,16 @@
 	}
 	
 	/* default for now */
-	WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, NULL);
-	WM_event_add_notifier(C, NC_SCENE|ND_TRANSFORM, NULL);
+	WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
+	WM_event_add_notifier(C, NC_SCENE | ND_TRANSFORM, NULL);
 }
 
 static int nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA *nlt_ptr, PointerRNA *strip_ptr)
 {
 	bAnimContext ac;
-	bAnimListElem *ale= NULL;
+	bAnimListElem *ale = NULL;
 	ListBase anim_data = {NULL, NULL};
-	short found=0;
+	short found = 0;
 	int filter;
 	
 	/* for now, only draw if we could init the anim-context info (necessary for all animation-related tools) 
@@ -103,15 +103,15 @@
 	 *	- we need the channels flag to get the active AnimData block when there are no NLA Tracks
 	 */
 	// XXX: double-check active!
-	filter= (ANIMFILTER_DATA_VISIBLE|ANIMFILTER_LIST_VISIBLE|ANIMFILTER_ACTIVE|ANIMFILTER_LIST_CHANNELS);
+	filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_ACTIVE | ANIMFILTER_LIST_CHANNELS);
 	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) {
 		switch (ale->type) {
 			case ANIMTYPE_NLATRACK: /* NLA Track - The primary data type which should get caught */
 			{
-				NlaTrack *nlt= (NlaTrack *)ale->data;
-				AnimData *adt= ale->adt;
+				NlaTrack *nlt = (NlaTrack *)ale->data;
+				AnimData *adt = ale->adt;
 				
 				/* found it, now set the pointers */
 				if (adt_ptr) {
@@ -124,18 +124,18 @@
 				}
 				if (strip_ptr) {
 					/* NLA-Strip pointer */
-					NlaStrip *strip= BKE_nlastrip_find_active(nlt);
+					NlaStrip *strip = BKE_nlastrip_find_active(nlt);
 					RNA_pointer_create(ale->id, &RNA_NlaStrip, strip, strip_ptr);
 				}
 				
-				found= 1;
+				found = 1;
 			}
-				break;
+			break;
 				
-			case ANIMTYPE_SCENE: 	/* Top-Level Widgets doubling up as datablocks */
+			case ANIMTYPE_SCENE:    /* Top-Level Widgets doubling up as datablocks */
 			case ANIMTYPE_OBJECT:
 			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:
@@ -156,11 +156,11 @@
 						/* set found status to -1, since setting to 1 would break the loop 
 						 * and potentially skip an active NLA-Track in some cases...
 						 */
-						found= -1;
+						found = -1;
 					}
 				}
 			}	
-				break;
+			break;
 		}
 		
 		if (found > 0)
@@ -208,7 +208,7 @@
 	if (ptr.data == NULL)
 		return 0;
 	
-	strip= ptr.data;
+	strip = ptr.data;
 	return (strip->type == NLASTRIP_TYPE_CLIP);
 }
 
@@ -222,7 +222,7 @@
 	if (ptr.data == NULL)
 		return 0;
 	
-	strip= ptr.data;
+	strip = ptr.data;
 	
 	if (strip->type == NLASTRIP_TYPE_SOUND)
 		return 0;
@@ -233,11 +233,11 @@
 /* -------------- */
 
 /* active AnimData */
-static void nla_panel_animdata (const bContext *C, Panel *pa)
+static void nla_panel_animdata(const bContext *C, Panel *pa)
 {
 	PointerRNA adt_ptr;
 	/* AnimData *adt; */
-	uiLayout *layout= pa->layout;
+	uiLayout *layout = pa->layout;
 	uiLayout *row;
 	uiBlock *block;
 	
@@ -247,32 +247,32 @@
 
 	/* adt= adt_ptr.data; */
 	
-	block= uiLayoutGetBlock(layout);
+	block = uiLayoutGetBlock(layout);
 	uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
 	
 	/* Active Action Properties ------------------------------------- */
 	/* action */
-	row= uiLayoutRow(layout, 1);
-		uiTemplateID(row, (bContext *)C, &adt_ptr, "action", "ACTION_OT_new", NULL, NULL /*"ACTION_OT_unlink"*/); // XXX: need to make these operators
+	row = uiLayoutRow(layout, 1);
+	uiTemplateID(row, (bContext *)C, &adt_ptr, "action", "ACTION_OT_new", NULL, NULL /*"ACTION_OT_unlink"*/);     // XXX: need to make these operators
 	
 	/* extrapolation */
-	row= uiLayoutRow(layout, 1);
-		uiItemR(row, &adt_ptr, "action_extrapolation", 0, NULL, ICON_NONE);
+	row = uiLayoutRow(layout, 1);
+	uiItemR(row, &adt_ptr, "action_extrapolation", 0, NULL, ICON_NONE);
 	
 	/* blending */
-	row= uiLayoutRow(layout, 1);
-		uiItemR(row, &adt_ptr, "action_blend_type", 0, NULL, ICON_NONE);
+	row = uiLayoutRow(layout, 1);
+	uiItemR(row, &adt_ptr, "action_blend_type", 0, NULL, ICON_NONE);
 		
 	/* influence */
-	row= uiLayoutRow(layout, 1);
-		uiItemR(row, &adt_ptr, "action_influence", 0, NULL, ICON_NONE);
+	row = uiLayoutRow(layout, 1);
+	uiItemR(row, &adt_ptr, "action_influence", 0, NULL, ICON_NONE);
 }
 
 /* active NLA-Track */
-static void nla_panel_track (const bContext *C, Panel *pa)
+static void nla_panel_track(const bContext *C, Panel *pa)
 {
 	PointerRNA nlt_ptr;
-	uiLayout *layout= pa->layout;
+	uiLayout *layout = pa->layout;
 	uiLayout *row;
 	uiBlock *block;
 	
@@ -280,19 +280,19 @@
 	if (!nla_panel_context(C, NULL, &nlt_ptr, NULL))
 		return;
 	
-	block= uiLayoutGetBlock(layout);
+	block = uiLayoutGetBlock(layout);
 	uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
 	
 	/* Info - Active NLA-Context:Track ----------------------  */
-	row= uiLayoutRow(layout, 1);
-		uiItemR(row, &nlt_ptr, "name", 0, NULL, ICON_NLA);
+	row = uiLayoutRow(layout, 1);
+	uiItemR(row, &nlt_ptr, "name", 0, NULL, ICON_NLA);
 }
 
 /* generic settings for active NLA-Strip */
 static void nla_panel_properties(const bContext *C, Panel *pa)
 {
 	PointerRNA strip_ptr;
-	uiLayout *layout= pa->layout;
+	uiLayout *layout = pa->layout;
 	uiLayout *column, *row, *sub;
 	uiBlock *block;
 	short showEvalProps = 1;
@@ -300,20 +300,20 @@
 	if (!nla_panel_context(C, NULL, NULL, &strip_ptr))
 		return;
 	
-	block= uiLayoutGetBlock(layout);
+	block = uiLayoutGetBlock(layout);
 	uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
 	
 	/* Strip Properties ------------------------------------- */
 	/* strip type */
-	row= uiLayoutColumn(layout, 1);
-		uiItemR(row, &strip_ptr, "name", 0, NULL, ICON_NLA); // XXX icon?
-		uiItemR(row, &strip_ptr, "type", 0, NULL, ICON_NONE);
+	row = uiLayoutColumn(layout, 1);
+	uiItemR(row, &strip_ptr, "name", 0, NULL, ICON_NLA);     // XXX icon?
+	uiItemR(row, &strip_ptr, "type", 0, NULL, ICON_NONE);
 	
 	/* strip extents */
-	column= uiLayoutColumn(layout, 1);
-		uiItemL(column, "Strip Extents:", ICON_NONE);
-		uiItemR(column, &strip_ptr, "frame_start", 0, NULL, ICON_NONE);
-		uiItemR(column, &strip_ptr, "frame_end", 0, NULL, ICON_NONE);
+	column = uiLayoutColumn(layout, 1);
+	uiItemL(column, "Strip Extents:", ICON_NONE);
+	uiItemR(column, &strip_ptr, "frame_start", 0, NULL, ICON_NONE);
+	uiItemR(column, &strip_ptr, "frame_end", 0, NULL, ICON_NONE);
 	
 	/* Evaluation-Related Strip Properties ------------------ */
 	
@@ -324,31 +324,31 @@
 	/* only show if allowed to... */
 	if (showEvalProps) {
 		/* extrapolation */
-		row= uiLayoutRow(layout, 1);
-			uiItemR(row, &strip_ptr, "extrapolation", 0, NULL, ICON_NONE);
+		row = uiLayoutRow(layout, 1);
+		uiItemR(row, &strip_ptr, "extrapolation", 0, NULL, ICON_NONE);
 		
 		/* blending */
-		row= uiLayoutRow(layout, 1);
-			uiItemR(row, &strip_ptr, "blend_type", 0, NULL, ICON_NONE);
+		row = uiLayoutRow(layout, 1);
+		uiItemR(row, &strip_ptr, "blend_type", 0, NULL, ICON_NONE);
 			
 		/* blend in/out + autoblending
 		 *	- blend in/out can only be set when autoblending is off
 		 */
-		column= uiLayoutColumn(layout, 1);
-			uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_influence")==0); 
-			uiItemR(column, &strip_ptr, "use_auto_blend", 0, NULL, ICON_NONE); // XXX as toggle?
+		column = uiLayoutColumn(layout, 1);
+		uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_influence") == 0);
+		uiItemR(column, &strip_ptr, "use_auto_blend", 0, NULL, ICON_NONE);     // XXX as toggle?
+
+		sub = uiLayoutColumn(column, 1);
+		uiLayoutSetActive(sub, RNA_boolean_get(&strip_ptr, "use_auto_blend") == 0);
+		uiItemR(sub, &strip_ptr, "blend_in", 0, NULL, ICON_NONE);
+		uiItemR(sub, &strip_ptr, "blend_out", 0, NULL, ICON_NONE);
 			
-			sub= uiLayoutColumn(column, 1);
-				uiLayoutSetActive(sub, RNA_boolean_get(&strip_ptr, "use_auto_blend")==0); 
-				uiItemR(sub, &strip_ptr, "blend_in", 0, NULL, ICON_NONE);
-				uiItemR(sub, &strip_ptr, "blend_out", 0, NULL, ICON_NONE);
-			
 		/* settings */
-		column= uiLayoutColumn(layout, 1);
-			uiLayoutSetActive(column, !(RNA_boolean_get(&strip_ptr, "use_animated_influence") || RNA_boolean_get(&strip_ptr, "use_animated_time"))); 
-			uiItemL(column, "Playback Settings:", ICON_NONE);
-			uiItemR(column, &strip_ptr, "mute", 0, NULL, ICON_NONE);
-			uiItemR(column, &strip_ptr, "use_reverse", 0, NULL, ICON_NONE);
+		column = uiLayoutColumn(layout, 1);
+		uiLayoutSetActive(column, !(RNA_boolean_get(&strip_ptr, "use_animated_influence") || RNA_boolean_get(&strip_ptr, "use_animated_time")));
+		uiItemL(column, "Playback Settings:", ICON_NONE);
+		uiItemR(column, &strip_ptr, "mute", 0, NULL, ICON_NONE);
+		uiItemR(column, &strip_ptr, "use_reverse", 0, NULL, ICON_NONE);
 	}
 }
 
@@ -357,7 +357,7 @@
 static void nla_panel_actclip(const bContext *C, Panel *pa)
 {
 	PointerRNA strip_ptr;
-	uiLayout *layout= pa->layout;
+	uiLayout *layout = pa->layout;
 	uiLayout *column, *row;
 	uiBlock *block;
 
@@ -365,35 +365,35 @@
 	if (!nla_panel_context(C, NULL, NULL, &strip_ptr))
 		return;
 	
-	block= uiLayoutGetBlock(layout);
+	block = uiLayoutGetBlock(layout);
 	uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
 		
 	/* Strip Properties ------------------------------------- */
 	/* action pointer */
-	row= uiLayoutRow(layout, 1);
-		uiItemR(row, &strip_ptr, "action", 0, NULL, ICON_ACTION);
+	row = uiLayoutRow(layout, 1);
+	uiItemR(row, &strip_ptr, "action", 0, NULL, ICON_ACTION);
 		
 	/* action extents */

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list