-
Notifications
You must be signed in to change notification settings - Fork 255
Closed
Description
With the new version 0.1.40 on windows (and possibly macOS, haven't tested) the offscreen renderer fails with:
Traceback (most recent call last):
File "[...]/scratch_1.py", line 18, in <module>
renderer.render(scene)
File "C:\tools\Anaconda3\envs\tra-sim-datacollection\lib\site-packages\pyrender\offscreen.py", line 109, in render
self._platform.make_uncurrent()
File "C:\tools\Anaconda3\envs\tra-sim-datacollection\lib\site-packages\pyrender\platforms\pyglet_platform.py", line 54, in make_uncurrent
pyglet.gl.xlib.glx.glXMakeContextCurrent(self._window.context.x_display, 0, 0, None)
AttributeError: module 'pyglet.gl' has no attribute 'xlib'
Process finished with exit code 1
Old versions <= 0.1.39 were fine
Sample code:
from pyrender import Mesh, Scene, OffscreenRenderer, PerspectiveCamera, RenderFlags
from io import BytesIO
import numpy as np
import trimesh
import requests
duck_source = "https://github.com/KhronosGroup/glTF-Sample-Models/raw/master/2.0/Duck/glTF-Binary/Duck.glb"
duck = trimesh.load(BytesIO(requests.get(duck_source).content), file_type='glb')
duckmesh = Mesh.from_trimesh(list(duck.geometry.values())[0])
scene = Scene(ambient_light=np.array([1.0, 1.0, 1.0, 1.0]))
scene.add(duckmesh)
camera = PerspectiveCamera(60)
scene.add(camera)
renderer = OffscreenRenderer(640, 480)
renderer.render(scene)
Metadata
Metadata
Assignees
Labels
No labels