bodymovin-extension
bodymovin-extension copied to clipboard
Support non-ascii gradient data
When effect path (composition names, layer names, etc.) contains CJK characters, the extension failed to parse gradient data and exported black-and-whites. The bug was reported on https://github.com/airbnb/lottie-web/issues/1201. This commit fixes it by adding support for parsing non-ascii gradient data.
In my test aep files, these characters are utf-8 encoded. However, reading the file with encoding = 'UTF-8'
failed because of binary data out of utf-8 byte ranges. Conversely, I tried to read the file as binary string and encode shapeNavigation
s the same way, so that we can find the correct gradientIndex
.
Tested on After Effects 2021 (18.0.0) for MacOS. Both of AE and OS are Chinese version. Here is the demo aep file.
Before:
After: