isl-org / isl-org/Open3D

Broken mouse handler when scene widget is contained by layout

Open
#5,268 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

Minimal working / broken example:

```
import open3d as o3d
import open3d.visualization.gui as gui
import open3d.visualization.rendering as rendering

gui.Application.instance.initialize()
window = gui.Application.instance.create_window()
scene_widget = gui.SceneWidget()
scene_widget.scene = rendering.Open3DScene(window.renderer)
scene_widget.set_view_controls(gui.SceneWidget.Controls.ROTATE_CAMERA)
knot_mesh = o3d.data.KnotMesh()
knot = o3d.io.read_triangle_mesh(knot_mesh.path)
scene_widget.scene.add_geometry('knot', knot, rendering.MaterialRecord())
bbox = o3d.geometry.AxisAlignedBoundingBox([-50, -50, -50], [50, 50, 50])
scene_widget.setup_camera(60, bbox, [0, 0, 0])

def broken():
layout = gui.Horiz()
layout.add_child(scene_widget)
window.add_child(layout)

def works():
window.add_child(scene_widget)

broken()

gui.Application.instance.run()
```

To observe the bug, run the script and gaze at the glorious knot that appears in both the working and not working examples.

Click the mouse anywhere in the window. On my rig, the whole window goes blank.

Next, change `broken()` to `works()`. Run again, and the same click will now correctly move the camera.

Is there any fundamental reason why I cannot put two SceneWidgets in a Horiz layout?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the provided Python minimal example and compare the broken() and works() cases. Trace SceneWidget mouse handling when the widget is added to a gui.Horiz layout; done means a nested SceneWidget remains visible after a click and camera controls continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
computer-graphics, desktop-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.