[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26204] trunk/blender/source/blender: Durian Request: Expansion of Action Groups not linked between DopeSheet editors and the Graph Editor

Joshua Leung aligorith at gmail.com
Sat Jan 23 04:04:48 CET 2010


Revision: 26204
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26204
Author:   aligorith
Date:     2010-01-23 04:04:37 +0100 (Sat, 23 Jan 2010)

Log Message:
-----------
Durian Request: Expansion of Action Groups not linked between DopeSheet editors and the Graph Editor

Action Groups can now be expanded/collapsed in DopeSheet editors without the same thing happening in the Graph Editor, and visa versa. 

This should help improve the workflow, since the channel lists are generally kept more compact in the DopeSheet, while they are more expanded in the Graph Editor, so less time is spent expanding/collapsing stuff. Also this should hopefully alleviate some of the errors from accidentally deleting and then having to restore channels that were not intended to be deleted.

Also, switched the order of the expand/collapse hotkeys (in the channels list region) for channels so that Ctrl +/- now expands/collapses selected channels only, while +/- expands/collapses all channels. This should make it more convenient to quickly open up all groups to select F-Curves for the Graph Editor.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/animation/anim_channels_defines.c
    trunk/blender/source/blender/editors/animation/anim_channels_edit.c
    trunk/blender/source/blender/editors/animation/anim_filter.c
    trunk/blender/source/blender/editors/include/ED_anim_api.h
    trunk/blender/source/blender/editors/space_action/action_select.c
    trunk/blender/source/blender/editors/space_graph/graph_select.c
    trunk/blender/source/blender/editors/space_nla/nla_channels.c
    trunk/blender/source/blender/editors/space_nla/nla_select.c
    trunk/blender/source/blender/makesdna/DNA_action_types.h

Modified: trunk/blender/source/blender/editors/animation/anim_channels_defines.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_channels_defines.c	2010-01-23 01:02:53 UTC (rev 26203)
+++ trunk/blender/source/blender/editors/animation/anim_channels_defines.c	2010-01-23 03:04:37 UTC (rev 26204)
@@ -429,7 +429,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_summary_setting_flag(int setting, short *neg)
+static int acf_summary_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	if (setting == ACHANNEL_SETTING_EXPAND) {
 		/* expanded */
@@ -512,7 +512,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_scene_setting_flag(int setting, short *neg)
+static int acf_scene_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -631,7 +631,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_object_setting_flag(int setting, short *neg)
+static int acf_object_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -754,7 +754,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_group_setting_flag(int setting, short *neg)
+static int acf_group_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -764,7 +764,15 @@
 			return AGRP_SELECTED;
 			
 		case ACHANNEL_SETTING_EXPAND: /* expanded */
-			return AGRP_EXPANDED;
+		{
+			/* NOTE: Graph Editor uses a different flag to everywhere else for this,
+			 * allowing different collapsing of groups there, since sharing the flag
+			 * proved to be a hazard for workflows...
+			 */
+			return (ac->spacetype == SPACE_IPO) ? 
+						AGRP_EXPANDED_G :	/* Graph Editor case */
+						AGRP_EXPANDED;		/* DopeSheet and elsewhere */
+		}
 			
 		case ACHANNEL_SETTING_MUTE: /* muted */
 			return AGRP_MUTED;
@@ -842,7 +850,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_fcurve_setting_flag(int setting, short *neg)
+static int acf_fcurve_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -914,7 +922,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_fillactd_setting_flag(int setting, short *neg)
+static int acf_fillactd_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1001,7 +1009,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_filldrivers_setting_flag(int setting, short *neg)
+static int acf_filldrivers_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1063,7 +1071,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_fillmatd_setting_flag(int setting, short *neg)
+static int acf_fillmatd_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1107,7 +1115,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_fillpartd_setting_flag(int setting, short *neg)
+static int acf_fillpartd_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1152,7 +1160,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dsmat_setting_flag(int setting, short *neg)
+static int acf_dsmat_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1226,7 +1234,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dslam_setting_flag(int setting, short *neg)
+static int acf_dslam_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1300,7 +1308,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dscam_setting_flag(int setting, short *neg)
+static int acf_dscam_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1384,7 +1392,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dscur_setting_flag(int setting, short *neg)
+static int acf_dscur_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1458,7 +1466,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dsskey_setting_flag(int setting, short *neg)
+static int acf_dsskey_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1532,7 +1540,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dswor_setting_flag(int setting, short *neg)
+static int acf_dswor_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1606,7 +1614,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dspart_setting_flag(int setting, short *neg)
+static int acf_dspart_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1680,7 +1688,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dsmball_setting_flag(int setting, short *neg)
+static int acf_dsmball_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1754,7 +1762,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dsarm_setting_flag(int setting, short *neg)
+static int acf_dsarm_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1828,7 +1836,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dsntree_setting_flag(int setting, short *neg)
+static int acf_dsntree_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -1902,7 +1910,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_dsmesh_setting_flag(int setting, short *neg)
+static int acf_dsmesh_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -2000,7 +2008,7 @@
 }
 
 /* get the appropriate flag(s) for the setting when it is valid  */
-static int acf_shapekey_setting_flag(int setting, short *neg)
+static int acf_shapekey_setting_flag(bAnimContext *ac, int setting, short *neg)
 {
 	/* clear extra return data first */
 	*neg= 0;
@@ -2267,7 +2275,7 @@
 		int flag;
 		void *ptr;
 		
-		flag= acf->setting_flag(setting, &negflag);
+		flag= acf->setting_flag(ac, setting, &negflag);
 		ptr= acf->setting_ptr(ale, setting, &ptrsize);
 		
 		/* check if flag is enabled */
@@ -2345,7 +2353,7 @@
 		int flag;
 		void *ptr;
 		
-		flag= acf->setting_flag(setting, &negflag);
+		flag= acf->setting_flag(ac, setting, &negflag);
 		ptr= acf->setting_ptr(ale, setting, &ptrsize);
 		
 		/* check if flag is enabled */
@@ -2691,7 +2699,7 @@
 	uiBut *but = NULL;
 	
 	/* get the flag and the pointer to that flag */
-	flag= acf->setting_flag(setting, &negflag);
+	flag= acf->setting_flag(ac, setting, &negflag);
 	ptr= acf->setting_ptr(ale, setting, &ptrsize);
 	enabled= ANIM_channel_setting_get(ac, ale, setting);
 	

Modified: trunk/blender/source/blender/editors/animation/anim_channels_edit.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_channels_edit.c	2010-01-23 01:02:53 UTC (rev 26203)
+++ trunk/blender/source/blender/editors/animation/anim_channels_edit.c	2010-01-23 03:04:37 UTC (rev 26204)
@@ -205,7 +205,7 @@
  *	- test: check if deselecting instead of selecting
  *	- sel: eAnimChannels_SetFlag;
  */
-void ANIM_deselect_anim_channels (void *data, short datatype, short test, short sel)
+void ANIM_deselect_anim_channels (bAnimContext *ac, void *data, short datatype, short test, short sel)
 {
 	ListBase anim_data = {NULL, NULL};
 	bAnimListElem *ale;
@@ -213,7 +213,7 @@
 	
 	/* filter data */
 	filter= ANIMFILTER_VISIBLE|ANIMFILTER_CHANNELS;
-	ANIM_animdata_filter(NULL, &anim_data, filter, data, datatype);
+	ANIM_animdata_filter(ac, &anim_data, filter, data, datatype);
 	
 	/* See if we should be selecting or deselecting */
 	if (test) {
@@ -1368,7 +1368,7 @@
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 	
 	/* props */
-	RNA_def_boolean(ot->srna, "all", 0, "All", "Expand all channels (not just selected ones)");
+	RNA_def_boolean(ot->srna, "all", 1, "All", "Expand all channels (not just selected ones)");
 }
 
 /* ********************** Collapse Channels Operator *********************** */
@@ -1410,7 +1410,7 @@
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 	
 	/* props */
-	RNA_def_boolean(ot->srna, "all", 0, "All", "Collapse all channels (not just selected ones)");
+	RNA_def_boolean(ot->srna, "all", 1, "All", "Collapse all channels (not just selected ones)");
 }
 
 /* ********************** Select All Operator *********************** */
@@ -1425,9 +1425,9 @@
 		
 	/* 'standard' behaviour - check if selected, then apply relevant selection */
 	if (RNA_boolean_get(op->ptr, "invert"))
-		ANIM_deselect_anim_channels(ac.data, ac.datatype, 0, ACHANNEL_SETFLAG_TOGGLE);
+		ANIM_deselect_anim_channels(&ac, ac.data, ac.datatype, 0, ACHANNEL_SETFLAG_TOGGLE);
 	else
-		ANIM_deselect_anim_channels(ac.data, ac.datatype, 1, ACHANNEL_SETFLAG_ADD);
+		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_SELECT, NULL);
@@ -1676,7 +1676,7 @@
 				}
 				else {
 					/* select AnimData block by itself */
-					ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
+					ANIM_deselect_anim_channels(ac, ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR);
 					ale->adt->flag |= ADT_UI_SELECTED;
 				}
 				
@@ -1703,7 +1703,7 @@
 				FCurve *fcu;
 				
 				/* deselect all other channels */

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list