Blender ♥︎ Lottie - Lottie Animation Workflow

multlabs in Import & Export


SVG Blender Lottie Pipeline

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

  • 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 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.


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

  • Constraint model is intentionally simplified to x-z plane vs Blender's full transform stack.

  • No middle-mouse axis selector.


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.

  • Optional "selected only" export.

  • 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.


Pipeline Summary

  • Import SVG with io_svg_to_gp.

  • Animate by:

    • drawing keyframes and/or

    • gp_layer_tool layer transforms (with auto-key).

  • Export to Lottie with io_lottie_export.

This pipeline is focused on lightweight vector animation transfer, not full visual parity with Blender's renderer.

$15

Have questions about this product?
Login to message

Details
Blender Extension Compatible Yes
Published 5 months ago
Blender Version 5.1 - 5.2
Extension Type Add-on
License GPL