[Bf-blender-cvs] [c0a8a29ae68] blender2.8: AnimEditors: Remove the toggles to enable name/collection-based filtering

Joshua Leung noreply at git.blender.org
Tue Jun 26 11:45:54 CEST 2018


Commit: c0a8a29ae68f95bc0e0843774700868c19af1407
Author: Joshua Leung
Date:   Tue Jun 26 21:35:31 2018 +1200
Branches: blender2.8
https://developer.blender.org/rBc0a8a29ae68f95bc0e0843774700868c19af1407

AnimEditors: Remove the toggles to enable name/collection-based filtering

Now the name/collection filters run when there's some text,
and don't run when the box is empty, thus reducing an extra
step that was needed before these options could be used.

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

M	release/scripts/startup/bl_ui/space_dopesheet.py
M	source/blender/editors/animation/anim_channels_edit.c
M	source/blender/editors/animation/anim_filter.c
M	source/blender/makesdna/DNA_action_types.h
M	source/blender/makesrna/intern/rna_action.c

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

diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 729b14c9a20..99da6213188 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -43,22 +43,16 @@ def dopesheet_filter(layout, context, genericFiltersOnly=False):
     if not genericFiltersOnly:
         if bpy.data.collections:
             row = layout.row(align=True)
-            row.prop(dopesheet, "show_only_collection_objects", text="")
-            if dopesheet.show_only_collection_objects:
-                row.prop(dopesheet, "filter_collection", text="")
+            row.prop(dopesheet, "filter_collection", text="")
 
     if not is_nla:
         row = layout.row(align=True)
-        row.prop(dopesheet, "show_only_matching_fcurves", text="")
-        if dopesheet.show_only_matching_fcurves:
-            row.prop(dopesheet, "filter_fcurve_name", text="")
-            row.prop(dopesheet, "use_multi_word_filter", text="")
+        row.prop(dopesheet, "filter_fcurve_name", text="")
+        row.prop(dopesheet, "use_multi_word_filter", text="")
     else:
         row = layout.row(align=True)
-        row.prop(dopesheet, "use_filter_text", text="")
-        if dopesheet.use_filter_text:
-            row.prop(dopesheet, "filter_text", text="")
-            row.prop(dopesheet, "use_multi_word_filter", text="")
+        row.prop(dopesheet, "filter_text", text="")
+        row.prop(dopesheet, "use_multi_word_filter", text="")
 
 #######################################
 # Dopesheet Filtering Popovers
@@ -94,25 +88,16 @@ class DopesheetFilterPopoverBase:
 
         if (not generic_filters_only) and (bpy.data.collections):
             row = layout.row(align=True)
-            row.prop(dopesheet, "show_only_collection_objects", text="")
-            sub = row.row(align=True)
-            sub.active = dopesheet.show_only_collection_objects
-            sub.prop(dopesheet, "filter_collection", text="")
+            row.prop(dopesheet, "filter_collection", text="")
 
         if not is_nla:
             row = layout.row(align=True)
-            row.prop(dopesheet, "show_only_matching_fcurves", text="")
-            sub = row.row(align=True)
-            sub.active = dopesheet.show_only_matching_fcurves
-            sub.prop(dopesheet, "filter_fcurve_name", text="")
-            sub.prop(dopesheet, "use_multi_word_filter", text="")
+            row.prop(dopesheet, "filter_fcurve_name", text="")
+            row.prop(dopesheet, "use_multi_word_filter", text="")
         else:
             row = layout.row(align=True)
-            row.prop(dopesheet, "use_filter_text", text="")
-            sub = row.row(align=True)
-            sub.active = dopesheet.use_filter_text
-            sub.prop(dopesheet, "filter_text", text="")
-            sub.prop(dopesheet, "use_multi_word_filter", text="")
+            row.prop(dopesheet, "filter_text", text="")
+            row.prop(dopesheet, "use_multi_word_filter", text="")
 
     # Standard = Present in all panels
     @classmethod
@@ -275,10 +260,8 @@ class DOPESHEET_HT_editor_buttons(Header):
                 row.prop(st.dopesheet, "show_hidden", text="")
 
             row = layout.row(align=True)
-            row.prop(st.dopesheet, "use_filter_text", text="")
-            if st.dopesheet.use_filter_text:
-                row.prop(st.dopesheet, "filter_text", text="")
-                row.prop(st.dopesheet, "use_multi_word_filter", text="")
+            row.prop(st.dopesheet, "filter_text", text="")
+            row.prop(st.dopesheet, "use_multi_word_filter", text="")
 
         layout.separator_spacer()
 
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index edbc1371332..ed4c574537b 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -2300,18 +2300,9 @@ static int animchannels_find_exec(bContext *C, wmOperator *op)
 	if (ANIM_animdata_get_context(C, &ac) == 0)
 		return OPERATOR_CANCELLED;
 
-	/* update filter text, and ensure that filter is enabled if there's something there
-	 * NOTE: we turn the filter off if there's nothing (this is a quick shortcut for dismissing)
-	 */
+	/* update filter text */
 	RNA_string_get(op->ptr, "query", ac.ads->searchstr);
 
-	if (ac.ads->searchstr[0]) {
-		ac.ads->filterflag |= ADS_FILTER_BY_FCU_NAME;
-	}
-	else {
-		ac.ads->filterflag &= ~ADS_FILTER_BY_FCU_NAME;
-	}
-
 	/* redraw */
 	WM_event_add_notifier(C, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
 
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 25704bc7348..c59d24bbdf8 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -1221,7 +1221,7 @@ static FCurve *animfilter_fcurve_next(bDopeSheet *ads, FCurve *first, eAnim_Chan
 					/* only include if this curve is active */
 					if (!(filter_mode & ANIMFILTER_ACTIVE) || (fcu->flag & FCURVE_ACTIVE)) {
 						/* name based filtering... */
-						if ( ((ads) && (ads->filterflag & ADS_FILTER_BY_FCU_NAME)) && (owner_id) ) {
+						if ( ((ads) && (ads->searchstr[0] != '\0')) && (owner_id) ) {
 							if (skip_fcurve_with_name(ads, fcu, channel_type, owner, owner_id))
 								continue;
 						}
@@ -1453,7 +1453,7 @@ static size_t animfilter_nla(bAnimContext *UNUSED(ac), ListBase *anim_data, bDop
 				/* only include if this track is active */
 				if (!(filter_mode & ANIMFILTER_ACTIVE) || (nlt->flag & NLATRACK_ACTIVE)) {
 					/* name based filtering... */
-					if (((ads) && (ads->filterflag & ADS_FILTER_BY_FCU_NAME)) && (owner_id)) {
+					if (((ads) && (ads->searchstr[0] != '\0')) && (owner_id)) {
 						bool track_ok = false, strip_ok = false;
 
 						/* check if the name of the track, or the strips it has are ok... */
@@ -1633,7 +1633,7 @@ static size_t animdata_filter_gpencil_layers_data(ListBase *anim_data, bDopeShee
 				/* active... */
 				if (!(filter_mode & ANIMFILTER_ACTIVE) || (gpl->flag & GP_LAYER_ACTIVE)) {
 					/* skip layer if the name doesn't match the filter string */
-					if ((ads) && (ads->filterflag & ADS_FILTER_BY_FCU_NAME)) {
+					if ((ads) && (ads->searchstr[0] != '\0')) {
 						if (name_matches_dopesheet_filter(ads, gpl->info) == false)
 							continue;
 					}
@@ -1741,7 +1741,7 @@ static size_t animdata_filter_gpencil(bAnimContext *ac, ListBase *anim_data, voi
 				 * objects by the grouped status is on
 				 *	- used to ease the process of doing multiple-character choreographies
 				 */
-				if (ads->filterflag & ADS_FILTER_ONLYOBGROUP) {
+				if (ads->filter_grp != NULL) {
 					if (BKE_collection_has_object_recursive(ads->filter_grp, ob) == 0)
 						continue;
 				}
@@ -2908,7 +2908,7 @@ static bool animdata_filter_base_is_ok(bDopeSheet *ads, Base *base, int filter_m
 	 * objects by the grouped status is on
 	 *	- used to ease the process of doing multiple-character choreographies
 	 */
-	if (ads->filterflag & ADS_FILTER_ONLYOBGROUP) {
+	if (ads->filter_grp != NULL) {
 		if (BKE_collection_has_object_recursive(ads->filter_grp, ob) == 0)
 			return false;
 	}
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index b20765ae187..0546dcb1a6c 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -598,8 +598,8 @@ typedef struct bDopeSheet {
 	ID      *source;            /* currently ID_SCE (for Dopesheet), and ID_SC (for Grease Pencil) */
 	ListBase chanbase; /* cache for channels (only initialized when pinned) */           // XXX not used!
 
-	struct Collection *filter_grp;   /* object group for ADS_FILTER_ONLYOBGROUP filtering option */
-	char searchstr[64];         /* string to search for in displayed names of F-Curves for ADS_FILTER_BY_FCU_NAME filtering option */
+	struct Collection *filter_grp;   /* object group for option to only include objects that belong to this Collection */
+	char searchstr[64];         /* string to search for in displayed names of F-Curves, or NlaTracks/GP Layers/etc. */
 
 	int filterflag;             /* flags to use for filtering data */
 	int flag;                   /* standard flags */
@@ -621,7 +621,6 @@ typedef enum eDopeSheet_FilterFlag {
 
 	/* general filtering */
 	ADS_FILTER_SUMMARY          = (1 << 4),   /* for 'DopeSheet' Editors - include 'summary' line */
-	ADS_FILTER_ONLYOBGROUP      = (1 << 5),   /* only the objects in the specified object group get used */
 
 	/* datatype-based filtering */
 	ADS_FILTER_NOSHAPEKEYS      = (1 << 6),
@@ -650,7 +649,6 @@ typedef enum eDopeSheet_FilterFlag {
 
 	/* general filtering 3 */
 	ADS_FILTER_INCL_HIDDEN      = (1 << 26),  /* include 'hidden' channels too (i.e. those from hidden Objects/Bones) */
-	ADS_FILTER_BY_FCU_NAME      = (1 << 27),  /* for F-Curves, filter by the displayed name (i.e. to isolate all Location curves only) */
 	ADS_FILTER_ONLY_ERRORS		= (1 << 28),  /* show only F-Curves which are disabled/have errors - for debugging drivers */
 
 	/* GPencil Mode */
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 5b225b18a78..4f2654bb30e 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -326,13 +326,6 @@ static void rna_def_dopesheet(BlenderRNA *brna)
 	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
 
 	/* Object Collection Filtering Settings */
-	prop = RNA_def_property(srna, "show_only_collection_objects", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "filterflag", ADS_FILTER_ONLYOBGROUP);
-	RNA_def_property_ui_text(prop, "Only Objects in Collection",
-	                         "Only include channels from objects in the specified collection");
-	RNA_def_property_ui_icon(prop, ICON_GROUP, 0);
-	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
-
 	prop = RNA_def_property(srna, "filter_collection", PROP_POINTER, PROP_NONE);
 	RNA_def_property_pointer_sdna(prop, NULL, "filter_grp");
 	RNA_def_property

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list