To add a bit more context to this, I’m trying to implement a flipbook animation for some sprites that are part of a character’s body (eyes, mouth). The way we approached this is to create an associated JSON file for every animation the character has (e.g for a “Celebrate.fbx” animation I will have a “Celebrate.json”). This file is automatically exported from Maya along with the character animation.
This additional file contains timeline information about what frames index from the eyes or mouth atlas we should use at a particular time during the animation.
On the PlayCanvas side we’ve implemented a script that is attached to the character and on the update method it determines the actual running animation track, current time of the animation and the duration. But in order to get the animation track or animation asset associated with a given state we had to dig deeply inside the engine and use non-public functions and members.
It would be nice if the public API would expose methods to retrieve all the layers added to an AnimComponent
not just the baseLayer
.
Also on the AnimComponentLayer
it would be great if we can also get methods to allow retrieval of the associated animation assets and animation tracks for each state without having to rely on internal functionality that might change.
One more thing that I think it might be useful is to have automatic animation events (START, END
) for each animation with information about the animation (track name, asset name, etc…whatever might be useful).