struct.error: unpack requires a buffer of 4 bytes
See original GitHub issueBlender 2.80 Beta [ Date: 2019-03-03 Hash: ae977d13f8e9 ] SourceIO v3.3.6 https://github.com/REDxEYE/SourceIO/releases/download/3.3.6/SourceIO.zip 4c2752f
Attempting to import a MDL v48: https://sta.sh/09oqflbli8o Please let me know if you’re unable to download the model.
MDL file type ID: IDST
MDL file version: 48
MDL stored file name: "characters/postal_babe/postal_babe.mdl"
MDL stored file size: 250,960 bytes
MDL actual file size: 250,960 bytes
MDL checksum: 9925ED6E
When the model failed to import, the following error message appeared:
Traceback (most recent call last):
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\SourceIO\__init__.py", line 58, in execute
importer.load()
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\SourceIO\mdl2model.py", line 70, in load
self.model.read()
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\SourceIO\source_model.py", line 46, in read
self.mdl.read()
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\SourceIO\mdl_readers\mdl_v48.py", line 22, in read
self.read_bone_flex_drivers()
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\SourceIO\mdl_readers\mdl_v48.py", line 180, in read_bone_flex_drivers
mouth.read(self.reader)
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\SourceIO\data_structures\mdl_data.py", line 1458, in read
self.bone = reader.read_int32()
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\SourceIO\byte_io_mdl.py", line 175, in read_int32
return self.read('i')
File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.80\scripts\addons\SourceIO\byte_io_mdl.py", line 159, in read
return struct.unpack(t, self._read(size))[0]
struct.error: unpack requires a buffer of 4 bytes
location: <unknown location>:-1
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
struct.error: unpack requires a buffer of 4 bytes - Stack Overflow
struct is used for binary packed data - data that is not human-readable. b'+001.80\r' is 8 bytes long: b'+', b'0', b'0', b'1', b'.',...
Read more >struct error: unpack requires a buffer of 4 bytes #24 - GitHub
Any help would be appreciated. Currently my Jax is 0.13.4 and the Jaxlib is 0.13.4 too. Running on CUDA11.1 with python 3.9.
Read more >Python - Struct module error | Sololearn: Learn to code for FREE!
I just tried to reproduce it and got an error saying unpack requires a buffer of 4 bytes. Here is the code, import...
Read more >7.1. struct — Interpret bytes as packed binary data
Iteratively unpack from the buffer buffer according to the format string fmt. This function returns an iterator which will read equally-sized chunks from...
Read more >Traceback (most recent call last): struct.error: unpack requires ...
Python: Traceback (most recent call last): struct.error: unpack requires a buffer of 12 bytes · Coding Python Support.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is the problem i know about, LODs my addon does not resolve them correctly
@REDxEYE I forgot to ask, do you want to open a separate issue for the LOD problem? This way it would be easier to track LOD and struct.error problem separately.
I did a new test with a different SFM model: https://sfmlab.com/item/3709/ Operating System: Pop!_OS 64bit (Based on Ubuntu) Blender 2.81a (non-Steam version / tar.bz2) SourceIO: 3.5.8
On fresh Blender startup (Blender wasn’t running before), I tried to import mechari_female_beta_bigger4_edit.mdl, and it imports successfully.
I CTRL+Z to undo the import, and then import the postal_babe.mdl (from before). The postal_babe.mdl imports into Blender but has the LOD problem, as mentioned before, ok.
I CTRL+Z again to undo the postal_babe.mdl import, and then import mechari_female_beta_bigger4_edit.mdl again, but this time I get the following error:
Importing the mechari_butt.mdl appears to have no issues.
I tried File - New - General, then tried to import the mechari_female_beta_bigger4_edit.mdl again, but similar error.
It appears that the mechari_female_beta_bigger4_edit.mdl will import correctly again if I exit Blender and start it up again. However, if I import that postal_babe.mdl into Blender first, and then try to import the mechari_female_beta_bigger4_edit.mdl, the import will produce the error.
I’m on 64bit Linux, so I have no idea if this can be understood by someone who doesn’t use Linux, and I’m not 100% sure if this is a Linux only problem.
Anyway, I did mention before that there was another Blender add-on (RipImport) I was using that has a similar problem with struct.error, and a user named @luchador3d is trying to help debug it:
I recently started working on a SFM to Blender guide: Blender - Play with SFM Models but because of the current bugs that I’m experiencing on Linux, I won’t be able to do some new demos for the guide.