Why does Open3d Visualization disappear when I left click the window? #4964
-
I try to write a simple application in python which views a 3d mesh on the right and have some user input on the left in a single window. I use a SceneWidget to visualize a mesh and add it to a horizontal gui element. I also add a filepicker to that gui element and then add the gui element to the window. So far so good it seems that it works as intended but as soon as I make a left click inside the window the visualization disappears with no error message. Does anyone have an idea why and can help me? Here is the code:
I use the open3d library version 0.15.1 and python3.9. Note - If I add the SceneWidget directly to the window it works, but then I can't have the gui on the left. Does anyone have a solution to this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Finally I found a solution: Adding a Scenewidget to a gui container doesn't seem to work. But encapsulating it inside a frame and move it to the right side and add it directly to the window works. Here is the working code for anyone interested:
|
Beta Was this translation helpful? Give feedback.
Finally I found a solution: Adding a Scenewidget to a gui container doesn't seem to work. But encapsulating it inside a frame and move it to the right side and add it directly to the window works.
_widget3d.frame = gui.Rect(500, w.content_rect.y, 900, w.content_rect.height)
Creating a frame for the gui in a similar way is also possible.
Here is the working code for anyone interested: