Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable/Disable interaction #260

Closed
GuillaumeFavelier opened this issue Oct 14, 2020 · 3 comments
Closed

Enable/Disable interaction #260

GuillaumeFavelier opened this issue Oct 14, 2020 · 3 comments

Comments

@GuillaumeFavelier
Copy link

Hello PyVista community! I would like to know if there is a way to disable interactions with the plotter completely (mouse, keyboard, ...) temporarily. It could be restored afterwards. Ideally, I am looking for something like enable/disable.

If such a feature is not available yet and you know a way to accomplish this, I would be happy to open a PR to add it with your guidance.

This is useful for a specific use case (mne-tools/mne-python#8363).

@banesullivan
Copy link
Member

The renderers have both enable()/disable() methods to do tjust this which are wrapped by the plotter for the current active renderer:

>>> import pyvista as pv
>>> p = pv.Plotter()
>>> p.add_mesh(pv.Cube())
>>> p.disable()
>>> p.show()
# non-interactive plot shown

@banesullivan
Copy link
Member

I do this often for ortho slicing where I only want the 3D view to be interactive and have the other slices views remain still in a parallel projection, e.g. pyvista/pyvista#263

@GuillaumeFavelier
Copy link
Author

Thank you so much for your quick answer @banesullivan ! I missed this feature completety 😅

Sadly, it does not directly solve my particular issue so I think it's something specific to mne-python or pyvistaqt. Anyway, it's a step forward 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants