Open3D
Open3D copied to clipboard
Accessing O3DVisualizer inherited methods from Window class in Python
Is there a way to access O3DVisualizer inherited member methods from Window class in Python so we can add additional controls to the O3DVisualizer and therefore expand its capabilities beside only adding buttons via add_action method? Or if not from O3DVisualizer directly, is there at least an ability to gain access to to currently active Window from Application.instance?
I believe this is technically possible with pybind11, but we don't explicitly support adding functionality to pybind classes in Python. This looks like a good feature to have.
@dd-ff did you try creating a new subclass inheriting from O3DVisualizer? Did that work?
Creating a derived class from O3DVisualizer in Python doesn't give access to member methods like set_on_menu_item_activated from the Window superclass. (I tried it just to make sure)
If I were to make that in C++ it would of course work because it is a public inheritance.
Therefore it would be great if we could in Python somehow gain access to the underling window O3DVisualizer rests in or at least functions like add_child and set_on_menu_item_activated .
For example we can currently add new menu items using object o3d.visualization.gui.Application.instance.menubar but we cannot do anything with them since new event handling is done by the Window class member set_on_menu_item_activated and we don't have access to the current active Window object...