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

Keyframing support #80

Open
matthewturk opened this issue Jun 2, 2023 · 0 comments
Open

Keyframing support #80

matthewturk opened this issue Jun 2, 2023 · 0 comments

Comments

@matthewturk
Copy link
Member

yt has keyframe tracking functionality, which can be used. Here's a simple script (which requires a fix to the keyframe that I'm about to issue a PR for) that shows it.

class Track:
    def __init__(self):
        self.pos = []
        self.up = []
    def snapshot(self, cam):
        self.pos.append(cam.position)
        self.up.append(cam.up)

from yt.visualization.volume_rendering.camera_path import Keyframes
cam = rc.scene.camera
t.snapshot(cam)
t.snapshot(cam)
t.snapshot(cam)
t.snapshot(cam)
import numpy as np
x, y, z = np.array(t.pos).T
up = np.array(t.up)
K = Keyframes(x, y, z, up_vectors = up)
path = K.create_path(100)
for i in range(path['position'].shape[0]):
	cam.position = path['position'][i,:]
    cam.up = path['up_vectors'][i,:]
    rc.scene.render()
    rc.snap()

We should expose this functionality.

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

1 participant