Expand description
Render a Lottie animation to a Vello Scene
.
This currently lacks support for a number of important SVG features.
This is also intended to be the preferred integration between Vello and usvg, so consider contributing if you need a feature which is missing.
This crate also re-exports vello
, so you can easily use the specific version that is compatible with Velato.
§Usage
use velato::vello;
// Parse your lottie file
let lottie = include_str!("../examples/assets/google_fonts/Tiger.json");
let composition = velato::Composition::from_str(lottie).expect("valid file");
// Render to a scene
let mut new_scene = vello::Scene::new();
// Render to a scene!
let mut renderer = velato::Renderer::new();
let frame = 0.0; // Arbitrary number chosen. Ensure it's a valid frame!
let transform = vello::kurbo::Affine::IDENTITY;
let alpha = 1.0;
let scene = renderer.render(&composition, frame, transform, alpha);
§Unsupported features
Missing features include:
- Position keyframe (
ti
,to
) easing - Time remapping (
tm
) - Text
- Image embedding
- Advanced shapes (stroke dash, zig-zag, etc.)
- Advanced effects (motion blur, drop shadows, etc.)
- Correct color stop handling
- Split rotations
- Split positions
Re-exports§
pub use vello;
Modules§
Structs§
- Composition
- Model of a Lottie file.
- Renderer
- Renders a composition into a scene.
Enums§
- Error
- Triggered when is an issue parsing a lottie file.