From 3627abe6fcde332ef42ad6c2b39430f641a91db4 Mon Sep 17 00:00:00 2001 From: Colin Basnett Date: Tue, 26 Jul 2022 15:00:14 -0700 Subject: [PATCH] Minor code changes --- io_scene_psk_psa/psa/builder.py | 5 +---- io_scene_psk_psa/psa/importer.py | 3 +++ io_scene_psk_psa/types.py | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/io_scene_psk_psa/psa/builder.py b/io_scene_psk_psa/psa/builder.py index c0170c0..969b8c6 100644 --- a/io_scene_psk_psa/psa/builder.py +++ b/io_scene_psk_psa/psa/builder.py @@ -150,10 +150,7 @@ def build_psa(context, options: PsaBuildOptions) -> Psa: psa_bone.parent_index = -1 if bone.parent is not None: - rotation = bone.matrix.to_quaternion() - rotation.x = -rotation.x - rotation.y = -rotation.y - rotation.z = -rotation.z + rotation = bone.matrix.to_quaternion().conjugated() inverse_parent_rotation = bone.parent.matrix.to_quaternion().inverted() parent_head = inverse_parent_rotation @ bone.parent.head parent_tail = inverse_parent_rotation @ bone.parent.tail diff --git a/io_scene_psk_psa/psa/importer.py b/io_scene_psk_psa/psa/importer.py index 35e1cce..0b60958 100644 --- a/io_scene_psk_psa/psa/importer.py +++ b/io_scene_psk_psa/psa/importer.py @@ -386,6 +386,9 @@ class PsaImportSequencesFromText(Operator): def execute(self, context): pg = context.scene.psa_import + if pg.select_text is None: + self.report({'ERROR_INVALID_CONTEXT'}, 'No text block selected') + return {'CANCELLED'} contents = pg.select_text.as_string() count = 0 for line in contents.split('\n'): diff --git a/io_scene_psk_psa/types.py b/io_scene_psk_psa/types.py index aa38595..08cde91 100644 --- a/io_scene_psk_psa/types.py +++ b/io_scene_psk_psa/types.py @@ -15,10 +15,6 @@ class BoneGroupListItem(PropertyGroup): count: IntProperty() is_selected: BoolProperty(default=False) - @property - def name(self): - return self.name - classes = ( BoneGroupListItem,