Gltf-blender-io: 2.90.1 or 2.83.8 export gltf crashes on ubuntu 20.10 but working on ubuntu 20.04 same machine

Created on 24 Oct 2020  路  20Comments  路  Source: KhronosGroup/glTF-Blender-IO

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

.blend file/ .gltf
If applicable, a zipped folder containing a .blend file for exporter issues and a .gltf file for importer issues. Please take care to include all resources, such as textures in the .zip file.

Version

  • OS: [e.g. macOS, linux]
  • Blender Version [e.g. 2.82, 2.83, or build date]

Additional context
Add any other context about the problem here.

question

Most helpful comment

Oh, well if you can't import numpy, then there's no workaround. We need that to do anything :/

I'd try filing a bug with either Blender or Ubuntu telling them you can't do import numpy or import ctypes from Blender. Sorry, that's all I can tell you.

All 20 comments

Hello,
You didn't fill any information that are in the template.
We can't investigate without these data (for example test file).
Regarding the title, please indicate how you get blender : from apt-get or from downloading from https://www.blender.org/download/

I use default cube scene.
I tried both snap installation and without an installation, running from extracted folder
blender-2.90.1-linux64.tar.xz
blender-2.83.8-linux64.tar.xz
before ugrade new operation system ubuntu 20.10
I was using ubuntu 20.04 and it was working
now on ubuntu 20.10 other export methods works. just gltf crashes
I run from terminal to get error message but I dont know how to find the "core dumped" file

:~/$ blender
Read prefs: /home/u/.config/blender/2.90/config/userpref.blend
/run/user/1000/snap.blender/gvfs/ non-existent directory
found bundled python: /snap/blender/47/2.90/python
Aborted (core dumped)

:~/Downloads/blender-2.90.1-linux64$ ./blender
Read prefs: /home/u/.config/blender/2.90/config/userpref.blend
found bundled python: /home/u/Downloads/blender-2.90.1-linux64/2.90/python
Aborted (core dumped)

Seams your problem is linked to your operating system, not from this addon.
Anyone else tested the newly out ubuntu 20.10?

Suspect a problem with the draco .so. After you unpack Blender, find a file named something like

2.90/python/lib/python3.7/site-packages/libextern_draco.so

and delete it.

I deleted "libextern_draco.so" but nothing changed

It crashes really early, before this line finishes, because you're not even getting the message about if the draco .so was found.

Try replacing the __init__ function there with

py def __init__(self): print('got to init') self.is_draco_available = False

and see if it prints the message.

I update the file. this time save diyalog opened and when I press "export gltf2" button then It crashed. before update this file. It doesnt open the save dialog

the terminal message

Read prefs: /home/u/.config/blender/2.90/config/userpref.blend
found bundled python: /home/u/Downloads/blender-2.90.1-linux64/2.90/python
got to init
Aborted (core dumped)

Okay, try this and see what it prints

py def __init__(self): print('got to A') from io_scene_gltf2.io.exp import gltf2_io_draco_compression_extension print('got to B') self.is_draco_available = gltf2_io_draco_compression_extension.dll_exists() print('got to C')

found bundled python: /home/u/Downloads/blender-2.90.1-linux64/2.90/python
got to A
Aborted (core dumped)

Try

````py

def __init__(self):
    print('got to A')
    import bpy
    print('got to 1')
    import sys
    print('got to 2')
    from ctypes import c_void_p, c_uint32, c_uint64, c_bool, c_char_p, cdll
    print('got to 3')
    from pathlib import Path
    print('got to 4')
    import struct
    print('got to 5')
    from io_scene_gltf2.io.exp import gltf2_io_draco_compression_extension
    print('got to B')
    self.is_draco_available = gltf2_io_draco_compression_extension.dll_exists()
    print('got to C')

````

got to A
got to 1
got to 2
Aborted (core dumped)

I thought it would be that.

Can you open Blender, switch to a Python Console, put from ctypes import c_void_p, c_uint32, c_uint64, c_bool, c_char_p, cdll at the prompt, and see if it crashes?

yes it crasched again. and I tried first
from ctypes import c_void_p, c_uint32, c_uint64, c_bool, c_char_p, cdll
then the less combinations like
from ctypes import c_void_p
or
from ctypes import cdll
all of them crashed
then I run python on terminal and try to import again but didnt crashed

it crashed in the blender console

Okay, cool. Thanks for doing all that. The problem is importing ctypes then. You could also try running the Python located in the Blender dir at 2.90/python/bin/ in terminal and seeing if the crashes there too.

So yeah, this isn't really a problem with this addon. I guess you could file it upstream with Blender (or Ubuntu?).

In the meantime, here's a workaround that should make glTF export work. Modify io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py like this.

````diff
diff --git a/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py b/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py
index 2bb79aa..7824964 100644
--- a/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py
+++ b/addons/io_scene_gltf2/io/exp/gltf2_io_draco_compression_extension.py
@@ -14,7 +14,6 @@

import bpy
import sys
-from ctypes import c_void_p, c_uint32, c_uint64, c_bool, c_char_p, cdll
from pathlib import Path
import struct

@@ -59,6 +58,7 @@ def compress_scene_primitives(scenes, export_settings):
Invoked after data has been gathered, but before scenes get traversed.
Moves position, normal and texture coordinate attributes into a Draco compressed buffer.
"""

  • from ctypes import c_void_p, c_uint32, c_uint64, c_bool, c_char_p, cdll
 # Load DLL and setup function signatures.
 # Nearly all functions take the compressor as the first argument.

````

This only imports ctypes if we need it, which is only when you turn on mesh compression (Geometry > Compression on the export screen). As long as you keep that off, ctypes won't be imported, so you won't crash.

(You might also test if import numpy works. We need that too.)

import numpy also crasched

I tried blender located python3.7m. it works for all imports ctype and numpy. but not working in the python console in blender

then I make the change you did in the file "gltf2_io_draco_compression_extension.py" - and + updates. but gltf export is dissappered in the export menu

Oh, well if you can't import numpy, then there's no workaround. We need that to do anything :/

I'd try filing a bug with either Blender or Ubuntu telling them you can't do import numpy or import ctypes from Blender. Sorry, that's all I can tell you.

thank you very much

Ok, as suggested by scurest, I propose you to fill a bug with either Blender or Ubuntu teams.
I am going to close this ticket. Don't hesitate to comment if you want to add something.
Thanks ! (and sorry to not be able to help on that specific subject)

@scurest Thougth you ping me me that, but I can't find it anymore.

This bug has made its way upstream to Blender: https://developer.blender.org/T84752. There is a workaround there in case it helps anyone.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

donmccurdy picture donmccurdy  路  5Comments

UX3D-nopper picture UX3D-nopper  路  4Comments

KannebTo picture KannebTo  路  3Comments

capnm picture capnm  路  5Comments

cstfan picture cstfan  路  4Comments