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 magic = file.read(4) if magic != b'PMX ': raise ValueError("Invalid PMX file") version = struct.unpack('