File indexing completed on 2025-01-19 04:00:00

0001 #!/usr/bin/env python3
0002 import sys
0003 import os
0004 sys.path.insert(0, os.path.join(
0005     os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
0006     "lib"
0007 ))
0008 from lottie.utils import script
0009 from lottie import objects
0010 from lottie.utils import animation as anutils
0011 from lottie import Point, Color
0012 
0013 
0014 an = objects.Animation(180)
0015 
0016 layer = objects.ShapeLayer()
0017 an.add_layer(layer)
0018 
0019 group = layer.add_shape(objects.Group())
0020 bez = group.add_shape(objects.Path())
0021 bez.shape.value.add_point(Point(256, 128), Point(0, 0), Point(64, 64))
0022 bez.shape.value.add_smooth_point(Point(256, 256+120), Point(32, -32))
0023 bez.shape.value.add_point(Point(256, 256), Point(-64, -64), Point(-64, 64))
0024 bez.shape.value.add_point(Point(128, 256+120), Point(64, 64), Point(0, 0))
0025 group.add_shape(objects.Stroke(Color(1, 0, 0), 10))
0026 
0027 
0028 group = layer.add_shape(objects.Group())
0029 sh = anutils.generate_path_segment(bez.shape.value, 0, 180, 60, 180, 60, True)
0030 group.add_shape(sh)
0031 group.add_shape(objects.Stroke(Color(0, 1, 0), 20))
0032 
0033 
0034 script.script_main(an)
0035