Interpolate timeline position


(AG) #1

Hello everybody,

I am trying to control the timeline with a distance sensor. I use socket.io to send the sensor data to hype.
I am doing a linear transformation/mapping with the sensor data to set the right position (using hypeDocument.goToTimeInTimelineNamed).

Is there a possibility to interpolate/smoothen the movement of the timeline?

e.g. when I go from 00:01:00 to 00:02:00 the transition is too “choppy”.

Thank you in advance


(Jonathan Deutsch) #2

goToTimeInTimelineNamed() doesn’t have a method to play/animate to a specific point, but there are a few ways to do this:

  • If you know ahead of time that there will be specific steps, you can put pause timeline actions on the timeline, and then use the continueTimelineNamed() API with forward or reverse depending on the direction you want to go.
  • If the timeline is limited and only animates a few properties, you could instead of using a timeline, use the setElementProperty() API which does allow you to specify a duration and timing function that will form a transition animation.
  • You could write your own animation/heartbeat code that gets called frequently and changes the time of the timeline with goToTimeInTimelineNamed().