Disable 3D model rotation in new event

Hello everyone,

In vtk.js I have additional functionality that requires using the left mouse button. By default, the left mouse button is responsible for rotating the 3D model. Can I disable rotation in a new event and enable rotation after event is over?

For example:

// Add rotation
const interactorStyle = vtkInteractorStyleManipulator.newInstance()
interactor.setInteractorStyle(interactorStyle)
const rotateManipulator =
  vtkMouseCameraTrackballRotateManipulator.newInstance()
rotateManipulator.setUseFocalPointAsCenterOfRotation(true)
rotateManipulator.setButton(1)
interactorStyle.addMouseManipulator(rotateManipulator)

interactor.onLeftButtonPress((e) => {
// Disable rotation - ?
// Grab something
})

interactor.onMouseMove((e) => {
// Move something
})

interactor.onLeftButtonRelease((e) => {
// Release something
// Enable rotation - ?
})

It depends what/how you want to ‘grab’.
VTK widgets takes precedence over the interactor style. So events go first to widgets, and if not consumed, it is left to the interactor.
So maybe the “grab” functionality could be handled by a widget.
Alternatively, you can look at the Unicam manipulator that has different behaviors depending on where you clik.

(for information, it is not the model that rotates but the camera that rotates around the model)

Thanks for your answer. I need to grab a secondary actor, let’s say a small sphere, but not a widget (a widget is not suitable for this case).

Apart from Unicam manipulator, there is no built-in way to disable the default behavior inside interactor.onLeftButtonPress/Release(), taking into account that my interactorStyle is roughly custom, i.e. it is not just vtkInteractorStyleTrackballCamera.newInstance(), which should give more possibilities?

What works now is using the left mouse button events and a keyboard key (like ALT), but it’s not that convenient…