Why importing vtkmodules.vtkRenderingVolumeOpenGL2 is mandatory?

I have a simple VTKWeb app with a pytest integration. It works when I import every vtk object using import vtk.

I am trying to control the import better by importing directly from vtkmodules. Now the test is failing with this error: websocket._exceptions.WebSocketConnectionClosedException: Connection to remote host was lost. It works only if I import vtkmodules.vtkRenderingVolumeOpenGL2, which is not related to the app.

Here is a simple repo: GitHub - BotellaA/ReproduceVtk

By commenting this line, the project no longer works: ReproduceVtk/src/test_repo/vtk_protocol.py at main · BotellaA/ReproduceVtk · GitHub

I do not understand this behavior.

Thanks for the help.

This is explained here:

This import is needed because vtkRenderingOpenGL2 provides the OpenGL implementations of the classes in vtkRenderingCore

1 Like

Nice! Thanks for the link!