Animation from json loading

Hello,
cant get the animation json loading playgrounds to work (on mac chrome). Tried with v5 and 4.2 no luck.

Any ideas?

It looks like the problem is that the example file has an object with property “animations” which holds the array of animations, but Animation.ParseFromFileAsync expects the file to simply contain the animation or array of animations (without being wrapped in an object). Also the url was being passed as the first param but it’s actually the second.

So I simply edited the file to remove the outer object so that Animation.ParseFromFileAsync can parse it correctly. IDK how the original file was generated thou or how it was expected to be parsed - did you find it from a documentation page? :thinking:

2 Likes

Thanks! The second problem I noticed but didnt help to add the name. The animation property seems to be the issue. Its interesting that same format is generated with the animation editor. Maybe something changed but the json parser didnt get updated. The snipped server seem to be working fine.

1 Like

Ah, it’s saved from ACE. Here’s a working update of that playground from the ACE documentation page that loads the file saved from the animation curve editor. It uses a new function I made based on Animation.ParseFromFileAsync() and ACE’s function loadFromFile(). When @sebavan is back we can see if a PR is needed. :slight_smile:

1 Like

Good stuff. Thanks again.

1 Like

This is a pretty cool idea !!! @Deltakosh what do you think about this function ? I d say yes, but let s ask ACE dad first

1 Like

I like it!

2 Likes

@Blake you are good to go and I ll review the PR :slight_smile:

1 Like

Here’s the PR for it and once the function’s live I’ll update the code snippet and PG for the doc page too - LOL it’s just 3 letters (ACE) that will need to be added to the code. :slight_smile: :beers:

not sure if its related but posted another issue on animation here: Animation wrong path in v4.2

1 Like

Oops forgot about this one: now that the fix is live all you have to do is call ParseFromFileAsync and it will work automagically with files saved from ACE…

And here’s the PR to fix the missing first parameter in the doc and example playground. :slight_smile:

1 Like