You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expressions for AfterEffects/Lottie are written in Javascript.
It would be very hard to support Javascript expression directly in this library. It requires to embedded a Javascript
engine for platforms that can't run javascript directly (android/iOS...) and we will need a way to interact synchronously with the engine.
This is a very difficult path that would have big impacts on the complexity, size and portability of this library.
Thus this library doesn't provide direct support for Lottie Expression.
It is possible to provide an alternative: we could support "Dart expression" and let the developer provides the conversion of the javascript function in Dart.
Example: pub run lottie generate-expressions -o lib/lottie_expressions.dart path/to/lottie.json
// GENERATED FILE to modifyfinal expressions = {
"layers['Name of the layer'].x": _layersNameOfTheLayerX,
};
/* HASH: abc1321321 Original code: var $bm_rt; var temp; temp = div(content('Rectangle 1').content('Rectangle Path 1').size[0], 2); $bm_rt = [ temp, 0 ];*/Offset_layersNameOfTheLayerX(Context context) {
var content = context.content('Rectangle 1').content('Rectangle Path 1');
returnOffset(content.size.x, 0);
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Expressions for AfterEffects/Lottie are written in Javascript.
It would be very hard to support Javascript expression directly in this library. It requires to embedded a Javascript
engine for platforms that can't run javascript directly (android/iOS...) and we will need a way to interact synchronously with the engine.
This is a very difficult path that would have big impacts on the complexity, size and portability of this library.
Thus this library doesn't provide direct support for Lottie Expression.
It is possible to provide an alternative: we could support "Dart expression" and let the developer provides the conversion of the javascript function in Dart.
Example:
pub run lottie generate-expressions -o lib/lottie_expressions.dart path/to/lottie.json
Beta Was this translation helpful? Give feedback.
All reactions