FS#68994 - [blender] glTF/glb import fails due to Python exception

Attached to Project: Community Packages
Opened by Aaron Barany (akb825) - Tuesday, 15 December 2020, 22:45 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Tuesday, 22 December 2020, 00:42 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
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 import a glTF/glb file in Blender, it fails due to an unexpected keyword exception in Python. (see attached screenshot) This is because Python 3.9 removed the "encoding" argument in the json.loads(). Removing the "encoding" argument in /usr/share/blender/2.91/scripts/addons/io_scene_gltf2/io/imp/gltf2_io_gltf.py line 64 fixes the issue.

It can be argued that this is an upstream issue, but currently the cause is an incompatibility between Blender and the version of Python shipped with Arch.

Additional info:
blender 17:2.91.0-6
python 3.9.1-1
Upstream bug report: https://github.com/KhronosGroup/glTF-Blender-IO/issues/1295

Steps to reproduce:
1. Open blender with a new project.
2. Import a glTF or glb file through File -> Import -> glTF 2.0 (.glb/.gltf)
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Tuesday, 22 December 2020, 00:42 GMT
Reason for closing:  Fixed
Comment by Aaron Barany (akb825) - Wednesday, 16 December 2020, 18:40 GMT
The upstream bug was closed with the following comment:

Blender is bundled with its own python interpreter, that is the only python version that is officially supported.
For 2.91, this is 3.7.7

The person who made the original change followed up acknowledging that the parameter has been deprecated even in the Python version they bundle. Hopefully that means they'll have a fix available before too long, but I don't know what that means as far as Arch's package is concerned.
Comment by Sven-Hendrik Haase (Svenstaro) - Sunday, 20 December 2020, 04:44 GMT
Could you make a small patch that makes it work for you? I'll then build a new package.
Comment by Aaron Barany (akb825) - Monday, 21 December 2020, 01:14 GMT
I've attached a patch that fixes the proper file within the src directory when building the PKGBUILD. The build fails for me when compiling the cuda files, so I wasn't able to test the final built package, but I verified that it works when patching the same script in my installed package.
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 21 December 2020, 09:08 GMT
Should be fixed now in rel -8. Please check.
Comment by Aaron Barany (akb825) - Monday, 21 December 2020, 22:56 GMT
I did a full reinstall of Blender to make sure my local changes were reset and it looks like it's working. Thanks!

Loading...