Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is bodymovin exporting PNG's and not SVG's?

I'm trying to use lottie to animate an SVG animation created in After Effects. I use the bodymovin extension to export the JSON data file. But, I also noticed the export includes some PNG images. I'm also getting console errors that said PNG's can not be found.

Why is it exporting PNGs as I'm using SVG (an AI file) in AE. Below is my code, and the error.

index.ts

import * as lottie from 'lottie-web';
import * as header from './assets/header.json';

import './css/base.sss';

var animation = lottie.loadAnimation({
    container: document.getElementById('header'),
    animationData: header,
    renderer: 'svg/canvas/html',
    autoplay: true
});

But I'm getting the following errors that the images can't be found. Why is bodymovin exporting/looking for pngs? I require SVG's.

Chrome console errors (sorry can't embed until 10 rep)

like image 209
DeveloperJames Avatar asked Feb 21 '18 14:02

DeveloperJames


People also ask

How to export animation from bodymovin plugin?

Open Bodymovin Plugin If your animation fully complete time to go with export .json file. Click the Bodymovin plugin. You can find look like this under follows. You have to select a destination folder where you can save all the files and select the composition which you are going to export. Make sure all files goes in one folder.

What's the best way to export an SVG animation?

Any designer can easily export animated graphics as .json format using after effects through bodymovin. Smooth motion and low size file is one of the best points on this SVG animation. Developers can control the file with Lottie on web and mobile app too. That's really cool.

What is the difference between PNG and SVG?

Perhaps the most fundamental difference between PNG and SVG is that one is a raster file type and the other is vector. A PNG is a raster — that is, pixel-based — image format. If you scale up a raster image too far, it becomes grainy and pixelated. Similarly, if the image is too small, it can become indistinct.

Why are my labels not showing in the exported SVG image file?

However, the exported SVG will not show all labels when the SVG image file is viewed in IE and most SVG editors (such as Inkscape and Illustrator), as well as some online services such as Wordpress. Instead, you will see a short version of the label and a warning Viewer does not support full SVG 1.1 at the bottom of the SVG export.


1 Answers

I found the problem. I have to convert paths to shapes in AI as noted here.

like image 94
DeveloperJames Avatar answered Sep 28 '22 08:09

DeveloperJames