4 sys.path.insert(0, os.path.join(
5 os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
9 from lottie
import objects, NVector
10 from lottie
import Color, Point
13 an = objects.Animation(59)
15 layer = objects.ShapeLayer()
18 g1 = layer.add_shape(objects.Group())
20 circle = g1.add_shape(objects.Ellipse())
21 circle.size.value =
Point(100, 100)
22 circle.position.value =
Point(128, 156)
25 fill = g1.add_shape(objects.GradientFill())
26 fill.start_point.value =
Point(100, 0)
27 fill.end_point.value =
Point(200, 0)
28 fill.colors.set_stops([(0, Color(1, 0, 0)), (1, Color(1, 1, 0))])
31 stroke = g1.add_shape(objects.GradientStroke(5))
32 stroke.start_point.value =
Point(100, 0)
33 stroke.end_point.value =
Point(200, 0)
34 stroke.colors.add_keyframe( 0, [(0, Color(1, 0, 0)), (1, Color(1, 1, 0))])
35 stroke.colors.add_keyframe(10, [(0, Color(1, 1, 0)), (1, Color(0, 1, 0))])
36 stroke.colors.add_keyframe(30, [(0, Color(1, 0, 1)), (1, Color(0, 0, 1))])
37 stroke.colors.add_keyframe(59, [(0, Color(1, 0, 0)), (1, Color(1, 1, 0))])
38 stroke.colors.count = 2
39 stroke.width.value = 10
42 g2 = layer.add_shape(objects.Group())
44 circle = g2.add_shape(objects.Ellipse())
45 circle.size.value =
Point(200, 200)
46 circle.position.value =
Point(128+256, 256)
49 fill = g2.add_shape(objects.GradientFill())
50 fill.gradient_type = objects.GradientType.Radial
51 fill.start_point.value =
Point(128+256, 256)
52 fill.end_point.value =
Point(128+256+100, 256)
53 fill.colors.set_stops([(0, Color(1, 0, 0)), (1, Color(1, 1, 0))])
58 fill.highlight_length.value = 90
61 g3 = layer.add_shape(objects.Group())
62 circle = g3.add_shape(objects.Ellipse())
63 circle.size.value =
Point(100, 100)
64 circle.position.value =
Point(128, 356)
65 fill = g3.add_shape(objects.GradientFill())
66 fill.start_point.value =
Point(100, 0)
67 fill.end_point.value =
Point(200, 0)
68 fill.colors.set_stops([(0, NVector(1, 0, 0, 1)), (0.5, NVector(1, .5, 0, 1)), (1, NVector(1, 1, 0, 0))])
71 script.script_main(an)