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

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 import Point, Color
0011 
0012 
0013 last_frame = 60
0014 an = objects.Animation(last_frame)
0015 
0016 layer = objects.ShapeLayer()
0017 an.add_layer(layer)
0018 
0019 group = layer.add_shape(objects.Group())
0020 
0021 star = objects.Star()
0022 star.inner_radius.value = 40
0023 star.outer_radius.value = 100
0024 star.position.value = Point(256, 256)
0025 star.name = "big start"
0026 group.add_shape(star)
0027 
0028 star = objects.Star()
0029 star.inner_radius.value = 20
0030 star.outer_radius.value = 50
0031 star.position.value = Point(256, 256)
0032 star.name = "small start"
0033 group.add_shape(star)
0034 
0035 obj = objects.Path()
0036 obj.shape.value.add_point(Point(10, 10))
0037 obj.shape.value.add_point(Point(500, 10))
0038 group.add_shape(obj)
0039 
0040 trim = layer.add_shape(objects.Trim())
0041 #trim.offset.value = 350
0042 trim.offset.add_keyframe(0, 0)
0043 trim.offset.add_keyframe(last_frame, 360)
0044 trim.start.value = 0
0045 trim.end.value = 50
0046 #trim.multiple = objects.TrimMultipleShapes.Individually
0047 
0048 stroke = group.add_shape(objects.Stroke(Color(1, 1, 0), 10))
0049 
0050 script.script_main(an)