Open InquisitiveAS opened 1 year ago
master
I want to start with basic example of adding a button inside my GUI which will have Keycallback function to load different geometry types
import open3d as o3d def load_geometry(vis_Button): file_path = o3d.utility.FileDialog.get_open_file_name("Select a geometry file.") if file_path: ext = file_path.split(".")[-1] if ext == "ply": geometry = o3d.io.read_point_cloud(file_path) elif ext == "txt": geometry = o3d.io.read_point_cloud(file_path, format="xyz") elif ext == "stl": geometry = o3d.io.read_triangle_mesh(file_path) elif ext == "obj": geometry = o3d.io.read_triangle_mesh(file_path) else: print("Unsupported geometry file format!") return vis_Button.add_geometry(geometry) vis = o3d.visualization.VisualizerWithKeyCallback() vis.create_window() vis.register_key_callback(ord('a'), lambda vis: load_geometry(vis))
With GUI, you can only use O3DVisualizer (or APIs in visualization.renderingand visualization.gui namespaces). We do plan to make this easier to track in future releases. @errissa
O3DVisualizer
visualization.rendering
visualization.gui
Thanks for the update!
Checklist
master
branch).My Question
I want to start with basic example of adding a button inside my GUI which will have Keycallback function to load different geometry types
My Code