glTF export crashes with Python NameError
Description:
I'm trying to export a camera animation to a .glb file using the glTF-Blender-IO core add-on. After clicking the "Export glTF 2.0" button in the export dialog, no file is generated and instead a Python error occurs that I can view using the info panel in the bottom of the screen. The following three errors are listed in this order:
Python: Traceback (most recent call last):
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/__init__.py", line 1336, in draw
export_panel_data(layout, operator)
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/__init__.py", line 1412, in export_panel_data
if is_draco_available():
^^^^^^^^^^^^^^^^^^^^
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/__init__.py", line 161, in is_draco_available
is_draco_available.draco_exists = gltf2_io_draco_compression_extension.dll_exists()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/io/com/draco.py", line 69, in dll_exists
path = dll_path()
^^^^^^^^^^
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/io/com/draco.py", line 38, in dll_path
path = f"{site.getsitepackages()[0]}/libextern_draco.so"
^^^^
NameError: name 'site' is not defined. Did you mean: 'aiter'? Or did you forget to import 'site'?
Python: Traceback (most recent call last):
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/__init__.py", line 1336, in draw
export_panel_data(layout, operator)
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/__init__.py", line 1412, in export_panel_data
if is_draco_available():
^^^^^^^^^^^^^^^^^^^^
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/__init__.py", line 161, in is_draco_available
is_draco_available.draco_exists = gltf2_io_draco_compression_extension.dll_exists()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/io/com/draco.py", line 69, in dll_exists
path = dll_path()
^^^^^^^^^^
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/io/com/draco.py", line 38, in dll_path
path = f"{site.getsitepackages()[0]}/libextern_draco.so"
^^^^
NameError: name 'site' is not defined. Did you mean: 'aiter'? Or did you forget to import 'site'?
Python: Traceback (most recent call last):
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/__init__.py", line 1108, in execute
if is_draco_available():
^^^^^^^^^^^^^^^^^^^^
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/__init__.py", line 161, in is_draco_available
is_draco_available.draco_exists = gltf2_io_draco_compression_extension.dll_exists()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/io/com/draco.py", line 69, in dll_exists
path = dll_path()
^^^^^^^^^^
File "/usr/share/blender/4.3/scripts/addons_core/io_scene_gltf2/io/com/draco.py", line 38, in dll_path
path = f"{site.getsitepackages()[0]}/libextern_draco.so"
^^^^
NameError: name 'site' is not defined. Did you mean: 'aiter'? Or did you forget to import 'site'?
This process worked just fine when I tried it on version 17:4.2.3-4, the error only occurs now on version 17:4.3.0-1.
It looks like the issue is related to the force-draco2.patch. There, the module site
is used, but the patched file does not contain import site
. Therefore I assume that the issue is in the arch package as opposed to upstream.
Additional info:
- package version(s):
17:4.3.0-1
$ blender --version
Blender 4.3.0
build date: 2024-11-20
build time: 14:24:09
build commit date: 2024-11-19
build commit time: 08:52
build hash: 2b18cad88b13
build branch: makepkg (modified)
build platform: Linux
build type: Release
build c flags: -Wall -Werror=implicit-function-declaration -Wstrict-prototypes -Werror=return-type -Werror=vla -Wmissing-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wlogical-op -Wundef -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Wformat-signedness -Wrestrict -Wno-stringop-overread -Wno-stringop-overflow -Wnonnull -Wabsolute-value -Wuninitialized -Wredundant-decls -Wshadow -Wimplicit-fallthrough=5 -Wno-error=unused-but-set-variable -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/blender/src=/usr/src/debug/blender -march=x86-64-v2 -fopenmp -std=gnu11 -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off
build c++ flags: -Wuninitialized -Wredundant-decls -Wall -Wno-invalid-offsetof -Wno-sign-compare -Wlogical-op -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Werror=return-type -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wundef -Wcomma-subscript -Wformat-signedness -Wrestrict -Wno-suggest-override -Wuninitialized -Wno-stringop-overread -Wno-stringop-overflow -Wimplicit-fallthrough=5 -Wundef -Wmissing-declarations -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/blender/src=/usr/src/debug/blender -march=x86-64-v2 -fopenmp -pipe -fPIC -funsigned-char -fno-strict-aliasing -ffp-contract=off
build link flags: -Wl,--version-script='/build/blender/src/blender/source/creator/symbols_unix.map' -latomic
build system: CMake
- config: Error persists after deleting the
~/.config/blender/4.3
directory.
Steps to reproduce:
- Open blender without any cli arguments
- Create a simple camera keyframe animation, or open the attached .blend file camera-test-animation.blend
- Select "File" -> "Export" -> "glTF 2.0 (.glb/.gltf)
- Leave the options to the right at the defaults (format .glb, animation checked) and define an export filename
- Press "Export glTF 2.0"
- An error information quickly pops up and the bottom toolbar turns red
- Click the bottom toolbar to view the error details. Observe that no file has been created.