import bpy import struct import mathutils def read_pmd_header(file): # Read PMD header information magic = file.read(3) if magic != b'Pmd': raise ValueError("Invalid PMD file") version = struct.unpack('