Fixed bug when bone collections would not be visible on the collection exporter

This commit is contained in:
Colin Basnett
2025-01-13 12:03:26 -08:00
parent f8234b3892
commit a83314c8b3
2 changed files with 3 additions and 3 deletions

View File

@@ -279,7 +279,7 @@ class PSK_OT_export_collection(Operator, ExportHelper):
bones_header, bones_panel = layout.panel('Bones', default_closed=False) bones_header, bones_panel = layout.panel('Bones', default_closed=False)
bones_header.label(text='Bones', icon='BONE_DATA') bones_header.label(text='Bones', icon='BONE_DATA')
if bones_panel: if bones_panel:
draw_bone_filter_mode(bones_panel, self) draw_bone_filter_mode(bones_panel, self, True)
if self.bone_filter_mode == 'BONE_COLLECTIONS': if self.bone_filter_mode == 'BONE_COLLECTIONS':
bones_panel.operator(PSK_OT_populate_bone_collection_list.bl_idname, icon='FILE_REFRESH') bones_panel.operator(PSK_OT_populate_bone_collection_list.bl_idname, icon='FILE_REFRESH')
rows = max(3, min(len(self.bone_collection_list), 10)) rows = max(3, min(len(self.bone_collection_list), 10))

View File

@@ -9,10 +9,10 @@ def is_bone_filter_mode_item_available(pg, identifier):
return True return True
def draw_bone_filter_mode(layout: UILayout, pg): def draw_bone_filter_mode(layout: UILayout, pg, should_always_show_bone_collections=False):
row = layout.row(align=True) row = layout.row(align=True)
for item_identifier, _, _ in bone_filter_mode_items: for item_identifier, _, _ in bone_filter_mode_items:
identifier = item_identifier identifier = item_identifier
item_layout = row.row(align=True) item_layout = row.row(align=True)
item_layout.prop_enum(pg, 'bone_filter_mode', item_identifier) item_layout.prop_enum(pg, 'bone_filter_mode', item_identifier)
item_layout.enabled = is_bone_filter_mode_item_available(pg, identifier) item_layout.enabled = should_always_show_bone_collections or is_bone_filter_mode_item_available(pg, identifier)