johnzero7 / XNALaraMesh

Blender addon Import/Export XPS Models, Poses
525 stars 94 forks source link

Some models import properly, but some fail to import at all #81

Open ZeroJyllmeiko opened 3 years ago

ZeroJyllmeiko commented 3 years ago

As the title says. For some reason, I can import some models perfectly fine with no issues, but some models give me an error.

Example: I downloaded a Goro Majima xps model, and I tried to import it into Blender, only to get a traceback error. Meanwhile, I can import a Fallout Marked Man model without issue.

Here's the traceback error I've been getting:

Traceback (most recent call last):
  File "C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\xps_tools.py", line 145, in executable status = import_xnalara_model.getInputFilename(xpsSettings)
  File "C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 85, in getInputFilename status = xpsImport()
  File "C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 155, in xpsImport xpsData = loadXpsFile(xpsSettings.filename)
  File "C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\import_xnalara_model.py", line 111, in loadXpsFile xpsData = read_bin_xps.readXpsModel(filename)
  File "C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\read_bin_xps.py", line 301, in readXpsModel meshes = readMeshes(ioStream, xpsHeader, hasBones)
  File "C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\read_bin_xps.py", line 276, in readMeshes trildxs = readTrildxs(file)
  File "C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\read_bin_xps.py", line 71, in readTrildxs face2 = bin_ops.readUInt32(file)
  File "C:\Users\USERNAME\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\XNALaraMesh\bin_ops.py", line 65, in readUInt32 number = struct.unpack(TypeFormat.UInt32, numberBin)[0]
struct.error: unpack requires a bytes object of length 4

location: <unknown location>:-1