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.
This commit is contained in:
Joshua Leung
2018-06-26 21:35:31 +12:00
parent 5f545dbde8
commit c0a8a29ae6
5 changed files with 22 additions and 69 deletions

View File

@@ -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()