.. role:: raw-html(raw) :format: html .. raw:: html
gsoc
.. raw:: html
fury
Google Summer of Code Final Work Product ======================================== .. post:: January 29 2023 :author: Mohamed Abouagour :tags: google :category: gsoc - **Name:** Mohamed Abouagour - **Organisation:** Python Software Foundation - **Sub-Organisation:** FURY - **Project:** `FURY - Keyframe animations API `_ Proposed Objectives ------------------- * Keyframe animations API * Basic playback functions, such as playing, pausing, and rewinding the timeline. * Adding keyframes at a specific time for transformations of FURY actors and cameras such as translation, scale, rotation, color, and opacity. * Implement quaternion-based interpolation (SLERP) * Allow the camera to be interpolated by the keyframe system. * Allow the creation and removal of actors from the scene according to the keyframes. * Visualize the motion path of positional animation. * Speed the animation using GLSL vertex and fragment shaders. Modified Objectives ------------------- * Adding a playback panel for controlling the timeline. * Billboard actor using the geometry shader. * Hierarchical animation support. * Animating primitives of the same Fury actor separately. * Color interpolators. Objectives Completed -------------------- * Keyframes Animation API * ``Animation`` Class * The ``Animation`` class is the main part of the FURY animation module. It is responsible for keyframe animations for a single or a group of FURY actors. The ``Animation`` is able to handle multiple attributes and properties of Fury actors such as position, color, scale, rotation, and opacity. It is also capable of doing the following: * Set animation keyframes and events. * Animate custom properties. * Support add-to-scene/remove-from-scene events. * Can animate other animations (Hierarchical animation) * Set or change the keyframes interpolation method. * Visualize the motion path of the positional animation. * ``Timeline`` Class The ``Timeline`` is the player of FURY ``Animations``\ ; it controls the playback of one or more FURY animations. It also has the option to include a very useful playback panel to help control the playback of the animation. The ``Timeline`` can have a fixed length or get its duration from the animations added to it dynamically. It can loop, play once, change speed, play, pause, and stop. * Keyframes Interpolators Interpolation is also a core part of the keyframes animation. It is responsible for filling in the blanks between the keyframes so that we have transitional states between the set keyframes. Another factor is that interpolators must be super-optimized to interpolate data in a minimum amount of time as possible or else it would be the bottleneck that lags the animation. The following interpolators have been implemented as a part of the keyframes animation API: * Step Interpolator * Linear Interpolator * Spherical Linear Interpolator (Slerp) * Spline Interpolator * Cubic Spline Interpolator * Cubic Bézier Interpolator * Color Interpolators: * XYZ Color Interpolator * Lab Color Interpolator * HSV Color Interpolator .. image:: https://user-images.githubusercontent.com/63170874/217738142-2dba8f6a-f8ff-4231-babd-048055074cc0.gif :align: center :width: 560 .. image:: https://user-images.githubusercontent.com/63170874/190892795-f47ceaf1-8dd0-4235-99be-2cf0aec323bb.gif :align: center :width: 560 * Tutorials Also included 11 tutorials demonstrating how the FURY keyframe animation API works and how to use it to make some interesting animations. These tutorial will be added soon to the FURY website. Subjects explained in the tutorials are: * **Introduction** * **Timeline** * **Interpolators** * **Camera Animation** * **Hierarchical Animation** * **Using Color Interpolators** * **Using Bezier Interpolator** * **Using Spline Interpolator** * **Using time-based functions** * **Creating Custom Interpolators** * **Arm Robot Animation** *Pull Requests:* * **Keyframe animations and interpolators (Merged):** https://github.com/fury-gl/fury/pull/647 * **Separating the ``Timeline`` (Ready to be Merged):** https://github.com/fury-gl/fury/pull/694 * **Timeline hierarchical transformation (Merged):** https://github.com/fury-gl/fury/pull/665 * **Add Timelines to ShowManager directly (Ready to be Merged):** https://github.com/fury-gl/fury/pull/690 * **Updating animation tutorials (Ready to be Merged):** https://github.com/fury-gl/fury/pull/680 * **Record keyframe animation as GIF and MP4 (Under Development):** https://github.com/fury-gl/fury/pull/687 * PlaybackPanel UI component At first, while in the early development stage of the FURY keyframe animation API, basic playback buttons were used to play, pause, and stop the animation. As the API kept growing, more controllers needed to be implemented, such as the time progress slider, the speed changer, and the loop toggle. And composing all of these controllers into a single UI element was inevitable. While the PlaybackPanel is a main part of the ``Timeline``\ , the goal was to make it completely independent from the keyframes animation API so that it can be used for anything else, i.e. a video player actor or a continuous time simulation or any other time-dependent applications. .. image:: https://user-images.githubusercontent.com/63170874/194377387-bfeeea2c-b4ee-4d26-82c0-b76c27fa0f90.png :target: https://user-images.githubusercontent.com/63170874/194377387-bfeeea2c-b4ee-4d26-82c0-b76c27fa0f90.png :alt: image *Pull Requests:* * **\ ``PlaybackPanel`` initial implementation (Merged):** https://github.com/fury-gl/fury/pull/647 * **Set position and width of the ``PlaybackPanel`` (Merged):** https://github.com/fury-gl/fury/pull/692 * Billboard actor using the geometry shader Fury already has a billboard actor implemented using two triangles to construct the billboard. But the new approach uses only one vertex and the canvas of the billboard is generated by the geometry shader. This approach is faster in initialization since only the center is needed and no additional computations to generate the primitive on the CPU side. Also, animating these new billboards using the method mentioned above in the previous objective is way much faster, and faster is one of the reasons why we use billboards. *Pull Requests:* * **billboards using geometry shader (Ready to be Merged):** https://github.com/fury-gl/fury/pull/631 Objectives in Progress ---------------------- * Animating primitives of the same FURY Actor separately Animating FURY actors is not a problem and can be done easily using the FURY animation module. The problem appears when trying to animate a massive amount of actors, thousands or even hundreds of thousands of actors, it's impossible to do that using the animation module. Instead, primitives of the same actor can be animated by changing their vertices and then sending the new vertices buffer to the GPU. This also needs some discussion to find the cleanest way to implement it. *Pull Requests:* * **Animating primitives of the same actor (Draft):** https://github.com/fury-gl/fury/pull/660 * **Added primitives count to the polydata (Merged):** https://github.com/fury-gl/fury/pull/617 * Speeding up the animation using GLSL shaders Using the power of the GPU to help speed up the animations since some interpolators are relatively slow, such as the spline interpolator. Besides, morphing and skeletal animation would be tremendously optimized if they were computed on the GPU side! *Pull Requests:* * **Adding shader support for doing the animations (Open):** https://github.com/fury-gl/fury/pull/702 Other Objectives ---------------- * Added more enhancements to the ``vector_text`` actor Added the ability to change the direction of the ``vector_text`` actor, as well as giving it the option to follow the camera. Also added the option to extrude the text which makes it more like 3D text. *Pull Requests:* * **Improving ``vector_text`` (Merged)** : https://github.com/fury-gl/fury/pull/661 * Other PRs * **Fixed multi_samples not being used (Merged)**\ : https://github.com/fury-gl/fury/pull/594 * **Added an accurate way to calculate FPS (Merged)**\ : https://github.com/fury-gl/fury/pull/597 * **Implemented two new hooks for UI sliders (Merged)**\ : https://github.com/fury-gl/fury/pull/634 * **Fixed some old tutorials (Merged)**\ : https://github.com/fury-gl/fury/pull/591 * **Returning the Timer id while initialization (Merged)**\ : https://github.com/fury-gl/fury/pull/598 * GSoC Weekly Blogs * My blog posts can be found on `the FURY website `_ and `the Python GSoC blog `_. Timeline -------- .. list-table:: :header-rows: 1 * - Date - Description - Blog Post Link * - Week 0\ :raw-html:`
`\ (23-05-2022) - My journey till getting accepted into GSoC22 - `FURY `_ - `Python `_ * - Week 1\ :raw-html:`
`\ (08-06-2022) - Implementing a basic Keyframe animation API - `FURY `_ - `Python `_ * - Week 2\ :raw-html:`
`\ (28-06-2022) - Implementing non-linear and color interpolators - `FURY `_ - `Python `_ * - Week 3\ :raw-html:`
`\ (04-07-2022) - Redesigning the API,\ :raw-html:`
` Implementing cubic Bezier Interpolator,\ :raw-html:`
` and making progress on the GPU side! - `FURY `_ - `Python `_ * - Week 4\ :raw-html:`
`\ (11-07-2022) - Camera animation, :raw-html:`
`\ interpolation in GLSL, and a single Timeline! - `FURY `_ - `Python `_ * - Week 5\ :raw-html:`
`\ (19-07-2022) - Slerp implementation, :raw-html:`
`\ documenting the Timeline, and adding unit tests - `FURY `_ - `Python `_ * - Week 6\ :raw-html:`
`\ (25-07-2022) - Fixing the Timeline issues and equipping it with\ :raw-html:`
` more features - `FURY `_ - `Python `_ * - Week 7\ :raw-html:`
`\ (01-08-2022) - Billboard spheres and implementing interpolators\ :raw-html:`
` using closures - `FURY `_ - `Python `_ * - Week 8\ :raw-html:`
`\ (09-08-2022) - Back to the shader-based version of the Timeline - `FURY `_ - `Python `_ * - Week 9\ :raw-html:`
`\ (16-08-2022) - Animating primitives of the same actor - `FURY `_ - `Python `_ * - Week 10\ :raw-html:`
`\ (23-08-2022) - Supporting hierarchical animating - `FURY `_ - `Python `_ * - Week 11\ :raw-html:`
`\ (30-08-2022) - Improving tutorials a little - `FURY `_ - `Python `_ * - Week 12\ :raw-html:`
`\ (7-09-2022) - Adding new tutorials - `FURY `_ - `Python `_ * - Week 13\ :raw-html:`
`\ (20-09-2022) - Keyframes animation is now a bit easier in FURY - `FURY `_ - `Python `_