pyvista.Plotter.enable_custom_trackball_style#

Plotter.enable_custom_trackball_style(
left='rotate',
shift_left='pan',
control_left='spin',
middle='pan',
shift_middle='pan',
control_middle='pan',
right='dolly',
shift_right='environment_rotate',
control_right='dolly',
)[source]#

Set the interactive style to a custom style based on Trackball Camera.

For each choice of button, control-button, and shift-button, the behavior when the mouse is moved can be chosen by passing the following strings:

  • "dolly"

  • "environment_rotate"

  • "pan"

  • "rotate"

  • "spin"

None can also be passed, which also results in the default behavior.

Added in version 0.44.0.

Parameters:
leftstr, default: “rotate”

Action when the left button is clicked and the mouse is moved.

shift_leftstr, default: “pan”

Action when the left button is clicked with the shift key and the mouse is moved.

control_leftstr, default: “spin”

Action when the left button is clicked with the control key and mouse moved.

middlestr, default: “pan”

Action when the middle button is clicked and the mouse is moved.

shift_middlestr, default: “pan”

Action when the middle button is clicked with the shift key and the mouse is moved.

control_middlestr, default: “pan”

Action when the middle button is clicked with the control key and mouse moved.

rightstr, default: “dolly”

Action when the right button is clicked and the mouse is moved.

shift_rightstr, default: “environment_rotate”

Action when the right button is clicked with the shift key and the mouse is moved.

control_rightstr, default: “dolly”

Action when the right button is clicked with the control key and the mouse is moved.

Examples

Create a simple scene with a plotter that has the left button dolly.

>>> import pyvista as pv
>>> plotter = pv.Plotter()
>>> _ = plotter.add_mesh(pv.Cube(center=(1, 0, 0)))
>>> _ = plotter.add_mesh(pv.Cube(center=(0, 1, 0)))
>>> plotter.show_axes()
>>> plotter.enable_custom_trackball_style(left="dolly")
>>> plotter.show()