python-lottie  0.6.10+dev2509936
A framework to work with lottie files and telegram animated stickers (tgs)
svg.py
1 #!/usr/bin/env python3
2 import sys
3 import os
4 sys.path.insert(0, os.path.join(
5  os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
6  "lib"
7 ))
8 from lottie.utils import script
9 from lottie import objects
10 from lottie.parsers.svg import parse_svg_file
11 from lottie import Point
12 
13 
14 an = parse_svg_file(os.path.join(
15  os.path.dirname(os.path.abspath(__file__)),
16  "blep.svg"
17 ))
18 
19 layer = an.find("durg")
20 layer.transform.anchor_point.value = Point(256, 256)
21 layer.transform.position.value = Point(256, 256)
22 layer.transform.rotation.add_keyframe(0, 0)
23 layer.transform.rotation.add_keyframe(30, 180)
24 layer.transform.rotation.add_keyframe(60, 360)
25 
26 
27 script.script_main(an)
lottie.parsers.svg.importer.parse_svg_file
def parse_svg_file(file, layer_frames=0, *args, **kwargs)
Definition: importer.py:1310
lottie.parsers.svg
Definition: __init__.py:1
lottie.nvector.Point
def Point(x, y)
Definition: nvector.py:135
lottie.utils
Definition: __init__.py:1