Added the ability to export actions with the original sequence names that they were imported from. This will be very helpful in resolving naming conflicts when working with actions that share the same name on export (e.g. players and weapons often share the same animation name (e.g., prone_reload_mg42 but have to exist in the same file).

Still kind of broken though because it allows duplicate names which will possibly break downstream programs.
This commit is contained in:
Colin Basnett
2022-01-24 14:14:35 -08:00
parent 5a13faeb5e
commit 0d06236bab
3 changed files with 33 additions and 5 deletions

View File

@@ -7,6 +7,7 @@ class PsaBuilderOptions(object):
self.actions = []
self.bone_filter_mode = 'ALL'
self.bone_group_indices = []
self.should_use_original_sequence_names = False
class PsaBuilder(object):
@@ -106,7 +107,13 @@ class PsaBuilder(object):
frame_min, frame_max = [int(x) for x in action.frame_range]
sequence = Psa.Sequence()
sequence.name = bytes(action.name, encoding='utf-8')
if options.should_use_original_sequence_names and 'original_sequence_name' in action:
sequence_name = action['original_sequence_name']
else:
sequence_name = action.name
sequence.name = bytes(sequence_name, encoding='windows-1252')
sequence.frame_count = frame_max - frame_min + 1
sequence.frame_start_index = frame_start_index
sequence.fps = context.scene.render.fps