Skip to content

Different viewing modes in different renderers? #1123

Answered by sergei9838
sergei9838 asked this question in Q&A
Discussion options

You must be logged in to vote

Thank you, Marco! Who said it was not possible?! 😉🤝

from vedo import *
from vedo.interactor_modes import MousePan
settings.enable_default_keyboard_callbacks = False

cube = Cube().rotate_x(10)
img = Image(dataurl+"images/dog.jpg") 

plt = Plotter(shape=(1,2), sharecam=False)
modes = [0, MousePan()]

active = 0
inactive = 1

def toggle_active(event):
    global modes, active, inactive
    if event.keypress == "Tab":  # toggle active renderer
        active, inactive = inactive, active
        plt.renderers[active].InteractiveOn()
        plt.renderers[inactive].InteractiveOff()
        plt.at(active).user_mode(modes[active])

plt.at(0).add(cube, "Press TAB to toggle active panel").reset_ca…

Replies: 4 comments 2 replies

Comment options

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

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by sergei9838
Comment options

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants