Grease Pencil ♥︎ Lottie - Lottie animation workflow (SVG -> Blender -> Lottie)

Grease Pencil :heart:︎ Lottie

Hello everyone, I want to share my project that I made for creating commercial animations for Android/iOS apps.
It’s a super raw project, but it actually works – it just has a lot of limitations.

This project can: load SVG vector graphics into Grease Pencil with colors preserved, export animations from Grease Pencil to Lottie (.json), dotLottie (.lottie), and Telegram (.tgs) formats.
Also I made a custom transform tool that can be used to animate layer transforms (translation, rotation, scale)
This pipeline is focused on lightweight vector animation transfer, not full visual parity with Blender’s renderer. Example below is 158 kb json uncompressed and 15 kb in tgs format: https://t.me/addstickers/blender_lottie.
Check out the export demo, download the add‑on, and read more here:
https://multlabs.com/demos/lottie/demo.html


Feature Highlights

Prepare your SVG in your vector editor (Inkscape is recomended)

Use layer transform to move, rotate, scale layers and set pivot point

Nice material import

Animate with Grease Pencil keyframes and layer transform

Export to Lottie via Collection Exporter

Output file size log


This project is split into 3 Blender add-on modules:

  • svg_blender_lottie/io_svg_to_gp

  • svg_blender_lottie/gp_layer_tool

  • svg_blender_lottie/io_lottie_export

Each module has its own bl_info, register(), and unregister() so it can be installed as a separate add-on.


1) io_svg_to_gp (SVG → Grease Pencil)

Purpose

Imports an SVG using Blender’s native Grease Pencil importer and then applies paint/style mapping from the source SVG.

What is supported

  • Native GP SVG import via wm.grease_pencil_import_svg.

    • Fill and stroke color parsing from SVG:
    • hex (#fff, #ffffff)
    • rgb(r,g,b)
    • named colors from svg_colors.py
  • Cascade/inheritance for paint:

    • root svg → groups g → shape node
    • presentation attributes + inline style
    • embedded <style> rules for simple selectors (.class, #id, tag.class, simple chains like svg .cls)
  • Opacity channels:

    • opacity
    • fill-opacity
    • stroke-opacity
  • Stroke width mapping:

    • SVG stroke-width → GP point radius
    • basic units: px, pt, pc, mm, cm, in
  • Material naming by nearest CSS color names in RGB space.

  • Material reuse by actual fill/stroke RGBA values (not by material name).

Graphics limitations / not supported

  • Sometimes useless materials is created, easy to fix by remove unused materials

  • Clipping paths should be applied before import.

  • Grouping is supported, but may lead to unexpected color shifts from object to object. If you face this issue, consider ungrouping graphics before import.

  • No full SVG compositor behavior:

    • masks/filters are not reproduced as final raster effect.
  • No full CSS engine:

    • no advanced selectors, pseudo-classes, media queries, etc.
  • No gradient/pattern/filter rendering into GP materials:

    • linearGradient, radialGradient, pattern, filter are ignored for shading.

SVG preparation checklist (when import fails or colors are wrong)

If import quality is poor or mapping fails, prepare the SVG in your vector editor (Inkscape is recomended) first:

  • Ungroup all groups. Remove all layers. It would make native exporter export all elements into separate layers, that is easy to map

  • Remove masks.

  • Remove clip paths and cut shapes by clip paths (convert clipping to real geometry).

  • Replace blend modes with plain opacity.

  • Avoid holes in curves, as the native exporter converts them into a separate object. Will be not an issue in Blender 5.1.2


2) gp_layer_tool (Layer Transform Animator Tool)

Purpose

Interactive transform tool for selected Grease Pencil layers (similar to standard transform workflow) with viewport gizmos and modal controls.

Layer transform animation is generally preferred over frame-by-frame redraw when possible, because it exports to much smaller Lottie files.

What is supported

  • Avaliable in edit and object modes. G, R, S, Alt+G, Alt+R, Alt+S overrides default Blender shourtcuts, while tool is active.

  • Works on selected layers:

    • falls back to the active layer if no other layer selection is available
  • Optional auto layer selection in Edit Mode:

    • selected points/strokes can drive Dope Sheet layer selection
    • newly selected layer can become the active layer
  • Modes:

    • Translate (layer local X/Z)
    • Rotate (layer local Y / Euler Y)
    • Scale (layer local X/Z)
  • Modal workflow:

    • key buildings: G, R, S
    • axis constraints X, Y/Z (Y maps to Z in this tool)
  • View-dependent motion mapping:

    • transform direction is projected through current viewport.
    • Rotation by radial mouse motion around on-screen pivot.
  • Uniform scale in unconstrained scale mode:

    • default scale behavior uses distance to pivot, similar to Blender’s standard scale feel
  • Header/status feedback:

    • live values in header (Transform, Rotation, Scale)
    • key hints in status bar.
  • Auto-key support:

    • if Auto Key is enabled, relevant layer transform channels are keyed on confirm.
  • Transform reset shortcuts for selected layers:

    • Alt+G clear translation
    • Alt+R clear rotation
    • Alt+S clear scale
  • Optional Move Only Pivot Point mode:

    • applies inverse point compensation so layer pivot can move while drawing stays visually in place

Limitations


3) io_lottie_export (Grease Pencil → Lottie)

Purpose

Exports Grease Pencil content as vector shape layers into one of three containers:

  • .json (plain Lottie JSON):

  • .lottie (dotLottie ZIP package):

  • .tgs (Telegram container):

File size is mostly driven by animation complexity (number of layers, strokes, and keyframes), not only by container type. The exporter therefore includes size-focused options such as skipping unchanged stroke keys and writing an export log to identify heavy layers/frames.

What is supported

  • Collection Exporter

  • Multiple GP objects in one composition.

  • Camera-based projection:

    • 3D GP points projected to 2D composition pixels.
  • Path export:

    • polyline and bezier path data per stroke.
  • Fill/stroke style export:

    • color + opacity

    • stroke width from GP radius with thickness-space handling

  • Transform animation export:

    • object transform animation

    • layer transform animation (from layer tool or keyed layer channels)

  • Frame range and precision controls.

  • Optional bake mode for transform animation (sample every frame).

  • Optional per-stroke key reduction:

    • skip unchanged shape/style samples to reduce file size
  • Optional export log file (.export.log.txt) with per-layer and per-frame stats.

    • Mask export via Lottie track matte fields (tt/td/tp) when GP layer masks are used.

Graphics limitations / not supported

  • Gradient fills and strokes

  • No variable line thickness

  • No images or image fills

  • Does not support modifier-evaluated Grease Pencil output:

    • GP Line Art modifier is not supported

    • other Grease Pencil modifiers are not supported

  • GP effect stack is not supported

  • Does not evaluate the full Blender dependency graph result for editing:

    • the tool works on editable layer data, not final modifier stack output

    • Only linear and ease keyframe type are supported and simplified. For more advanced easing, use bake mode.

  • Perspective is approximated in Lottie layer transform (ks):

    • Lottie is 2D; true 3D camera/parallax behavior is not fully representable.
  • No full Blender shading/render pipeline export:

    • only vector path + basic fill/stroke style semantics.
  • Lottie runtime differences may exist between players (After Effects, lottie-web, mobile runtimes).

  • Telegram/lottie matte order constraint is strict:

    • mask layer must be directly above masked layer; export raises an error otherwise.

Give it a try, and feel free to report issues or share your results.

12 Likes

highly useful :orange_heart:

Added a small video about tool:

1 Like

My first test with the line art modifier.

Preview animation in Lottie player on Android:

~400kb uncompressed for 100 frames animation. ~60kb tgs

4 Likes

Lottie Export is online:

For now, I do not plan to publish SVG import and layer manipulation part, because they are not stable. But you can get it from git: https://gitlab.com/multlabs/svg-grease-pencil-lottie-workflow

If you want to try it out, here is the demo file: https://gitlab.com/multlabs/svg-grease-pencil-lottie-workflow/-/tree/main/demo-files

1 Like

That is a great tool! My apologies, I didn’t import the SVG correctly. Thank you so much for creating this it’s a lifesaver. Fantastic work! <3

Hi there! Is there a chance that you’ll add gradients and more features? It be really nice if you’ll add at least gradients for shading! :smiley: