OpenSAGE / OpenSAGE.BlenderPlugin

A Westwood 3D Blender plugin. Imports & exports the W3D/W3X format to/from Blender.
https://opensage.github.io
GNU Lesser General Public License v3.0
50 stars 18 forks source link

IndexError: bpy_prop_collection[index]: index 191 out of range, size 191 #246

Closed xezon closed 1 year ago

xezon commented 1 year ago

Importing UIWRKR_SKN.W3D file from GeneralsZH-104 causes error.

plugin version: 0.6.7
Loading file: D:\Projects\TheSuperHackers\GeneralsFiles\Generals-108-GeneralsZH-104-Loose\Art\W3D\UIWRKR_SKN.W3D
Loading file: D:\Projects\TheSuperHackers\GeneralsFiles\Generals-108-GeneralsZH-104-Loose\Art\W3D\UIWRKR_SKL.W3D
creating mesh 'BOX'
loaded texture: D:\Projects\TheSuperHackers\GeneralsFiles\Generals-108-GeneralsZH-104-Loose\Art\W3D\CTCrateBoxes.dds
creating mesh 'MINED_SKIN'
creating mesh 'WORKER'
Python: Traceback (most recent call last):
  File "C:\Users\x\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\io_mesh_w3d\__init__.py", line 205, in execute
    load(self)
  File "C:\Users\x\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\io_mesh_w3d\w3d\import_w3d.py", line 137, in load
    create_data(context,
  File "C:\Users\x\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\io_mesh_w3d\import_utils.py", line 46, in create_data
    rig_mesh(mesh, hierarchy, rig, sub_object)
  File "C:\Users\x\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\io_mesh_w3d\common\utils\mesh_import.py", line 130, in rig_mesh
    mesh.vertices[i].co = matrix @ mesh_struct.verts[i]
IndexError: bpy_prop_collection[index]: index 191 out of range, size 191
Tarcontar commented 1 year ago

This can easily be caused by the file beeing corrupt/ not meeting the w3d specs. In Battle for Middle Earth there are also various files that made it in the shipped game but are corrupt. Could you PM me the file on discord?

Tarcontar commented 1 year ago

image imports fine for me, could you please recheck with latest blender 3.5?

xezon commented 1 year ago

I imported it with the same Blender 3.4.1 and the import works now... I think we can close this for now.

Perhaps there is more on how to reproduce it.

Tarcontar commented 1 year ago

All right, thx for checking!