napari / napari-animation

A napari plugin for making animations
https://napari.github.io/napari-animation/
Other
76 stars 27 forks source link

changing easing after keyframe creation has no effect #227

Open maweigert opened 2 weeks ago

maweigert commented 2 weeks ago

Description

I noticed changes to the easing function of a keyframe (e.g from linear to exponential) after creation in the napari plugin has no effect when saving as a movie (i.e. the easing function at capture times is still in effect).

Steps to reproduce:

Possible reasons

self.animation._frames._rebuild_keyframe_index() is not called when the ease combo box is changed

Possible fix

Adding it to the update function in https://github.com/napari/napari-animation/blob/ba8ab537abd181ee5a8af0e821d3b889c46529b0/napari_animation/_qt/frame_widget.py#L63 solves the issue. But this might not be the best place...

    def _update_animation_ease(self, event):
        """update state of 'ease' at current key-frame to reflect GUI state"""
        active_keyframe = self.animation.key_frames.selection.active
        active_keyframe.ease = self.get_easing_func()
        self.animation._frames._rebuild_keyframe_index()
psobolewskiPhD commented 2 weeks ago

Thanks for the issue @maweigert I will try to take a look at this more closely tomorrow. ❤️