FS#77376 - [blender] Unable to import glTF 2.0 models due to removed numpy attribute.

Attached to Project: Community Packages
Opened by Aaron Barany (akb825) - Saturday, 04 February 2023, 00:19 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Wednesday, 08 February 2023, 03:43 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
freswa (frederik)
Filipe Laíns (FFY00)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
When attempting to load a glTF 2.0 model within Blender, an error is triggered due to numpy having removed a deprecated name for an attribute. This attribute was marked as deprecated in numpy 1.20 and removed in the 1.24 release.
I can fix the error locally by opening /usr/share/blender/3.4/scripts/addons/io_scene_gltf2/blender/imp/gltf2_blender_mesh.py and changing "np.bool" to "np.bool_" on line 612. The final line should be:

poly_smooths = np.empty(num_polys, dtype=np.bool_)

Additional info:
* package version: blender 17:3.4.1-10, used with numpy 1.24 (such as with the python-numpy package)
* Upstream numpy change removing the deprecated attribute: https://github.com/numpy/numpy/pull/22607
* See attached error message from Blender.

Steps to reproduce:
1. Go to File -> Import -> glTF 2.0 (.glb/.gltf) menu option.
2. Select a .gltf or .glb file to load.
3. Observe the error due to removed attribute.

This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Wednesday, 08 February 2023, 03:43 GMT
Reason for closing:  Fixed
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 06 February 2023, 23:45 GMT
I can patch it downstream. However, could you also go ahead and report this upstream so that they can address this?
Comment by Sven-Hendrik Haase (Svenstaro) - Tuesday, 07 February 2023, 00:34 GMT
Should be patched now. Please check whether it now works fine for you. :)
Comment by Aaron Barany (akb825) - Wednesday, 08 February 2023, 00:44 GMT
Thanks, looks like it's working now.

I can see if I can report it upstream, though last time I submitted a similar issue they responded that they only support the embedded version of Python they ship with the binary releases.
Comment by Aaron Barany (akb825) - Wednesday, 08 February 2023, 00:45 GMT
I tracked down the project and it looks like someone else already reported it upstream: https://github.com/KhronosGroup/glTF-Blender-IO/issues/1844
Comment by Sven-Hendrik Haase (Svenstaro) - Wednesday, 08 February 2023, 03:43 GMT
Great, thanks for checking! Closing.

Loading...