-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
I'm experiencing an issue where calling view_update() for VtkRemoteView does not always work. It seems like the call might be throttled?
It results in a clunky user interface in this slicing example. After moving the plane widget in the scene on the left, the scene on the right should immediately update. However it does not always update, sometimes requireing a user-click in either of the two views for the one on the right to update
import pyvista as pv
from trame.app import get_server
from trame.ui.vuetify3 import SinglePageLayout
from trame.widgets import vtk as vtk_widgets
from trame.widgets import vuetify3 as vuetify
pv.OFF_SCREEN = True
server = get_server()
state, ctrl = server.state, server.controller
state.trame__title = "Multi Plotters"
mesh = pv.Wavelet()
pl1 = pv.Plotter()
pl1.add_mesh(mesh.contour())
pl1.reset_camera()
pl2 = pv.Plotter()
pl2.add_mesh(mesh.outline(), color='black')
pl2.reset_camera()
def my_callback(normal, origin):
pl2.add_mesh(mesh.slice(normal, origin), name="slice")
ctrl.view2_update() # <-- is this being throttled?
pl1.add_plane_widget(my_callback)
with SinglePageLayout(server) as layout:
layout.title.set_text("Multi Views")
layout.icon.click = ctrl.view_reset_camera
with layout.content:
with vuetify.VContainer(
fluid=True,
classes="pa-0 fill-height",
):
with vuetify.VCol(classes="pa-0 fill-height"):
view = vtk_widgets.VtkRemoteView(pl1.render_window, ref="view1")
ctrl.view1_update = view.update
with vuetify.VCol(classes="pa-0 fill-height"):
view = vtk_widgets.VtkRemoteView(pl2.render_window, ref="view2")
ctrl.view2_update = view.update
server.start()view-update.mov
Metadata
Metadata
Assignees
Labels
No labels