File structure/naming overhaul on the PSK importer and exporter

* Inverted to the option to "ignore bone name restrictions". It is now "Enforce Bone Name Restrictions" and it is off by default.
* Added option to filter out "reversed" sequences from the sequence list
This commit is contained in:
Colin Basnett
2023-07-29 20:51:23 -07:00
parent 782c210f04
commit afe598f671
16 changed files with 323 additions and 286 deletions

View File

@@ -27,7 +27,7 @@ class PsaBuildOptions:
self.sequences: List[PsaBuildSequence] = []
self.bone_filter_mode: str = 'ALL'
self.bone_group_indices: List[int] = []
self.should_ignore_bone_name_restrictions: bool = False
self.should_enforce_bone_name_restrictions: bool = False
self.sequence_name_prefix: str = ''
self.sequence_name_suffix: str = ''
self.root_motion: bool = False

View File

@@ -313,7 +313,7 @@ class PSA_OT_export(Operator, ExportHelper):
layout.template_list('PSX_UL_bone_group_list', '', pg, 'bone_group_list', pg, 'bone_group_list_index',
rows=rows)
layout.prop(pg, 'should_ignore_bone_name_restrictions')
layout.prop(pg, 'should_enforce_bone_name_restrictions')
layout.separator()
@@ -397,7 +397,7 @@ class PSA_OT_export(Operator, ExportHelper):
options.sequences = export_sequences
options.bone_filter_mode = pg.bone_filter_mode
options.bone_group_indices = [x.index for x in pg.bone_group_list if x.is_selected]
options.should_ignore_bone_name_restrictions = pg.should_ignore_bone_name_restrictions
options.should_ignore_bone_name_restrictions = pg.should_enforce_bone_name_restrictions
options.sequence_name_prefix = pg.sequence_name_prefix
options.sequence_name_suffix = pg.sequence_name_suffix
options.root_motion = pg.root_motion

View File

@@ -116,10 +116,16 @@ class PSA_PG_export(PropertyGroup):
options=empty_set,
description='Show actions that belong to an asset library')
sequence_filter_pose_marker: BoolProperty(
default=False,
default=True,
name='Show pose markers',
options=empty_set)
sequence_use_filter_sort_reverse: BoolProperty(default=True, options=empty_set)
sequence_filter_reversed: BoolProperty(
default=True,
options=empty_set,
name='Show Reversed',
description='Show reversed sequences'
)
def filter_sequences(pg: PSA_PG_export, sequences) -> List[int]:
@@ -147,6 +153,11 @@ def filter_sequences(pg: PSA_PG_export, sequences) -> List[int]:
if hasattr(sequence, 'is_pose_marker') and sequence.is_pose_marker:
flt_flags[i] &= ~bitflag_filter_item
if not pg.sequence_filter_reversed:
for i, sequence in enumerate(sequences):
if sequence.frame_start > sequence.frame_end:
flt_flags[i] &= ~bitflag_filter_item
return flt_flags

View File

@@ -38,6 +38,7 @@ class PSA_UL_export_sequences(UIList):
subrow = row.row(align=True)
subrow.prop(pg, 'sequence_filter_asset', icon_only=True, icon='ASSET_MANAGER')
subrow.prop(pg, 'sequence_filter_pose_marker', icon_only=True, icon='PMARKER')
subrow.prop(pg, 'sequence_filter_reversed', text="", icon='FRAME_PREV')
def filter_items(self, context, data, prop):
pg = getattr(context.scene, 'psa_export')