monkeyman192 / NMSDK

Custom Model importer for NMS
https://monkeyman192.github.io/NMSDK/
30 stars 9 forks source link

[BUG] Scenes with 4 LODs fail to get imported #94

Open lyravega opened 2 years ago

lyravega commented 2 years ago

Describe the bug Import failure on scenes with 4 LODs instead of the usual 3

To Reproduce Try importing a scene such as MODELS\COMMON\SPACECRAFT\COMMONPARTS\HANGARINTERIORPARTS\HANGAR.SCENE.MBIN

Stack trace

E:\_modding\NMS\AMUMSS\_unpack\main\MODELS\COMMON\SPACECRAFT\COMMONPARTS\HANGARINTERIORPARTS\HANGAR.SCENE.MBIN
Loading MODELS\COMMON\SPACECRAFT\COMMONPARTS\HANGARINTERIORPARTS\HANGAR
rendering MODELS\COMMON\SPACECRAFT\COMMONPARTS\HANGARINTERIORPARTS\HANGAR
removing Cube
Traceback (most recent call last):
  File "C:\Users\alpha\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\nmsdk\NMSDK.py", line 931, in execute
    importer.render_scene()
  File "C:\Users\alpha\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\nmsdk\ModelImporter\import_scene.py", line 338, in render_scene
    added_obj = self._add_empty_to_scene(self.scene_node_data)
  File "C:\Users\alpha\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\nmsdk\ModelImporter\import_scene.py", line 569, in _add_empty_to_scene
    empty_obj.NMSReference_props.lod_levels = lods
ValueError: bpy_struct: item.attr = val: sequences of dimension 0 should contain 3 items, not 4

Additional context Manually obliterated one of the LOD levels from the model, and changed the length to 3 to open the scene for now

lyravega commented 2 years ago

Tried importing it again, this time, it worked... no idea what's going on.