Closed leakec closed 1 year ago
Mabye there is a way to use one animation mixer on a group, and just reference objects in the scene hierarchy.
See: https://threejs.org/docs/#api/en/animation/KeyframeTrack and: https://threejs.org/docs/#api/en/animation/PropertyBinding.parseTrackName
Okay, looks like we only need one mixer. We can use object UUIDs to reference different objects, and just pass the scene as the root to the mixer. This was done in this commit: https://github.com/leakec/Standalone-HTML-scene/commit/6616848eac423fc2b5dbdee5fafde2ff3005a9af
graph TD;
clip1-->obj1;
clip2-->obj1;
clip3-->obj1;
obj1-->mixer1;
clip4-->obj2;
clip5-->obj2;
clip6-->obj2;
obj2-->mixer1;
Closing. I added a mixer like this here: https://github.com/leakec/Standalone-HTML-scene/commit/a138f21435f5b3ee11517c62024f3d9321f508a7
The animation system I'm thinking of implementing for multiple objects would look like this
SyncMixer
class that I'll create. This will be in charge of updating all mixers, and ensuring they stay in sync. It will also have convenience functions likepause
,play
,loop
,update
, etc. that can be called from a GUI to start, stop, etc. all animations across a scene.