1
0
mirror of https://github.com/DarklightGames/io_scene_psk_psa.git synced 2024-11-23 22:40:59 +01:00

Fixed not being able to properly run reload scripts on the addon

This commit is contained in:
Colin Basnett 2024-05-31 18:52:33 -07:00
parent cab8338a69
commit 8df7b4b141
2 changed files with 28 additions and 11 deletions

View File

@ -15,9 +15,9 @@ bl_info = {
if 'bpy' in locals():
import importlib
importlib.reload(psx_data)
importlib.reload(psx_helpers)
importlib.reload(psx_types)
importlib.reload(shared_data)
importlib.reload(shared_helpers)
importlib.reload(shared_types)
importlib.reload(psk_data)
importlib.reload(psk_reader)
@ -44,15 +44,27 @@ if 'bpy' in locals():
importlib.reload(psa_import_operators)
importlib.reload(psa_import_ui)
else:
# if i remove this line, it can be enabled just fine
from .shared import types as psx_types
from .shared import data as shared_data
from .shared import helpers as shared_helpers
from .shared import types as shared_types
from .psk import data as psk_data
from .psk import reader as psk_reader
from .psk import writer as psk_writer
from .psk import builder as psk_builder
from .psk import properties as psk_properties
from .psk import ui as psk_ui
from .psk import importer as psk_importer
from .psk.export import properties as psk_export_properties
from .psk.export import operators as psk_export_operators
from .psk.export import ui as psk_export_ui
from .psk.import_ import operators as psk_import_operators
from .psa import data as psa_data
from .psa import config as psa_config
from .psa import reader as psa_reader
from .psa import writer as psa_writer
from .psa import builder as psa_builder
from .psa import importer as psa_importer
from .psa.export import properties as psa_export_properties
from .psa.export import operators as psa_export_operators
from .psa.export import ui as psa_export_ui
@ -63,7 +75,12 @@ else:
import bpy
from bpy.props import PointerProperty
classes = psx_types.classes +\
# TODO: just here so that it's not unreferenced and removed on save.
if [shared_data, shared_helpers, psk_data, psk_reader, psk_writer, psk_builder, psk_importer, psa_data, psa_config,
psa_reader, psa_writer, psa_builder, psa_importer]:
pass
classes = shared_types.classes +\
psk_properties.classes +\
psk_ui.classes +\
psk_import_operators.classes +\
@ -105,7 +122,7 @@ def register():
bpy.types.Scene.psa_import = PointerProperty(type=psa_import_properties.PSA_PG_import)
bpy.types.Scene.psa_export = PointerProperty(type=psa_export_properties.PSA_PG_export)
bpy.types.Scene.psk_export = PointerProperty(type=psk_export_properties.PSK_PG_export)
bpy.types.Action.psa_export = PointerProperty(type=psx_types.PSX_PG_action_export)
bpy.types.Action.psa_export = PointerProperty(type=shared_types.PSX_PG_action_export)
def unregister():

View File

@ -30,12 +30,12 @@ def get_nla_strips_in_frame_range(animation_data: AnimData, frame_min: float, fr
def populate_bone_collection_list(armature_object: Object, bone_collection_list: bpy.props.CollectionProperty) -> None:
'''
"""
Updates the bone collections collection.
Bone collection selections are preserved between updates unless none of the groups were previously selected;
otherwise, all collections are selected by default.
'''
"""
has_selected_collections = any([g.is_selected for g in bone_collection_list])
unassigned_collection_is_selected, selected_assigned_collection_names = True, []
@ -84,7 +84,7 @@ def check_bone_names(bone_names: Iterable[str]):
def get_export_bone_names(armature_object: Object, bone_filter_mode: str, bone_collection_indices: List[int]) -> List[str]:
'''
"""
Returns a sorted list of bone indices that should be exported for the given bone filter mode and bone collections.
Note that the ancestors of bones within the bone collections will also be present in the returned list.
@ -93,7 +93,7 @@ def get_export_bone_names(armature_object: Object, bone_filter_mode: str, bone_c
:param bone_filter_mode: One of ['ALL', 'BONE_COLLECTIONS']
:param bone_collection_indices: List of bone collection indices to be exported.
:return: A sorted list of bone indices that should be exported.
'''
"""
if armature_object is None or armature_object.type != 'ARMATURE':
raise ValueError('An armature object must be supplied')