Skip to content
Discussion options

You must be logged in to vote

VtkLocalView has a on_ready event that you can listen to to see when reset_camera should be called.

Here is a gist of what you could do

def update_data(self):
    # ... update pipeline/data
    self.html_view.update()
    self.schedule_reset_camera = self.state.update_count + 1

@change("update_count")
def _on_update_count(self, update_count, **_):
    if update_count == self.schedule_reset_camera:
       self.html_view.reset_camera()

def _build_ui(self):
     with layout:
         # ...
         self.html_view = vtk_widgets.VtkLocalView(
              renderWindow,
              on_ready="update_count++",
         )

Another approach is to reset the camera on the server side (as you have…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@PaulHax
Comment options

Answer selected by PaulHax
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants