From 8c3d303f8d9a164d63662bca5ffd157df772c488 Mon Sep 17 00:00:00 2001 From: 989onan Date: Sat, 15 Jun 2024 14:27:21 -0400 Subject: [PATCH] fix some things - got it all the way to bone loading, but it's still broken -purposeful assert(False) to stop the code. this should be removed later in order for this importer to work - the reading of bytes is now improved for materials and vertices, so now at least the mesh, it's normal data, and some mangled bones import --- core/import_pmx.py | 253 +++++++++++++++++++++++++++++++-------------- 1 file changed, 177 insertions(+), 76 deletions(-) diff --git a/core/import_pmx.py b/core/import_pmx.py index bfe57be..67a6ae2 100644 --- a/core/import_pmx.py +++ b/core/import_pmx.py @@ -2,6 +2,13 @@ import bpy import struct import traceback +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 magic = file.read(4) @@ -26,28 +33,73 @@ def read_pmx_header(file): model_english_name = str(file.read(struct.unpack('