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

0001 #!/usr/bin/env python3
0002 
0003 import sys
0004 import os
0005 sys.path.insert(0, os.path.join(
0006     os.path.dirname(os.path.dirname(os.path.abspath(__file__))),
0007     "lib"
0008 ))
0009 from lottie.utils import script
0010 from lottie import objects
0011 from lottie.parsers.svg import parse_svg_file
0012 from lottie import Point, Color
0013 
0014 
0015 an = parse_svg_file(os.path.join(
0016     os.path.dirname(os.path.abspath(__file__)),
0017     "blep.svg"
0018 ))
0019 
0020 
0021 maskshape = objects.Star()
0022 maskshape.inner_radius.value = 100
0023 maskshape.outer_radius.value = 200
0024 maskshape.rotation.value = 180
0025 maskshape.position.value = Point(256, 256)
0026 #maskshape.size.value = Point(256, 256)
0027 maskbez = maskshape.to_bezier()
0028 
0029 mask = objects.Mask(maskbez.shape.value)
0030 an.layers[0].masks = [mask]
0031 
0032 
0033 g = an.layers[0].add_shape(objects.Group())
0034 r = g.add_shape(objects.Rect())
0035 r.position.value = Point(256, 256)
0036 r.size.value = Point(512, 512)
0037 g.add_shape(objects.Fill(Color(1, 1, 1)))
0038 
0039 
0040 script.script_main(an)