From 3de1f075ddbc193f78a0a640908eeb443cf22cf1 Mon Sep 17 00:00:00 2001 From: Colin Basnett Date: Fri, 25 Aug 2023 16:56:59 -0700 Subject: [PATCH] Minor clean-up --- io_scene_psk_psa/helpers.py | 21 +-------------------- io_scene_psk_psa/psk/importer.py | 2 +- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/io_scene_psk_psa/helpers.py b/io_scene_psk_psa/helpers.py index d7b7980..9740d3a 100644 --- a/io_scene_psk_psa/helpers.py +++ b/io_scene_psk_psa/helpers.py @@ -1,4 +1,3 @@ -import datetime import re import typing from collections import Counter @@ -9,24 +8,6 @@ import bpy.types from bpy.types import NlaStrip, Object, AnimData -class Timer: - def __enter__(self): - self.start = datetime.datetime.now() - self.interval = None - return self - - def __exit__(self, *args): - self.end = datetime.datetime.now() - self.interval = self.end - self.start - - @property - def duration(self): - if self.interval is not None: - return self.interval - else: - return datetime.datetime.now() - self.start - - def rgb_to_srgb(c: float): if c > 0.0031308: return 1.055 * (pow(c, (1.0 / 2.4))) - 0.055 @@ -143,7 +124,7 @@ def get_export_bone_names(armature_object: Object, bone_filter_mode: str, bone_g # Split out the bone indices and the instigator bone names into separate lists. # We use the bone names for the return values because the bone name is a more universal way of referencing them. - # For example, users of this function may modify bone lists, which would invalidate the indices and require a + # For example, users of this function may modify bone lists, which would invalidate the indices and require an # index mapping scheme to resolve it. Using strings is more comfy and results in less code downstream. instigator_bone_names = [bones[x[1]].name if x[1] is not None else None for x in bone_indices] bone_names = [bones[x[0]].name for x in bone_indices] diff --git a/io_scene_psk_psa/psk/importer.py b/io_scene_psk_psa/psk/importer.py index 88d518b..0696edd 100644 --- a/io_scene_psk_psa/psk/importer.py +++ b/io_scene_psk_psa/psk/importer.py @@ -131,7 +131,7 @@ def import_psk(psk: Psk, context, options: PskImportOptions) -> PskImportResult: # Material already exists, just re-use it. material = bpy.data.materials[material_name] elif is_bdk_addon_loaded() and psk.has_material_references: - # Material does not yet exist and we have the BDK addon installed. + # Material does not yet exist, and we have the BDK addon installed. # Attempt to load it using BDK addon's operator. material_reference = psk.material_references[material_index] if material_reference and bpy.ops.bdk.link_material(reference=material_reference) == {'FINISHED'}: