Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
swampthang

Add dummy to end of timeline?

Recommended Posts

The codepen has a tween/timeline that's 1 second. Clicking the record button steps through the animation and snaps 60 PNGs per second - so there are 60 images. The last bit of the Circ.easeIn is so fast that it doesn't make it into the collection of images. I hate to increase above 60/sec. Is there any way to add a little padding onto the end of the timeline so that last snapshot gets the end of the animation?

 

In the codepen, when you click the record button, you see the images dropping in below and can see where the last image is snapped at the beginning of that last 60th of a second but prior to the end of the animation. The preview button shows the actual animation.

 

For experimental purposes, I increased the FPS to 120 and it still never made it.

 

I searched through the forum and found a post in the actionscript area that talked about adding a dummy "set" like the following:

// get the duration of the timeline
var totalTime = mainTimeline.duration();
var dummySet = TweenMax.set({},{},totalTime+1);

When I tried that in my app I got the same duration - nothing changed. Is it possible to pause at the end and then finish?

 

If I missed an explanation for this please point me in the right direction. Thanks!

See the Pen zBLOdE by swampthang (@swampthang) on CodePen

Link to comment
Share on other sites

Does this fix it?

main.progress(++current / frames);

I haven't looked at your PM yet. I'll get to that tonight. I need more space for PMs. My account is always maxed out.

  • Like 1
Link to comment
Share on other sites

Yes!!! That fixed it!. using ++current instead of current++ - geeez, that's like javascript 101. Thanks so much for that. I'll leave that pen out there for anyone else who runs across this issue. 

 

I left a comment in the code where the change needed to be made. Thanks again, Blake.

Link to comment
Share on other sites

Haha. That was in my original code, so I guess it was my fault.  :-o

Link to comment
Share on other sites

Just for the record, the reason that "dummy" set() call didn't do anything was because you called TweenMax.set() instead of mainTimeline.set(). In other words, you didn't add the dummy tween/set to your timeline :)

 

Don't worry, it happens to us all. 

  • Like 1
Link to comment
Share on other sites

Doh! Thanks for clarifying, Jack.

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.
×