Skip to content

Commit

Permalink
Revert "Added the ability to prefix imported action names."
Browse files Browse the repository at this point in the history
This reverts commit 5a13fae.
  • Loading branch information
cmbasnett committed Jan 26, 2022
1 parent 8c0b7f8 commit 24e606a
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions io_scene_psk_psa/psa/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def __init__(self):
self.should_use_fake_user = False
self.should_stash = False
self.sequence_names = []
self.action_name_prefix = ''


class PsaImporter(object):
Expand Down Expand Up @@ -116,8 +115,7 @@ def calculate_fcurve_data(import_bone: ImportBone, key_data: []):
actions = []
for sequence in sequences:
# Add the action.
action_name = options.action_name_prefix + sequence.name.decode('windows-1252')
action = bpy.data.actions.new(name=action_name)
action = bpy.data.actions.new(name=sequence.name.decode())
action.use_fake_user = options.should_use_fake_user

# Create f-curves for the rotation and location of each bone.
Expand Down Expand Up @@ -244,7 +242,6 @@ class PsaImportPropertyGroup(bpy.types.PropertyGroup):
should_clean_keys: BoolProperty(default=True, name='Clean Keyframes', description='Exclude unnecessary keyframes from being written to the actions.')
should_use_fake_user: BoolProperty(default=True, name='Fake User', description='Assign each imported action a fake user so that the data block is saved even it has no users.')
should_stash: BoolProperty(default=False, name='Stash', description='Stash each imported action as a strip on a new non-contributing NLA track')
action_name_prefix: StringProperty(default='', name='Action Name Prefix')


class PSA_UL_ImportActionList(UIList):
Expand Down Expand Up @@ -352,13 +349,13 @@ def draw(self, context):
row.operator('psa_import.actions_select_all', text='All')
row.operator('psa_import.actions_deselect_all', text='None')

col = layout.column(heading="Options")
col.use_property_split = True
col.use_property_decorate = False
col.prop(property_group, 'should_clean_keys')
col.prop(property_group, 'should_use_fake_user')
col.prop(property_group, 'should_stash')
col.prop(property_group, 'action_name_prefix')
row = layout.row()
row.prop(property_group, 'should_clean_keys')

# DATA
row = layout.row()
row.prop(property_group, 'should_use_fake_user')
row.prop(property_group, 'should_stash')

layout.operator('psa_import.import', text=f'Import')

Expand Down Expand Up @@ -402,7 +399,6 @@ def execute(self, context):
options.should_clean_keys = property_group.should_clean_keys
options.should_use_fake_user = property_group.should_use_fake_user
options.should_stash = property_group.should_stash
options.action_name_prefix = property_group.action_name_prefix
PsaImporter().import_psa(psa_reader, context.view_layer.objects.active, options)
self.report({'INFO'}, f'Imported {len(sequence_names)} action(s)')
return {'FINISHED'}
Expand Down

0 comments on commit 24e606a

Please sign in to comment.