marcomusy / vedo

A python module for scientific analysis of 3D data based on VTK and Numpy
https://vedo.embl.es
MIT License
2.03k stars 265 forks source link

Regression: Plots not working in jupyter environment #994

Closed JeffreyWardman closed 9 months ago

JeffreyWardman commented 9 months ago

Regression after 2023.5.0+dev8. Tested the commit and the commit before and the regression occurs in https://github.com/marcomusy/vedo/commit/2c8fccc5eb55a099f2b7559d2f56c0d21fd74e81

AttributeError                            
Traceback (most recent call last)
Cell In[6], line 2
      1 vedo.settings.default_backend="2d"
----> 2 plotter = vedo.Plotter(axes=1, shape=(1,4))
      3 plotter.at(0).show(vedo.Points(pts1), zoom=1.3)
      4 plotter.at(1).show(vedo.Points(pts2), zoom=1.3)

File .venv/lib/python3.10/site-packages/vedo/plotter.py:723, in Plotter.__init__(self, shape, N, pos, size, screensize, title, bg, bg2, axes, sharecam, resetcam, interactive, offscreen, qt_widget, wx_widget)
    721 #########################################################
    722 for r in self.renderers:
--> 723     self.window.AddRenderer(r)
    724     # set the background gradient if any
    725     if settings.background_gradient_orientation > 0:

AttributeError: 'NoneType' object has no attribute 'AddRenderer'
marcomusy commented 9 months ago

..should now be fixed on master.

JeffreyWardman commented 9 months ago

Works both within Jupyter and in an external window :+1:

konris87 commented 6 months ago

Greetings,

I apologize to bring this up again. I have some issues when using the ''ipyvtklink'' backend in jupyter.

First, if i don't specify a size then the plotter object throws an error as reported here: https://github.com/marcomusy/vedo/issues/1033

However, when I define and pass a custom size then the same issue as in the opening post occurs.

P.S I was using vedo 23.4.4 without issues in Jupyter.

Thanks in advance, Kostas