[Bf-blender-cvs] [f4b8d2e] GPencil_Editing_Stage3: GPencil Dopesheet: Layers can now be filtered by name

Joshua Leung noreply at git.blender.org
Wed Dec 2 12:04:08 CET 2015


Commit: f4b8d2ef7a35e120109dc0321a1999531aed2115
Author: Joshua Leung
Date:   Thu Dec 3 00:02:47 2015 +1300
Branches: GPencil_Editing_Stage3
https://developer.blender.org/rBf4b8d2ef7a35e120109dc0321a1999531aed2115

GPencil Dopesheet: Layers can now be filtered by name

This can be enabled using the "filter text" settings on the header (magnifying glass)
as in the other Dope Sheet modes.

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

M	release/scripts/startup/bl_ui/space_dopesheet.py
M	source/blender/editors/animation/anim_filter.c

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

diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py
index 34137c8..a73908a 100644
--- a/release/scripts/startup/bl_ui/space_dopesheet.py
+++ b/release/scripts/startup/bl_ui/space_dopesheet.py
@@ -138,6 +138,11 @@ class DOPESHEET_HT_header(Header):
             # '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 == 'GPENCIL':
+            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 = layout.row(align=True)
         row.prop(toolsettings, "use_proportional_action",
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index 73c82d2..e5837a4 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -1512,14 +1512,19 @@ static size_t animdata_filter_gpencil_layers_data(ListBase *anim_data, bDopeShee
 	
 	/* loop over layers as the conditions are acceptable */
 	for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
-		// TODO: name filter...
-		
 		/* only if selected */
 		if (ANIMCHANNEL_SELOK(SEL_GPL(gpl)) ) {
 			/* only if editable */
 			if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_GPL(gpl)) {
 				/* 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 (BLI_strcasestr(gpl->info, ads->searchstr) == NULL)
+							continue;
+					}
+					
+					
 					/* add to list */
 					ANIMCHANNEL_NEW_CHANNEL(gpl, ANIMTYPE_GPLAYER, gpd);
 				}




More information about the Bf-blender-cvs mailing list