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

Recording and rotating at the same time? #2504

Open
SCO-SCI opened this issue Jul 19, 2024 · 2 comments
Open

Recording and rotating at the same time? #2504

SCO-SCI opened this issue Jul 19, 2024 · 2 comments
Labels

Comments

@SCO-SCI
Copy link

SCO-SCI commented Jul 19, 2024

The inability to rotate a 3D image and record it at the same time is a known issue with Glue. Has this issue been fixed, or is there a work around available?

Operating System: Windows 10 Pro Version 22H2
Python Version: 3.9.19
Anaconda Version: conda 24.5.0
Glue Version: 1.2.2
Installed using command: conda install -c glueviz glueviz=1.2

@SCO-SCI SCO-SCI added the bug label Jul 19, 2024
@Carifio24
Copy link
Member

Carifio24 commented Jul 20, 2024

Hi @SCO-SCI,

This isn't currently possible due to the fact that the Qt glue toolbar only allows one tool to be active at a time. I do have a workaround, though, using the glue terminal. Open the terminal (the Terminal button in the upper-right of the window), and run the following

from vispy import app

# You'll need to change these based on which tab your viewer is in, and the index of the viewer within that tab
tab_index = 0
viewer_index = 0
viewer = application.viewers[tab_index][viewer_index]  # application is an pre-defined variable in the glue terminal

def rotate(event):
    v._vispy_widget.view.camera.azimuth -= 1.  # Adjust this value to modify the rotation increment

timer = app.Timer(connect=rotate)
timer.start(0.1)  # Adjust this value to make the view rotate slower or faster (lower means faster)

# You can then stop using timer.stop()

This will start the view rotating (essentially copying the code that the rotate tool is using). Since the rotation tool in the toolbar isn't active, you can then record while the rotation is happening.

@SCO-SCI
Copy link
Author

SCO-SCI commented Jul 21, 2024

That looks great. Thank you for the workaround.

Ed

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

No branches or pull requests

2 participants