From 4181a15d0ef4d8017dcce75cbb391d33707ed6a3 Mon Sep 17 00:00:00 2001 From: Colin Basnett Date: Tue, 1 Nov 2022 11:32:50 -0700 Subject: [PATCH] Improved comment and typing information --- io_scene_psk_psa/psa/data.py | 4 ++-- io_scene_psk_psa/psa/reader.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/io_scene_psk_psa/psa/data.py b/io_scene_psk_psa/psa/data.py index 76395d1..4eaed29 100644 --- a/io_scene_psk_psa/psa/data.py +++ b/io_scene_psk_psa/psa/data.py @@ -6,7 +6,7 @@ from ..data import * """ Note that keys are not stored within the Psa object. -Use the PsaReader::get_sequence_keys to get a the keys for a sequence. +Use the PsaReader::get_sequence_keys to get the keys for a sequence. """ @@ -60,5 +60,5 @@ class Psa(object): def __init__(self): self.bones: List[Psa.Bone] = [] - self.sequences: typing.OrderedDict[Psa.Sequence] = OrderedDict() + self.sequences: typing.OrderedDict[str, Psa.Sequence] = OrderedDict() self.keys: List[Psa.Key] = [] diff --git a/io_scene_psk_psa/psa/reader.py b/io_scene_psk_psa/psa/reader.py index 0f0fba8..321fdf0 100644 --- a/io_scene_psk_psa/psa/reader.py +++ b/io_scene_psk_psa/psa/reader.py @@ -25,7 +25,12 @@ class PsaReader(object): def sequences(self): return self.psa.sequences - def read_sequence_data_matrix(self, sequence_name: str): + def read_sequence_data_matrix(self, sequence_name: str) -> np.ndarray: + """ + Reads and returns the data matrix for the given sequence. + @param sequence_name: The name of the sequence. + @return: An FxBx7 matrix where F is the number of frames, B is the number of bones. + """ sequence = self.psa.sequences[sequence_name] keys = self.read_sequence_keys(sequence_name) bone_count = len(self.bones) @@ -41,8 +46,8 @@ class PsaReader(object): """ Reads and returns the key data for a sequence. - :param sequence_name: The name of the sequence. - :return: A list of Psa.Keys. + @param sequence_name: The name of the sequence. + @return: A list of Psa.Keys. """ # Set the file reader to the beginning of the keys data sequence = self.psa.sequences[sequence_name]