[Bf-blender-cvs] [65340ad73f4] master: Fix T60753: Graph Editor showing cache curves regardless of filters

Joshua Leung noreply at git.blender.org
Sun Feb 3 12:55:48 CET 2019


Commit: 65340ad73f4c70936a5132bc5d8f911408cfb826
Author: Joshua Leung
Date:   Thu Jan 31 15:42:59 2019 +1300
Branches: master
https://developer.blender.org/rB65340ad73f4c70936a5132bc5d8f911408cfb826

Fix T60753: Graph Editor showing cache curves regardless of filters

This commit adds a datablock filtering option for cache files channels,
so that a shot with lots of these in addition to standard animation
(e.g. the Spring production files) don't become bogged down by these.

Furthermore, these channels also respect the "Only Selected" toggle too now.

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

M	release/scripts/startup/bl_ui/space_dopesheet.py
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 506a4f3a242..0a2e9ca3a82 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -148,6 +148,8 @@ class DopesheetFilterPopoverBase:
             flow.prop(dopesheet, "show_textures", text="Textures")
         if bpy.data.shape_keys:
             flow.prop(dopesheet, "show_shapekeys", text="Shape Keys")
+        if bpy.data.cache_files:
+            flow.prop(dopesheet, "show_cache_files", text="Cache Files")
 
         layout.separator()
 
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 0c44a4a2c2c..03d16dd078d 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -2980,9 +2980,11 @@ static size_t animdata_filter_dopesheet(bAnimContext *ac, ListBase *anim_data, b
 	}
 
 	/* Cache files level animations (frame duration and such). */
-	CacheFile *cache_file = ac->bmain->cachefiles.first;
-	for (; cache_file; cache_file = cache_file->id.next) {
-		items += animdata_filter_ds_cachefile(ac, anim_data, ads, cache_file, filter_mode);
+	if (!(ads->filterflag2 & ADS_FILTER_NOCACHEFILES) && !(ads->filterflag & ADS_FILTER_ONLYSEL)) {
+		CacheFile *cache_file = ac->bmain->cachefiles.first;
+		for (; cache_file; cache_file = cache_file->id.next) {
+			items += animdata_filter_ds_cachefile(ac, anim_data, ads, cache_file, filter_mode);
+		}
 	}
 
 	/* movie clip's animation */
diff --git a/source/blender/makesdna/DNA_action_types.h b/source/blender/makesdna/DNA_action_types.h
index 2e5b4c57375..2036284a279 100644
--- a/source/blender/makesdna/DNA_action_types.h
+++ b/source/blender/makesdna/DNA_action_types.h
@@ -727,12 +727,12 @@ typedef struct bDopeSheet {
 
 	/** Flags to use for filtering data. */
 	int filterflag;
+	int filterflag2;
 	/** Standard flags. */
 	int flag;
 
 	/** Index+1 of channel to rename - only gets set by renaming operator. */
 	int renameIndex;
-	int pad;
 } bDopeSheet;
 
 
@@ -795,6 +795,11 @@ typedef enum eDopeSheet_FilterFlag {
 	ADS_FILTER_NOOBDATA = (ADS_FILTER_NOCAM | ADS_FILTER_NOMAT | ADS_FILTER_NOLAM | ADS_FILTER_NOCUR | ADS_FILTER_NOPART | ADS_FILTER_NOARM | ADS_FILTER_NOSPK | ADS_FILTER_NOMODIFIERS),
 } eDopeSheet_FilterFlag;
 
+/* DopeSheet filter-flags - Overflow (filterflag2) */
+typedef enum eDopeSheet_FilterFlag2 {
+	ADS_FILTER_NOCACHEFILES      = (1 << 1),
+} eDopeSheet_FilterFlag2;
+
 /* DopeSheet general flags */
 typedef enum eDopeSheet_Flag {
 	/** when summary is shown, it is collapsed, so all other channels get hidden */
@@ -807,8 +812,6 @@ typedef enum eDopeSheet_Flag {
 	ADS_FLAG_FUZZY_NAMES        = (1 << 2),
 	/** do not sort datablocks (mostly objects) by name (NOTE: potentially expensive operation) */
 	ADS_FLAG_NO_DB_SORT         = (1 << 3),
-
-	/* NOTE: datablock filter flags continued (1 << 10) onwards... */
 } eDopeSheet_Flag;
 
 
diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c
index 225045ed286..47a5401e25a 100644
--- a/source/blender/makesrna/intern/rna_action.c
+++ b/source/blender/makesrna/intern/rna_action.c
@@ -483,6 +483,12 @@ static void rna_def_dopesheet(BlenderRNA *brna)
 	RNA_def_property_ui_icon(prop, ICON_OUTLINER_OB_SPEAKER, 0);
 	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
 
+	prop = RNA_def_property(srna, "show_cache_files", PROP_BOOLEAN, PROP_NONE);
+	RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag2", ADS_FILTER_NOCACHEFILES);
+	RNA_def_property_ui_text(prop, "Display Cache Files", "Include visualization of cache file related animation data");
+	RNA_def_property_ui_icon(prop, ICON_FILE, 0);
+	RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
+
 	prop = RNA_def_property(srna, "show_gpencil", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOGPENCIL);
 	RNA_def_property_ui_text(prop, "Display Grease Pencil", "Include visualization of Grease Pencil related animation data and frames");



More information about the Bf-blender-cvs mailing list