Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot run example with x3d backend #1317

Open
beew opened this issue Sep 25, 2024 · 0 comments
Open

cannot run example with x3d backend #1317

beew opened this issue Sep 25, 2024 · 0 comments

Comments

@beew
Copy link

beew commented Sep 25, 2024

Hi, I am trying to run the example notebook https://github.com/enthought/mayavi/blob/master/examples/mayavi/mayavi_jupyter.ipynb

But running the cells

mlab.init_notebook(backend='x3d', local=True) 
mlab.figure()

Note the use of the figure here to create a new visualization.
s = mlab.test_points3d()
s

produces an error

ttributeError                            Traceback (most recent call last)
File ~/lib/python3.10/site-packages/IPython/core/formatters.py:922, in IPythonDisplayFormatter.__call__(self, obj)
    920 method = get_real_method(obj, self.print_method)
    921 if method is not None:
--> 922     method()
    923     return True

File ~/lib/python3.10/site-packages/mayavi/tools/notebook.py:31, in _ipython_display_(self)
     22 def _ipython_display_(self):
     23     '''Method attached to Mayavi objects.
     24 
     25     Note that here `self` is the Mayavi object that is going to be
   (...)
     29 
     30     '''
---> 31     return _backend.display(self)

File ~/lib/python3.10/site-packages/mayavi/tools/notebook.py:208, in X3DBackend.display(self, obj)
    205 elif hasattr(obj, 'scene'):
    206     scene = obj.scene
--> 208 return idisplay(HTML(self.scene_to_x3d(scene)))

File ~/lib/python3.10/site-packages/mayavi/tools/notebook.py:228, in X3DBackend.scene_to_x3d(self, scene)
    226 def scene_to_x3d(self, scene):
    227     ex = tvtk.X3DExporter()
--> 228     ex.input = scene.render_window
    229     lm = scene.light_manager.light_mode
    230     # The default raymond mode is too bright so switch back to vtk mode.

AttributeError: 'NoneType' object has no attribute 'render_window'

<mayavi.modules.glyph.Glyph at 0x725f0e0ea250>

OS Ubuntu 22.04
Python3.10.9
Mayavi 4.8.2
vtk9.3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant