VTK/WASM and ImplicitPlaneWidget2 for a cross-section widget?

Hi @uv382!

Noting here for the wider audience that @uv382 is using VTK.wasm through trame-vtklocal package.

When incorporating widgets in such projects, they require special handling in server-side to properly (de)serialize across the boundary between python and WASM land.

The solution for your issue is to manually register the widgets with the scene manager. Otherwise, the widget is not visible to the marshalling layer. This explains why the widget disappears in your web client.

I suggest studying the trame-vtklocal/examples/vtk/widgets_plane.py and, the other widgets_* files in there.

fyi, @Sebastien_Jourdain

1 Like