[Bf-blender-cvs] [6727bf3] master: Avoid temporary change of animation data flags for nodes filter

Sergey Sharybin noreply at git.blender.org
Thu Dec 26 13:51:04 CET 2013


Commit: 6727bf3a215f014ea9e162e32968a7cb9be3077e
Author: Sergey Sharybin
Date:   Thu Dec 26 18:46:54 2013 +0600
https://developer.blender.org/rB6727bf3a215f014ea9e162e32968a7cb9be3077e

Avoid temporary change of animation data flags for nodes filter

Use temporary runtime flag of filter_mode argument instead.

This commit also fixes some weirdo mix of filter_mode with
filterflag bits.

===================================================================

M	source/blender/editors/animation/anim_filter.c
M	source/blender/editors/include/ED_anim_api.h

===================================================================

diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index ad74515..5e93fda 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -1042,9 +1042,11 @@ static FCurve *animfilter_fcurve_next(bDopeSheet *ads, FCurve *first, bActionGro
 		 *	- this will also affect things like Drivers, and also works for Bone Constraints
 		 */
 		if (ads && owner_id) {
-			if ((ads->filterflag & ADS_FILTER_ONLYSEL) || (ads->filterflag & ADS_FILTER_INCL_HIDDEN) == 0) {
-				if (skip_fcurve_selected_data(ads, fcu, owner_id, filter_mode))
-					continue;
+			if ((filter_mode & ANIMFILTER_TMP_IGNORE_ONLYSEL) == 0) {
+				if ((ads->filterflag & ADS_FILTER_ONLYSEL) || (ads->filterflag & ADS_FILTER_INCL_HIDDEN) == 0) {
+					if (skip_fcurve_selected_data(ads, fcu, owner_id, filter_mode))
+						continue;
+				}
 			}
 		}
 		
@@ -1541,21 +1543,17 @@ static size_t animdata_filter_ds_nodetree(bAnimContext *ac, ListBase *anim_data,
 {
 	bNode *node;
 	size_t items = 0;
-	int group_filter_mode = filter_mode & ~ADS_FILTER_ONLYSEL;
 
 	items += animdata_filter_ds_nodetree_group(ac, anim_data, ads, owner_id, ntree, filter_mode);
 
 	for (node = ntree->nodes.first; node; node = node->next) {
 		if (node->type == NODE_GROUP) {
 			if (node->id) {
-				int filterflag = ads->filterflag;
-				if ((filter_mode & ADS_FILTER_ONLYSEL) && (node->flag & NODE_SELECT) == 0) {
+				if ((ads->filterflag & ADS_FILTER_ONLYSEL) && (node->flag & NODE_SELECT) == 0) {
 					continue;
 				}
-				/* TODO(sergey): A bit creepy, but this flag is not used from threads anyway. */
-				ads->filterflag &= ~ADS_FILTER_ONLYSEL;
-				items += animdata_filter_ds_nodetree_group(ac, anim_data, ads, owner_id, (bNodeTree *) node->id, group_filter_mode);
-				ads->filterflag = filterflag;
+				items += animdata_filter_ds_nodetree_group(ac, anim_data, ads, owner_id, (bNodeTree *) node->id,
+				                                           filter_mode | ANIMFILTER_TMP_IGNORE_ONLYSEL);
 			}
 		}
 	}
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index 8b9bb0a..dff5069 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -225,7 +225,10 @@ typedef enum eAnimFilter_Flags {
 	ANIMFILTER_NODUPLIS       = (1 << 11),
 	
 	/* for checking if we should keep some collapsed channel around (internal use only!) */
-	ANIMFILTER_TMP_PEEK       = (1 << 30)
+	ANIMFILTER_TMP_PEEK       = (1 << 30),
+
+	/* ignore ONLYSEL flag from filterflag, (internal use only!) */
+	ANIMFILTER_TMP_IGNORE_ONLYSEL = (1 << 31)
 } eAnimFilter_Flags;
 
 /* ---------- Flag Checking Macros ------------ */




More information about the Bf-blender-cvs mailing list