-
Notifications
You must be signed in to change notification settings - Fork 27
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
Procedural Animations #155
Comments
Hey @kolibril13 - this is cool, it feels like an alternative method for generating a
If we do end up integrating this sound reasonable? |
I'm not a fan of case discrimination (see in example below in I'm not familiar with the def angle_over_time(t):
return (0, 30*np.sin((t*np.pi)), 50)
def zoom_over_time(t):
zoom = 0
start_time = 1
if t < start_time:
zoom = 2
# zoom starts for t threshold
elif start_time < t:
zoom = t -1
return zoom
my_key_frames = []
for t in np.linspace(0,4, 300):
viewer.camera.angles = angle_over_time(t)
viewer.camera.zoom = zoom_over_time(t)
key_frame = viewer.screenshot() # <- this should probably be something else.
my_key_frames.append(key_frame)
fs = FrameSequence(key_frames = my_key_frames)
animation = Animation(frame_sequence=fs, viewer=viewer, fps=30) # <- this should probably be something else as well.
# and here should happend the rendering |
Procedural animations are animation that are generated automatically via mathematical transformations that occur over time.
E.g. manim can produce procedural animations with the
t.add_updater(foo)
function.I just wrote a manim script that is connected to the napari viewer, and it produces the below animation.
Note that the camera is panning in a sinusoidal path, while other parameters (zoom, opacity, contrast limits) are changing simultaneously.
I think that won't be possible by only using key frames.
It would open up more possible animations if napari-animation would support these procedural animations as well.
download.mp4
Click here to see the script
The text was updated successfully, but these errors were encountered: