airbnb / lottie-web

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

After Bodymovin 5.92(including the latest 5.10.2), the Comp name of After Effect will not be shown in the list, the list is empty. #2960

Open siyexa2951 opened 1 year ago

siyexa2951 commented 1 year ago

When using version 5.91, you can see the comp name in the list, no problem. But for versions after 5.92 (including the latest 5.10.2), there is no comp in the list, even if you keep saving or refreshing the list. (From After Effect 2020 to 2023, or Win10 to Win11, reinstallation will not show the comp.)

If you take the two files in version 5.91, the initializer.jsx and generalUtils.jsx to the same folder in 5.92. Comp will be shown in the list. but it does not work properly.

The initializer.jsx version 5.91 and version 5.92 Only one more line of text is added 'utils/textCompHelper.jsx'.

generalUtils.jsx versions 5.91 and 5.92. There is an additional code

function sanitizeName(name) {

    var i, len = name.length;
    var finalString = '';
    for (i = 0; i <len; i += 1) {
        var charCode = name.charCodeAt(i);
        // High surrogates D800–DBFF
        // Low surrogates DC00–DFFF
        try {
            if (charCode >= 0xD800 &&  charCode <= 0xDBFF) {
                var nextCharCode = name.charCodeAt(i + 1);
                // if the next character is not part of the low surrogate range
                // it means that the character is cut off 
                // and we will skip the pair from the sanitized text
                if (nextCharCode >= 0xDC00 &&  nextCharCode <= 0xDFFF) {
                    finalString += name.charAt(i);
                } else {

                }
            } else {
                finalString += name.charAt(i);
            }

        } catch (error) {
            finalString += name.charAt(i);
        }
    }
    return finalString;
}

ob.sanitizeName = sanitizeName;

Therefore, the problem is probably in generalUtils.jsx and textCompHelper.jsx

This bug has existed for a long time, but has not been answered and solved, now directly to the problem file pointed out. I hope it can help to fix it. 001

kompanets commented 1 year ago

I have this problem when trying to export an animation from a project that hasn't been saved to disk before. When I save, all is ok

siyexa2951 commented 1 year ago

Whether I have save or not is the same 🙄