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..ee95b31 100644 --- a/core/import_pmx.py +++ b/core/import_pmx.py @@ -1,5 +1,14 @@ import bpy import struct +import traceback +import mathutils + +from mathutils import Matrix, Vector + +def replace_char(string, index, character): + temp = list(string) + temp[index] = character + return "".join(temp) def read_pmx_header(file): # Read PMX header information @@ -10,7 +19,7 @@ def read_pmx_header(file): version = struct.unpack('>>>>>> Stashed changes @register_wrap class AvatarToolkitQuickAccessPanel(bpy.types.Panel):