space928 / Blender-O3D-IO-Public

A plugin supporting blender 2.79.x-3.x.x for importing and exporting OMSI .sco, .cfg, and .o3d files
GNU General Public License v3.0
39 stars 5 forks source link

New issue related to importing #94

Open CrumbledEnvy238 opened 6 months ago

CrumbledEnvy238 commented 6 months ago

Describe the bug

I try to import the front of a articulated bus mod I made, and it doesn't load up into blender, all that loads up is the dum gelenks and another part, in omsi 2 loads up just fine just not in blender, so if I wanted to add any modifications, I can't proofbug

To Reproduce

Everything relevant has been provided

Expected behaviour

I expected the entire front of the model to be imported to blender

Screenshots

I have provided the relevant screenshot of what gets imported.

Additional context

I will provide the error message here Python: Traceback (most recent call last): File "C:\Users#\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\Blender-O3D-IO-Public__init__.py", line 133, in execute io_o3d_import.do_import(self.filepath, context, self.import_x, self.override_text_encoding, self.hide_lods) File "C:\Users#\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\Blender-O3D-IO-Public\o3d_io\io_o3d_import.py", line 110, in do_import o3d = o3dconvert.import_o3d(o3d_bytes) File "C:\Users#\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\Blender-O3D-IO-Public\o3d_io\o3dconvert.py", line 220, in import_o3d bone_list, off = import_bone_list(packed_bytes, off, l_header, bonus_header[0] & 1 == 1) File "C:\Users#\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\Blender-O3D-IO-Public\o3d_io\o3dconvert.py", line 159, in import_bone_list nb = import_bone(buff, offset, long_triangle_indices) File "C:\Users#\AppData\Roaming\Blender Foundation\Blender\3.3\scripts\addons\Blender-O3D-IO-Public\o3d_io\o3dconvert.py", line 85, in import_bone weights.append(struct.unpack_from("<If" if long_triangle_indices else "<Hf", buff, offset=offset)) struct.error: unpack_from requires a buffer of at least 33717 bytes for unpacking 6 bytes at offset 33711 (actual buffer size is 33712)

jem-suu commented 3 months ago

I've also had this issue with a mesh that I've assigned armatures to (not a gelenk) but it may be to do with how the mesh was originally exported.

Most of my meshes were exported with Road-Hog123's exporter and it produces a similar error and stops importing once it reaches that specific model image

  File "C:\Users\Jem\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\Blender-O3D-IO-Public\__init__.py", line 133, in execute
    io_o3d_import.do_import(self.filepath, context, self.import_x, self.override_text_encoding, self.hide_lods)
  File "C:\Users\Jem\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\Blender-O3D-IO-Public\o3d_io\io_o3d_import.py", line 110, in do_import
    o3d = o3dconvert.import_o3d(o3d_bytes)
  File "C:\Users\Jem\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\Blender-O3D-IO-Public\o3d_io\o3dconvert.py", line 220, in import_o3d
    bone_list, off = import_bone_list(packed_bytes, off, l_header, bonus_header[0] & 1 == 1)
  File "C:\Users\Jem\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\Blender-O3D-IO-Public\o3d_io\o3dconvert.py", line 159, in import_bone_list
    nb = import_bone(buff, offset, long_triangle_indices)
  File "C:\Users\Jem\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\Blender-O3D-IO-Public\o3d_io\o3dconvert.py", line 85, in import_bone
    weights.append(struct.unpack_from("<If" if long_triangle_indices else "<Hf", buff, offset=offset))
struct.error: unpack_from requires a buffer of at least 186123 bytes for unpacking 6 bytes at offset 186117 (actual buffer size is 186122)

But another bus exported using the old-fashioned .x format and .x to .o3d converter has no problems, and imports all the models without an issue, even assigning what I assume to be the correct vertex groups: image

There might be a difference in how RH's exporter deals with vertex groups compared to how the .x converter does it, and the plugin can't deal with importing the vertex groups.