dagoma3d / CuraByDagoma

Cura by Dagoma was originally forked from Legacy Cura. It is a UI to generate gcodes from 3d objects.
14 stars 8 forks source link

python3 opengl breaks with wayland on ubuntu 23.04 #134

Closed lissyx closed 1 year ago

lissyx commented 1 year ago

With latest available deb package,


$ curabydago
Load preferences from /home/alex/.curaByDagoma/2.2.2/preferences.ini
11:24:52: Debug: Adding duplicate image handler for 'Windows bitmap file'
11:24:52: Debug: Adding duplicate animation handler for '1' type
11:24:52: Debug: Adding duplicate animation handler for '2' type
Listening for engine communications on 49674
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/OpenGL/latebind.py", line 43, in __call__
    return self._finalCall( *args, **named )
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/curabydago/Cura/gui/util/openglGui.py", line 227, in _OnGuiPaint
    self.OnPaint(e)
  File "/usr/share/curabydago/Cura/gui/sceneView.py", line 1345, in OnPaint
    self._drawMachine()
  File "/usr/share/curabydago/Cura/gui/sceneView.py", line 1517, in _drawMachine
    self._renderObject(self._platformMesh[machine], False, False)
  File "/usr/share/curabydago/Cura/gui/sceneView.py", line 1435, in _renderObject
    m.vbo.render()
  File "/usr/share/curabydago/Cura/gui/util/openglHelpers.py", line 200, in render
    glVertexPointer(3, GL_FLOAT, 2*3*4, c_void_p(0))
  File "/usr/lib/python3/dist-packages/OpenGL/latebind.py", line 47, in __call__
    return self._finalCall( *args, **named )
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/OpenGL/wrapper.py", line 818, in wrapperCall
    storeValues(
  File "/usr/lib/python3/dist-packages/OpenGL/arrays/arrayhelpers.py", line 156, in __call__
    contextdata.setValue( self.constant, pyArgs[self.pointerIndex] )
  File "/usr/lib/python3/dist-packages/OpenGL/contextdata.py", line 58, in setValue
    context = getContext( context )
              ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/OpenGL/contextdata.py", line 40, in getContext
    raise error.Error(
OpenGL.error.Error: Attempt to retrieve context when no valid context
lissyx commented 1 year ago

Forcing X11/XWayland with PYOPENGL_PLATFORM=x11 curabydago works it seems.

0r31 commented 1 year ago

Hi @lissyx ,

I remember adding some stuff regarding Wayland users : https://github.com/dagoma3d/CuraByDagoma/commit/b099cc7a336aacbee34184b219a62e02b4fd15c8

Seems it is not enough anymore, will force the PYOPENGL_PLAFORM as you mentioned. Thanks !