isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.17k stars 2.27k forks source link

LineSet visualization leads to spam in terminal #4921

Open melecmat opened 2 years ago

melecmat commented 2 years ago

Checklist

Describe the issue

I am trying to visualize bounding boxes in Open3D. I convert them to LineSet and then add them into an Open3DScene. Every time the a LineSet is added to the scene, something prints to the terminal warning message.

You can imagine that this gets quite annoying when you add lot of LineSets (or add LineSet per frame of visualization) and it hides the other terminal output.

Below I provide a minimal functioning code that leads to this.

Thanks!

Steps to reproduce the bug

import numpy as np
from open3d import geometry, utility
from open3d.visualization import rendering, gui

if __name__ == "__main__":
    gui.Application.instance.initialize()
    window = gui.Application.instance.create_window("window", 1920, 1080)
    scene = rendering.Open3DScene(window.renderer)
    material = rendering.MaterialRecord()
    material.shader = "defaultLit"

    # add line to scene
    points = utility.Vector3dVector(np.array([[0,0,0], [1,1,1]]))
    lines = utility.Vector2iVector(np.array([[0, 1]]))
    scene.add_geometry("line", geometry.LineSet(points, lines), material)
    gui.Application.instance.run()

Error message

[entity=51, primitive @ 0] missing required attributes (0xd), declared=0x5]

Expected behavior

No spam in terminal.

Open3D, Python and System information

- Ubuntu 20.04
- Python version: Python 3.8.10
- Open3D version: 0.15.2
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip

Additional information

No response

melecmat commented 2 years ago

Setting material as per https://github.com/isl-org/Open3D/blob/master/examples/python/visualization/line_width.py fixes the issue.