Skip to content

struct.error when reading nif.xml #67

@FeuerTiger86

Description

@FeuerTiger86

@niftools/blender-nif-plugin-reviewer -

Before creating a new issue, ensure that

  • Read the user documentation.
  • Check that the issue hasn't already been reported.
  • Read through the list of Helpful resources links on the right-hand side.
  • Talk with the developers to ensure its a valid issue

The issue will get closed off immediately as invalid if

  • Looking for support where the forums, chat or documentation is more appropriate.
  • Goes off topic, loses focus or turns into a discussion.
  • Removing parts of the template the issue.

Fill out the template below to the best of your ability, including .blend files, nifs, logs; help us to help you.

Issue Overview

Plugin doesn't work with the portable (zip) version of Blender 2.79b.

Version Information

Blender Nif Plugin Version Info

2.6.0a0.dev4-2019-11-24

Blender Version Info

2.79b portable (zip)

Platform information

Windows 10 Professional 64bit

Context

Unfortunately, Blender 2.79b cannot be installed alongside 2.8x and is automatically uninstalled when installing the new version. Therefore I tried using the portable (zip) version of 2.79b instead, which does not need to be installed and works with 2.8x installed at the same time.

However, the nif plugin no longer works in this version, as I get this error when trying to import a model:

struct.error: unpack requires a bytes object of length 2
ERROR:pyffi.nif.data:Reading <struct 'NiTriShapeData'> failed

The console shows a lot more messages related to the various .py files and in the end it says:

location: <unknown location>:-1

Exporting does not produce an error, but the model is not exported correctly and cannot be opened in Nifskope.

I tried uninstalling 2.8x and installing 2.79b again, but the installer says a newer version is already installed and exits.

Steps to Reproduce

Happens whenever I import or export a model.

Expected Result

See above.

Actual Result

See above

Possible Fix

Screenshot

Logs and Files

Info Bar Output

bpy.data.window_managers["WinMan"].addon_search = "nif"
bpy.ops.object.select_all(action='TOGGLE')
bpy.ops.object.select_all(action='TOGGLE')
bpy.ops.object.delete(use_global=False)
bpy.context.space_data.recent_folders_active = 0
bpy.context.space_data.recent_folders_active = 1
bpy.context.space_data.recent_folders_active = 1
Executing - Niftools : Blender Nif Plugin v2.6.0 (running on Blender 2.79 (sub 0), PyFFI 2.2.4.dev2)
Importing D:\Spiele\Bethesda Softworks\Morrowind_EV_GOG\Data Files\Meshes\o\contain_barrel10.nif
NIF file version: 67108866
Reading file
Finished
Traceback (most recent call last):
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\operators\nif_import_op.py", line 156, in execute
    return nif_import.NifImport(self, context).execute()
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\nif_import.py", line 110, in execute
    self.data = NifFile.load_nif(NifOp.props.filepath)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\io\nif.py", line 64, in load_nif
    nif_data.read(nif_stream)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\formats\nif\__init__.py", line 1383, in read
    block.read(stream, self)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\xml\struct_.py", line 373, in read
    attr_value.read(stream, data)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\xml\array.py", line 303, in read
    elem.read(stream, data)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\xml\struct_.py", line 373, in read
    attr_value.read(stream, data)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\common.py", line 167, in read
    stream.read(self._size))[0]
struct.error: unpack requires a bytes object of length 2

location: <unknown location>:-1

Console Output

pyffi.nif.data:ERROR:Reading <struct 'NiTriShapeData'> failed
Traceback (most recent call last):
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\formats\nif\__init__.py", line 1383, in read
    block.read(stream, self)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\xml\struct_.py", line 373, in read
    attr_value.read(stream, data)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\xml\array.py", line 303, in read
    elem.read(stream, data)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\xml\struct_.py", line 373, in read
    attr_value.read(stream, data)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\common.py", line 167, in read
    stream.read(self._size))[0]
struct.error: unpack requires a bytes object of length 2
ERROR:pyffi.nif.data:Reading <struct 'NiTriShapeData'> failed
Traceback (most recent call last):
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\formats\nif\__init__.py", line 1383, in read
    block.read(stream, self)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\xml\struct_.py", line 373, in read
    attr_value.read(stream, data)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\xml\array.py", line 303, in read
    elem.read(stream, data)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\xml\struct_.py", line 373, in read
    attr_value.read(stream, data)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\common.py", line 167, in read
    stream.read(self._size))[0]
struct.error: unpack requires a bytes object of length 2
Traceback (most recent call last):
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\operators\nif_import_op.py", line 156, in execute
    return nif_import.NifImport(self, context).execute()
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\nif_import.py", line 110, in execute
    self.data = NifFile.load_nif(NifOp.props.filepath)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\io\nif.py", line 64, in load_nif
    nif_data.read(nif_stream)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\formats\nif\__init__.py", line 1383, in read
    block.read(stream, self)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\xml\struct_.py", line 373, in read
    attr_value.read(stream, data)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\xml\array.py", line 303, in read
    elem.read(stream, data)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\xml\struct_.py", line 373, in read
    attr_value.read(stream, data)
  File "C:\Users\User\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\io_scene_nif\dependencies\pyffi\object_models\common.py", line 167, in read
    stream.read(self._size))[0]
struct.error: unpack requires a bytes object of length 2

location: <unknown location>:-1

location: <unknown location>:-1

Blend File

Happens for every model

Nif File

Happens for every model

Similar Known Issues

Additional Information

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions