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.parsers.svg import parse_svg_file 0011 from lottie import Point, Color 0012 0013 0014 an = parse_svg_file(os.path.join( 0015 os.path.dirname(os.path.abspath(__file__)), 0016 "blep.svg" 0017 )) 0018 0019 layer = an.insert_layer(0, objects.ShapeLayer()) 0020 r = layer.add_shape(objects.Rect()) 0021 r.position.value = Point(256, 256) 0022 r.size.value = Point(512, 512) 0023 gf = layer.add_shape(objects.GradientFill([(0, Color(1, 1, 1)), (1, Color(0, 0, 0))])) 0024 gf.start_point.value = Point(256, 256) 0025 gf.end_point.value = Point(256, 64) 0026 0027 an.layers[-1].matte_mode = objects.MatteMode.Luma 0028 0029 0030 script.script_main(an) 0031