How to mix VtkLocalView with DockView #849
-
|
Hi, Here is my attempt to use VtkLocalView inside tabs created by DockView. The cone doesn't display and I get the error "JS Error => Can not forward events without a current renderer on the interactor." Could someone help me? Thank you very much. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
|
Hi, from trame.widgets import vtklocaland in your constructor call vtklocal.initialize(self.server)and then use this widget to render your VTK render window: with vtklocal.LocalView(self.window) as view:Also make sure you uncomment those lines: self.interactor = vtk.vtkRenderWindowInteractor()
self.interactor.SetRenderWindow(self.window)To enable the trackball camera interactor style you may use: self.interactor.GetInteractorStyle().SetCurrentStyleToTrackballCamera() # type: ignore[attr-defined]I ran your code with those modifications and latest dependecies using |
Beta Was this translation helpful? Give feedback.
-
|
Maybe @Jo-Byr or @finetjul have some ideas about why the interactor is failing with trame-vtk local rendering |
Beta Was this translation helpful? Give feedback.
-
|
Thank you very much for your quick help. Indeed, using vtklocal instead of vtkLocalView works perfectly, and I can now open vtk renderings in different tabs. I'm just getting started, but the framework seems really great! Thank you |
Beta Was this translation helpful? Give feedback.
Hi,
I am not sure why you are getting this error with trame-vtk vtkLocalView, but personally I'm not recommending using trame-vtk with the vtkLocalView. I personally find than trame-vtklocal works way better (it still have some problems though) that trame-vtk local rendering, that is a personal opinion though.
I see you are also import trame-vtklocal - I can help you for this one:
you have to import the widget this way:
and in your constructor call
and then use this widget to render your VTK render window:
Also make sure you uncomment those lines: