From c0509bbaf4ac71bb95c18e98b218d78d620a938b Mon Sep 17 00:00:00 2001 From: 989onan Date: Fri, 14 Jun 2024 21:29:30 -0400 Subject: [PATCH] fix stuff again - got rid of upstream stuff generated by github, which made it blow up... - got closer on the pmx importer working --- core/__init__.py | 3 --- core/import_pmd.py | 5 +++-- core/import_pmx.py | 35 +++++++++++++++++++++++++---------- ui/quick_access.py | 5 ----- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/core/__init__.py b/core/__init__.py index 8bcf6c9..d1f53d5 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -1,9 +1,7 @@ # core/__init__.py from .register import register_wrap -<<<<<<< Updated upstream from . import pmx -======= #to reload all things in this directory and import them properly - @989onan if "bpy" not in locals(): @@ -21,4 +19,3 @@ else: for module_name in [ basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')]: exec("importlib.reload("+module_name+")") print("reloading " +module_name) ->>>>>>> Stashed changes diff --git a/core/import_pmd.py b/core/import_pmd.py index 51f5de4..a13160b 100644 --- a/core/import_pmd.py +++ b/core/import_pmd.py @@ -1,6 +1,7 @@ import bpy import struct import mathutils +import traceback def read_pmd_header(file): # Read PMD header information @@ -219,6 +220,6 @@ def import_pmd(filepath): print(f"Successfully imported PMD file: {filepath}") print(f"Model Name: {model_name}") print(f"Comment: {comment}") - except Exception as e: + except Exception: print(f"Error importing PMD file: {filepath}") - print(f"Error details: {str(e.stacktrace)}") + print(f"Error details: {traceback.format_exc()}") diff --git a/core/import_pmx.py b/core/import_pmx.py index 3e65ece..bfe57be 100644 --- a/core/import_pmx.py +++ b/core/import_pmx.py @@ -1,5 +1,6 @@ import bpy import struct +import traceback def read_pmx_header(file): # Read PMX header information @@ -10,7 +11,7 @@ def read_pmx_header(file): version = struct.unpack('>>>>>> Stashed changes @register_wrap class AvatarToolkitQuickAccessPanel(bpy.types.Panel):