[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34612] trunk/blender: Action Editor UI Tweaks:

Joshua Leung aligorith at gmail.com
Tue Feb 1 23:21:44 CET 2011


Revision: 34612
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34612
Author:   aligorith
Date:     2011-02-01 22:21:43 +0000 (Tue, 01 Feb 2011)
Log Message:
-----------
Action Editor UI Tweaks:

While animating, I realised that actually the 'only selected' and
'include hidden' DopeSheet filtering options are also useful in the
Action Editor, especially while tweaking the animation for some
characters, where you'd like to focus only on some of the character's
control (i.e. eyelid tweaks, hand tweaks, etc.).

The other DopeSheet filtering options aren't so relevant here, so I've
excluded them from this.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/space_dopesheet.py
    trunk/blender/source/blender/editors/animation/anim_filter.c

Modified: trunk/blender/release/scripts/ui/space_dopesheet.py
===================================================================
--- trunk/blender/release/scripts/ui/space_dopesheet.py	2011-02-01 21:24:59 UTC (rev 34611)
+++ trunk/blender/release/scripts/ui/space_dopesheet.py	2011-02-01 22:21:43 UTC (rev 34612)
@@ -25,14 +25,17 @@
 # DopeSheet Filtering
 
 # used for DopeSheet, NLA, and Graph Editors
-def dopesheet_filter(layout, context):
+def dopesheet_filter(layout, context, genericFiltersOnly=False):
     dopesheet = context.space_data.dopesheet
     is_nla = context.area.type == 'NLA_EDITOR'
 
     row = layout.row(align=True)
     row.prop(dopesheet, "show_only_selected", text="")
     row.prop(dopesheet, "show_hidden", text="")
-
+	
+    if genericFiltersOnly:
+        return	
+	
     row = layout.row(align=True)
     row.prop(dopesheet, "show_transforms", text="")
 
@@ -110,8 +113,12 @@
 
         if st.mode == 'DOPESHEET':
             dopesheet_filter(layout, context)
+        elif st.mode == 'ACTION':
+		    # 'genericFiltersOnly' limits the options to only the relevant 'generic' subset of
+		    # filters which will work here and are useful (especially for character animation)
+            dopesheet_filter(layout, context, genericFiltersOnly=True)
 
-        elif st.mode in ('ACTION', 'SHAPEKEY'):
+        if st.mode in ('ACTION', 'SHAPEKEY'):
             layout.template_ID(st, "action", new="action.new")
 
         # Grease Pencil mode doesn't need snapping, as it's frame-aligned only

Modified: trunk/blender/source/blender/editors/animation/anim_filter.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_filter.c	2011-02-01 21:24:59 UTC (rev 34611)
+++ trunk/blender/source/blender/editors/animation/anim_filter.c	2011-02-01 22:21:43 UTC (rev 34612)
@@ -800,7 +800,7 @@
 /* ----------------------------------------- */
 
 /* NOTE: when this function returns true, the F-Curve is to be skipped */
-static int skip_fcurve_selected_data(bDopeSheet *ads, FCurve *fcu, ID *owner_id, int filter_mode)
+static int skip_fcurve_selected_data (bDopeSheet *ads, FCurve *fcu, ID *owner_id, int filter_mode)
 {
 	if (GS(owner_id->name) == ID_OB) {
 		Object *ob= (Object *)owner_id;
@@ -2568,9 +2568,11 @@
 		switch (datatype) {
 			case ANIMCONT_ACTION:	/* 'Action Editor' */
 			{
+				bDopeSheet *ads = ((ac->sa) && (ac->sa->spacetype==SPACE_ACTION)) ? &((SpaceAction*)ac->sa->spacedata.first)->ads : NULL;
+				
 				/* the check for the DopeSheet summary is included here since the summary works here too */
 				if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
-					items += animdata_filter_action(ac, anim_data, NULL, data, filter_mode, NULL, ANIMTYPE_NONE, (ID *)obact);
+					items += animdata_filter_action(ac, anim_data, ads, data, filter_mode, NULL, ANIMTYPE_NONE, (ID *)obact);
 			}
 				break;
 				




More information about the Bf-blender-cvs mailing list