-
-
Notifications
You must be signed in to change notification settings - Fork 54
Closed
Description
PR incoming, #778 introduced a bug.
I'll also add a basic test for controllers.
To reproduce:
from wgpu.gui.auto import WgpuCanvas, run
import pygfx as gfx
canvas = WgpuCanvas()
renderer = gfx.renderers.WgpuRenderer(canvas)
scene = gfx.Scene()
geometry = gfx.klein_bottle_geometry(10, stitch=False)
geometry.texcoords = None
material = gfx.MeshPhongMaterial(color=(1, 0.5, 0, 1), flat_shading=True)
obj = gfx.Mesh(geometry, material)
scene.add(obj)
camera = gfx.PerspectiveCamera(70, 1)
camera.show_object(obj)
scene.add(gfx.AmbientLight(), camera.add(gfx.DirectionalLight()))
def draw():
renderer.render(scene, camera)
canvas.request_draw()
controller = gfx.OrbitController(camera, register_events=renderer)
print(controller.cameras)
if __name__ == "__main__":
canvas.request_draw(draw)
run()
Results in:
Traceback (most recent call last):
File "/home/kushal/repos/pygfx/examples/feature_demo/geometry_klein_bottle.py", line 39, in <module>
print(controller.cameras)
^^^^^^^^^^^^^^^^^^
File "/home/kushal/repos/pygfx/pygfx/controllers/_base.py", line 93, in cameras
return tuple(cam for cam, _ in self._cameras)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/kushal/repos/pygfx/pygfx/controllers/_base.py", line 93, in <genexpr>
return tuple(cam for cam, _ in self._cameras)
^^^^^^
ValueError: too many values to unpack (expected 2)
Metadata
Metadata
Assignees
Labels
No labels