Skip to content

W3D Import - Material Index OOB #275

@A1steaksa

Description

@A1steaksa

I just ran into an issue with material indices while importing a .w3d file for the Obelisk building interior from Command & Conquer: Renegade that I had exported from GMax (via the RenX plugin.)

I'm using Blender 4.5.0 and the v0.7.2 build of OpenSAGE.BlenderPlugin

The error I received was:

Python: Traceback (most recent call last):
  File "/home/JSchneider/.config/blender/4.5/scripts/addons/io_mesh_w3d/__init__.py", line 205, in execute
    load(self)
  File "/home/JSchneider/.config/blender/4.5/scripts/addons/io_mesh_w3d/w3d/import_w3d.py", line 137, in load
    create_data(context,
  File "/home/JSchneider/.config/blender/4.5/scripts/addons/io_mesh_w3d/import_utils.py", line 30, in create_data
    newname = create_mesh(context, mesh, current_coll)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/JSchneider/.config/blender/4.5/scripts/addons/io_mesh_w3d/common/utils/mesh_import.py", line 86, in create_mesh
    create_vertex_material(
  File "/home/JSchneider/.config/blender/4.5/scripts/addons/io_mesh_w3d/common/utils/material_import.py", line 49, in create_vertex_material
    bm.faces[i].material_index = structure.material_passes[0].tx_stages[0].tx_ids[0][i]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: material index outside of usable range (0 - 32766)

Attached are two .w3d files created by exporting them from GMax.
obelisk_campaign_exterior.w3d appears to load into Blender without throwing errors. (It may have some secret issues, I can't say for sure)
obelisk_campaign_interior.w3d is the file that produced the error for me.

w3d_blender_issue.zip

Please let me know if there's any other information I can provide that would be helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions