airbnb / lottie-web

Render After Effects animations natively on Web, Android and iOS, and React Native. http://airbnb.io/lottie/
MIT License
30.6k stars 2.88k forks source link

Anomalous lottie keynames and data structure #1888

Open Inventsable opened 4 years ago

Inventsable commented 4 years ago

Hi hernan, sorry to keep bothering you. I want to preface by saying I realize this would be a breaking change but it may be nice to think about for lottie 6.x.x in the event breaking changes are going to happen any way, I know it's too late for this by now in 5.x.x.

One of my newest pet projects is a simple translator, Readable-Lottie, which produces human-readable and dev-friendly versions of Lottie files by unminifying them and transcribing the 1/2 letter values to their After Effects equivalents, along with rearranging certain parts (Transforms, Contents, etc.) to be more in line with a 1:1 parallel of the After Effects structure. This is terrible for performance but isn't meant for it -- I'd want it to serve as a way for devs to understand their file, the foundation for debugging utilities, file tree generators to use as online Lottie editors, and eventually my own Reverse-Lottie which would generate an AE comp by drag/dropping a Lottie file into a CEP panel.

In working with the files and digging through the schema and extension's code, I've noticed a few discrepancies with key names in the sense there are overlaps, which need a lot of workarounds to translate correctly.

For instance, .s as a property might refer to:

A .o prop might be:

.x might be:

A .ty value of 5 might mean a Text Layer or a Slider Control depending on which parent it has, and etc.

Since these keynames are arbitrary and most of the schema follows suit, it'd be nice if all keys were anomalous with no overlap, since that would make transcribing incredibly straightforward with no need for any workarounds. Despite this being a breaking change and hard/impossible to implement for the current extension and lottie-web player, the solution could be incredible simple within the schema itself regardless of context:

And so on. I'll try to get a comprehensive list of every instance where this happens on my end and again, I don't expect a solution any time soon for this version of Lottie, but it'd be awfully nice to implement in the future.

kudanai commented 1 year ago

Hi. Looks this this issue didn't get an update and became stale.

I'm not sure if we can rename property keys in lottie at this point as it would likely break all the other implementations. What are you current thoughts on this?