Jump to content
Search Community

Clear all tweens during rebuild of timeline

ajhalls test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

I have made some great progress on the GUI last night and this morning. Seems like just about everything works, except... If you go to this page: https://ajhalls.github.io/Simple-Animation-Timeline-for-Greensock/

 

Click to add an X rotation, then click the timeline at around 500ms, you will see that the "Example" text is now upside down. Now click to add Y rotation. At this point it assumes the current upside down text is the initial state and animates it from there.

 

Since I couldn't modify any of the timeline info directly, I created a rebuild function that runs each time you drag and drop, resize, or add a new animation. All the info is stored in an object off to the side and rebuilt from that info.

 

How can I quickly clear those effects, or at least not assume that is the initial state?  I don't see that there is going to be that much value in doing a Codepen when you have access to the source on Github if needed, but if I am wrong, let me know :)

Link to comment
Share on other sites

I do use the .clear() function, the issue is that I have one timeline that modifies the "Example" text, then when I add another tween, I .clear() the first timeline and create another timeline that uses the original one's modifications as the new starting point. I had a work around idea of rewinding to the beginning really quick before building the timeline and then fast forward to where I was before that I will try out.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...