[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [61063] trunk/blender/source/blender/ editors/animation/anim_filter.c: Bugfix [#36687] Animation channels can' t be grouped in action editor

Joshua Leung aligorith at gmail.com
Sat Nov 2 14:11:06 CET 2013


Revision: 61063
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=61063
Author:   aligorith
Date:     2013-11-02 13:11:06 +0000 (Sat, 02 Nov 2013)
Log Message:
-----------
Bugfix [#36687] Animation channels can't be grouped in action editor

Internal filtering flags used to obtain AnimData blocks as result were not
working correctly in Action and ShapeKey modes. Instead, in these modes, they
were often returning F-Curves instead, which lead to the grouping operating
failing (and perhaps other unidentified bugs)

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

Modified: trunk/blender/source/blender/editors/animation/anim_filter.c
===================================================================
--- trunk/blender/source/blender/editors/animation/anim_filter.c	2013-11-02 13:08:48 UTC (rev 61062)
+++ trunk/blender/source/blender/editors/animation/anim_filter.c	2013-11-02 13:11:06 UTC (rev 61063)
@@ -2624,24 +2624,50 @@
 		
 		/* firstly filter the data */
 		switch (datatype) {
+			/* Action-Editing Modes */
 			case ANIMCONT_ACTION:   /* 'Action Editor' */
 			{
 				Object *obact = ac->obact;
 				SpaceAction *saction = (SpaceAction *)ac->sl;
 				bDopeSheet *ads = (saction) ? &saction->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 += animfilter_action(ac, anim_data, ads, data, filter_mode, (ID *)obact);
+				/* specially check for AnimData filter... [#36687] */
+				if (UNLIKELY(filter_mode & ANIMFILTER_ANIMDATA)) {
+					/* all channels here are within the same AnimData block, hence this special case */
+					if (LIKELY(obact->adt)) {
+						ANIMCHANNEL_NEW_CHANNEL(obact->adt, ANIMTYPE_ANIMDATA, (ID *)obact);
+					}
+				}
+				else {
+					/* 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 += 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 */
-				if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
-					items = animdata_filter_shapekey(ac, anim_data, data, filter_mode);
+				Key *key = (Key *)data;
+				
+				/* specially check for AnimData filter... [#36687] */
+				if (UNLIKELY(filter_mode & ANIMFILTER_ANIMDATA)) {
+					/* all channels here are within the same AnimData block, hence this special case */
+					if (LIKELY(key->adt)) {
+						ANIMCHANNEL_NEW_CHANNEL(key->adt, ANIMTYPE_ANIMDATA, (ID *)key);
+					}
+				}
+				else {
+					/* 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_shapekey(ac, anim_data, key, filter_mode);
+				}
+				
 				break;
 			}
+			
+			
+			/* Modes for Specialty Data Types (i.e. not keyframes) */
 			case ANIMCONT_GPENCIL:
 			{
 				if (animdata_filter_dopesheet_summary(ac, anim_data, filter_mode, &items))
@@ -2654,6 +2680,9 @@
 					items = animdata_filter_mask(anim_data, data, filter_mode);
 				break;
 			}
+			
+			
+			/* DopeSheet Based Modes */
 			case ANIMCONT_DOPESHEET: /* 'DopeSheet Editor' */
 			{
 				/* the DopeSheet editor is the primary place where the DopeSheet summaries are useful */
@@ -2669,6 +2698,9 @@
 				items = animdata_filter_dopesheet(ac, anim_data, data, filter_mode);
 				break;
 			}
+			
+			
+			/* Special/Internal Use */
 			case ANIMCONT_CHANNEL: /* animation channel */
 			{
 				bDopeSheet *ads = ac->ads;




More information about the Bf-blender-cvs mailing list