-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[animation-timeline] Animation events: No begin events, complete events only once each #216
Comments
Writing this issue gave me an idea for a partial workaround as well (as it usually does):
|
So is the problem is that the complete events never fire on |
No, not quite:
|
I believe I found the reason why there are no The Modify A-Frame/src/components/animation.js like so: this.config = {
// add this new begin callback to the config object
begin: function() {
self.el.emit('animationbegin', self.eventDetail, false);
},
complete: function () { ... }
} Remove For the second problem with looping, I am not exactly sure. |
I am having problems with the events of
animation-timeline
, and this is the result of my investigation what is going on:animation
:When we just have
animation
, we getanimationbegin
events when the animations start (either automatically or because ofstartEvents
) andanimationend
when an animation is really finished (loop: true
never finish).Here is my file I used to reproduce and test this (a slightly modified version of https://github.com/supermedium/superframe/tree/master/components/animation/#browser):
Executing it logs the following:
When you run
document.getElementById('fade').emit('fadein')
in the console, you get additional logging:This is great! 👍 ✅
animation-timeline
:With
animation-timeline
I unfortunately do not get the expected events.I built an example (the example on https://github.com/supermedium/superframe/tree/master/components/animation-timeline#browser doesn't work at all, so built my own) with a very simple timeline: 4 timeline "steps" of 3 animations:
The output in the console is this:
So no
animationbegin
and although the animation keeps running in the browser, no moreanimationcomplete
after the first run through the complete timeline as well. 👎 ❌I would have expected a) the
animationbegin
events to be fired as with justanimation
, and b) all events to be fired each time the timeline loops - Those are new animations after allWas my expectation wrong?
Or did I mess up my code (and the example) somehow?
Some background why I need this:
I have a planet with cities. I want to animate an airplane between cities. The plane first has to ascend from the
departure
city to theapex
, thendescend
to thestopover
city. From thestopover
it ascends to thesecond apex
and descends into thearrival
city. This is done viaanimation-timeline
and works perfectly.But as the flight path is not a straight line, I have to reorient (rotate) the plane at least in the
stopover
, so it looks towards thearrival
- which can be done withlook-at
. It would be even greater if it could focus on the apex on ascend, then the city on descend. (And as there are several flight paths that can be switched between, I also have to first orient the plane indeparture
before starting the animation). That is why I need an event each time the animation is ran, so I can update the value forlook_at
of my plane.Probably related issues: #137
The text was updated successfully, but these errors were encountered: