Javis.jl
Javis.jl copied to clipboard
[BUG] Image Viewer Does Not Keep Up with Frame
Describe the bug
Occasionally, larger or more intensive frames that build on top of many Action objects cause the image viewer to lag. The lag varies from machine to machine and may not be fully solved for every single machine. However, this does not affect the final rendered output.
Expected Behavior and Actual Behavior
Sometimes when moving the slider on an animation, the viewer can lag as it struggles to keep up with the slider moving. Therefore, there are sometimes large "jumps" between frames.
Additional context
I am not sure how best to optimize/fix our current method for the get_javis_frame other than preprocessing or having the user use the buttons instead of the slider on their machine and have the caveat that the image viewer may not work quickly for all machines.
It might actually be wise to run the rendering in the background once as some animations i.e morphing needs that the first frame of morphing is called first to do some precomputation. Maybe there is an option to do rendering asynchronously in the background and maybe even save the frames to disk as a cache.
@Wikunia and I discussed this issue the other day and we concluded that the best way to handle this issue is to preprocess an animation and cache it for the user (perhaps as a png or in the user's buffer) if they encounter issues. They could, for example, execute something like render(...; cache = true) so they could have all the frames rendered and they could increment through the Javis viewer if they were originally encountering issues with the live viewer.