jupyter-widgets / pythreejs

A Jupyter - Three.js bridge
https://pythreejs.readthedocs.io
Other
936 stars 185 forks source link

How do set playback start time? #283

Open subTropic opened 4 years ago

subTropic commented 4 years ago

I have animation tracks that start at large frame numbers e.g 6,000 However, the animation action always wants to begin playback at frame 0, causing my animation to be frozen before it starts playing.

This behavior can be seen for example by adding 10 to all of the time keys in the animation example: https://pythreejs.readthedocs.io/en/stable/examples/Animation.html

In threejs there is a method on AnimationAction called startAt() which looks like it should let you specify the playback start time, but this seems to be unsupported in pythreejs.

AttributeError: 'AnimationAction' object has no attribute 'startAt'

Is there a way to start playback on a specified frame, or the first frame of the animation, or do I have to manually time shift all my animation back to start at frame 0?

vidartf commented 4 years ago

It seems like most of the animation API in threejs uses 0 as the starting time. As such, I think you have two options: