Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pyffi parse error NiTriShapeData #38

Closed
neomonkeus opened this issue Mar 22, 2017 · 1 comment · Fixed by #43
Closed

Pyffi parse error NiTriShapeData #38

neomonkeus opened this issue Mar 22, 2017 · 1 comment · Fixed by #43

Comments

@neomonkeus
Copy link
Member

@niftools/pyffi-reviewer

Issue Overview

Failure to parse NiTriShapeData in test_opt_dupgeomdata.nif

Version Information

Pyffi Version Info

2.2.3

Platform information

win32

Context

Execution of the

Steps to Reproduce

#. Update test_doctest.py to include niftoaster.txt
#. py.test -v /tests/test_doctests.py

Expected Result

Pyffi should be able to read the file without parsing error and pass the test

Actual Result

Pyffi is unable to read the file and throws an error

Possible Fix

[Optional, suggest fixes, improvement or reasons for the bug might have occurred]

Screenshot

N\A

Logs and Files

[Provide the generated log output and any accompanying files for the format related to the issue]

Console Output

'''
File "\pyffi\tests\formats\nif\niftoaster.txt", line 233, in niftoaster.txt
Failed example:
niftoaster.NifToaster().cli() # doctest: +REPORT_UDIFF
Differences (unified diff with -expected +actual):
@@ -117,7 +117,21 @@
pyffi.toaster:INFO: comparing file sizes
pyffi.toaster:INFO:=== tests/formats/nif/test_opt_dupgeomdata.nif ===
-pyffi.toaster:INFO: --- check_readwrite ---
-pyffi.toaster:INFO: writing to temporary file
-pyffi.toaster:INFO: comparing file sizes
+pyffi.nif.data:ERROR:Reading <class 'pyffi.formats.nif.NiTriShapeData'> failed
+Traceback (most recent call last):
+ File "\pyffi\pyffi\formats\nif_init_.py", line 1383, in read
+ block.read(stream, self)
+ File "\pyffi\pyffi\object_models\xml\struct_.py", line 354, in read
+ attr_value.read(stream, data)
+ File "\pyffi\pyffi\object_models\xml\array.py", line 300, in read
+ elem.read(stream, data)
+ File "\pyffi\pyffi\object_models\xml\struct_.py", line 354, in read
+ attr_value.read(stream, data)
+ File "\pyffi\pyffi\object_models\common.py", line 167, in read
+ stream.read(self._size))[0]
+struct.error: unpack requires a bytes object of length 2
+pyffi.toaster:ERROR:TEST FAILED ON tests/formats/nif/test_opt_dupgeomdata.nif
+pyffi.toaster:ERROR:If you were running a spell that came with PyFFI, then
+pyffi.toaster:ERROR:please report this as a bug (include the file) on
+pyffi.toaster:ERROR:https://github.com/niftools/pyffi/issues
'''

Similar Known Issues

N\A

Additional Information

This could be a nif.xml issue

@neomonkeus
Copy link
Member Author

neomonkeus commented Jun 9, 2017

Looks to be incorrect UV reading

* NiTriShapeData.num_uv_sets
0
* NiTriShapeData.has_uv
False
* NiTriShapeData.uv_sets
Array
* NiTriShapeData.num_triangles
3072
* NiTriShapeData.num_triangle_points

The num triangles for this nif should be 12, so it has already failed by that point.

Regression caused by -

Requires - niftools/nifxml#59

Need to revert

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant