7 from ..parsers.svg.svgdata
import color_table
8 from ..parsers.svg.importer
import parse_color, parse_svg_file
9 from ..objects.animation
import Animation
10 from ..objects
import layers
11 from ..objects
import shapes
12 from ..nvector
import NVector
13 from .font
import FontStyle
17 "alice": {
"blue": {
"_": 1}},
18 "antique": {
"white": {
"_": 1}},
27 "blanched": {
"almond": {
"_": 1}},
34 "burly": {
"wood": {
"_": 1}},
35 "cadet": {
"blue": {
"_": 1}},
36 "chartreuse": {
"_": 1},
37 "chocolate": {
"_": 1},
39 "cornflower": {
"blue": {
"_": 1}},
42 "flower": {
"blue": {
"_": 1}},
49 "golden": {
"rod": {
"_": 1}},
55 "olive": {
"green": {
"_": 1}},
60 "sea": {
"green": {
"_": 1}},
66 "turquoise": {
"_": 1},
71 "sky": {
"blue": {
"_": 1}},
77 "dodger": {
"blue": {
"_": 1}},
78 "fire": {
"brick": {
"_": 1}},
79 "floral": {
"white": {
"_": 1}},
80 "forest": {
"green": {
"_": 1}},
82 "gainsboro": {
"_": 1},
83 "ghost": {
"white": {
"_": 1}},
85 "golden": {
"rod": {
"_": 1}},
94 "indian": {
"red": {
"_": 1}},
102 "lawn": {
"green": {
"_": 1}},
103 "lemon": {
"chiffon": {
"_": 1}},
119 "sea": {
"green": {
"_": 1}},
120 "sky": {
"blue": {
"_": 1}},
125 "steel": {
"blue": {
"_": 1}},
136 "aquamarine": {
"_": 1},
140 "sea": {
"green": {
"_": 1}},
141 "slate": {
"blue": {
"_": 1}},
142 "spring": {
"green": {
"_": 1}},
143 "turquoise": {
"_": 1},
144 "violet": {
"red": {
"_": 1}},
146 "midnight": {
"blue": {
"_": 1}},
147 "mint": {
"cream": {
"_": 1}},
148 "misty": {
"rose": {
"_": 1}},
149 "moccasin": {
"_": 1},
150 "navajo": {
"white": {
"_": 1}},
155 "old": {
"lace": {
"_": 1}},
166 "golden": {
"rod": {
"_": 1}},
168 "turquoise": {
"_": 1},
169 "violet": {
"red": {
"_": 1}},
171 "papaya": {
"whip": {
"_": 1}},
172 "peach": {
"puff": {
"_": 1}},
176 "powder": {
"blue": {
"_": 1}},
179 "rosy": {
"brown": {
"_": 1}},
180 "royal": {
"blue": {
"_": 1}},
181 "saddle": {
"brown": {
"_": 1}},
183 "sandy": {
"brown": {
"_": 1}},
188 "seashell": {
"_": 1},
191 "sky": {
"blue": {
"_": 1}},
198 "spring": {
"green": {
"_": 1}},
199 "steel": {
"blue": {
"_": 1}},
204 "turquoise": {
"_": 1},
223 Punctuation = enum.auto()
235 value: typing.Any =
None
245 if self.
typetype == TokenType.Eof:
247 return repr(self.
valuevalue)
251 Position = enum.auto()
256 Integer = enum.auto()
260 def __init__(self, name, phrase, props, type: AnimatableType):
267 for prop
in self.
propsprops:
274 for prop
in self.
propsprops:
275 if not prop.animated
and time > 0:
276 prop.add_keyframe(0, prop.value)
277 prop.add_keyframe(time, value)
280 for prop
in self.
propsprops:
282 prop.add_keyframe(time, prop.get_value(0))
304 self.
extentextent *= multiplier
310 self.
propertiesproperties[name].props.append(prop)
314 expression = re.compile(
315 r'[\r\t ]*(?P<token>(?P<punc>[:,;.])|(?P<word>[a-zA-Z\']+)|(?P<color>#(?:[a-fA-F0-9]{3}){1,2})|' +
316 r'(?P<number>-?[0-9]+(?P<fraction>\.[0-9]+)?)|(?P<string>"(?:[^"\\]|\\["\\nbt])+"))[\r\t ]*'
328 def _new_token(self, token: Token):
329 self.
tokentoken = token
330 self.
tokenstokens.append(token)
338 return self.
tokentoken
341 if self.
pospos >= len(self.
texttext):
344 if self.
texttext[self.
pospos] ==
'\n':
355 if match.group(
"word"):
356 type = TokenType.Word
357 value = match.group(
"word").lower()
358 elif match.group(
"number"):
359 type = TokenType.Number
360 if match.group(
"fraction"):
361 value =
float(match.group(
"number"))
363 value =
int(match.group(
"number"))
364 elif match.group(
"string"):
365 type = TokenType.String
366 value = match.group(
"string")[1:-1]
367 elif match.group(
"punc"):
368 value = match.group(
"punc")
369 type = TokenType.Punctuation
370 elif match.group(
"color"):
371 value = match.group(
"color")
372 type = TokenType.Color
374 self.
pospos = match.end(
"token")
394 sys.stderr.write(message)
395 sys.stderr.write(
"\n")
403 class StorageLogger(Logger):
408 self.
messagesmessages.append(message)
435 return self.
lexerlexer.token
438 return self.
get_colorget_color(color_words,
"")
441 if isinstance(value, str):
442 return NVector(*color_table[value])
443 elif isinstance(value, (list, tuple)):
445 elif isinstance(value, NVector):
448 return NVector(*color_table[complete_word])
454 next_item =
next(iter(word_dict.item()))
455 return self.
complete_colorcomplete_color(next_item[1], complete_word + next_item[0])
457 def get_color(self, word_dict: dict, complete_word: str):
458 if self.
tokentoken.type == TokenType.Color:
463 if self.
tokentoken.type != TokenType.Word:
466 value = word_dict.get(self.
tokentoken.value,
None)
470 if isinstance(value, dict):
471 next_word = complete_word + self.
tokentoken.value
473 color = self.
get_colorget_color(value, next_word)
474 if color
is not None:
480 self.
warnwarn(
"Incomplete color name")
485 token = self.
tokentoken
486 self.
loggerlogger.
warn(
"At line %s column %s, near %r: %s" % (token.line, token.col, token, message))
491 if self.
check_wordscheck_words(
"animation",
"composition"):
495 self.
lexerlexer.back()
497 if self.
tokentoken.type != TokenType.Eof:
498 self.
warnwarn(
"Extra tokens")
508 if self.
tokentoken.type != TokenType.Word:
511 return self.
tokentoken.value
in words
523 self.
warnwarn(
"Expected " + repr(words[0]))
527 token = self.
tokentoken
528 index = self.
lexerlexer.save()
530 if token.type != TokenType.Word
or token.value != word:
532 token = self.
nextnext()
536 self.
lexerlexer.restore(index)
540 return self.
skip_wordsskip_words(
"its",
"his",
"her",
"their")
542 def properties(self, shape_data, callback, callback_args=[], words=["with"]):
545 must_have_property = self.
skip_wordsskip_words(*words)
549 lexind = self.
lexerlexer.save()
551 if not callback(*callback_args):
552 self.
lexerlexer.restore(lexind)
555 if must_have_property:
556 self.
warnwarn(
"Unknown property")
559 self.
lexerlexer.restore(lexind_and)
562 lexind_and = self.
lexerlexer.save()
567 if self.
check_wordscheck_words(*properties.keys()):
568 prop = self.
tokentoken.value
573 value = properties[prop](getattr(object, prop))
574 setattr(object, prop, value)
580 if self.
check_wordscheck_words(
"lasts",
"lasting"):
585 elif self.
check_wordscheck_words(
"stops",
"stopping",
"loops",
"looping"):
607 if self.
tokentoken.type != TokenType.Number:
608 self.
warnwarn(
"Expected time")
611 amount = self.
tokentoken.value
614 if self.
check_wordscheck_words(
"seconds",
"second"):
615 amount *= self.
lottielottie.frame_rate
616 elif self.
check_wordscheck_words(
"milliseconds",
"millisecond"):
617 amount *= self.
lottielottie.frame_rate / 1000
618 elif not self.
check_wordscheck_words(
"frames",
"frame"):
619 self.
warnwarn(
"Missing time unit")
626 if self.
tokentoken.type != TokenType.Number
or not isinstance(self.
tokentoken.value, int):
628 self.
warnwarn(
"Expected integer")
631 val = self.
tokentoken.value
636 if self.
tokentoken.type != TokenType.Number:
637 self.
warnwarn(
"Expected number")
640 val = self.
tokentoken.value
646 if self.
tokentoken.type != TokenType.String:
647 self.
warnwarn(
"Expected string")
650 val = self.
tokentoken.value
656 if self.
tokentoken.type == TokenType.Punctuation
and self.
tokentoken.value
in ";.":
663 self.
layerlayer(composition)
668 self.
layerlayer(composition)
670 self.
lexerlexer.back()
671 self.
layerlayer(composition)
672 elif self.
tokentoken.type == TokenType.Number
and isinstance(self.
tokentoken.value, int):
673 self.
layerlayer(composition)
680 return self.
integerinteger(default)
683 if self.
tokentoken.type != TokenType.Word:
684 self.
warnwarn(
"Expected shape")
687 layer = layers.ShapeLayer()
688 layer.in_point = self.
lottielottie.in_point
689 layer.out_point = self.
lottielottie.out_point
690 composition.insert_layer(0, layer)
694 if self.
tokentoken.type == TokenType.Punctuation
and self.
tokentoken.value
in ",;.":
698 if self.
tokentoken.type == TokenType.Punctuation
and self.
tokentoken.value ==
",":
705 extent = min(self.
lottielottie.width, self.
lottielottie.height) * 0.4
707 shape.count = self.
countcount()
712 color = self.
colorcolor()
716 shape.color_explicit =
True
718 if self.
check_wordscheck_words(
"transparent",
"invisible"):
726 shape.scale(size_mult)
730 shape.portrait =
True
735 shape.portrait =
False
738 lexind = self.
lexerlexer.save()
741 shape.roundness = qualifier
745 shape.opacity = (1 / qualifier)
748 elif lexind < self.
lexerlexer.token_index:
749 self.
lexerlexer.restore(lexind)
751 if self.
check_wordscheck_words(
"star",
"polygon",
"ellipse",
"rectangle",
"circle",
"square",
"text"):
752 shape_type = self.
tokentoken.value
753 function = getattr(self,
"shape_" + shape_type)
755 shape_object = function(shape)
756 self.
add_shapeadd_shape(parent, shape_object, shape)
759 if self.
tokentoken.type == TokenType.Word:
760 for name, sides
in self.
sidessides.items():
761 if self.
tokentoken.value.startswith(name):
762 if self.
tokentoken.value.endswith(
"gon"):
765 self.
add_shapeadd_shape(parent, shape_object, shape)
767 elif self.
tokentoken.value.endswith(
"gram"):
769 shape_object = self.
shape_starshape_star(shape, sides)
770 self.
add_shapeadd_shape(parent, shape_object, shape)
776 self.
add_shapeadd_shape(parent, shape_object, shape)
779 sides = self.
integerinteger(
None,
False)
780 if sides
is not None:
781 if self.
check_wordscheck_words(
"sided",
"pointed"):
784 shape_type = self.
tokentoken.value
785 function = getattr(self,
"shape_" + shape_type)
787 shape_object = function(shape, sides)
788 self.
add_shapeadd_shape(parent, shape_object, shape)
791 self.
warnwarn(
"Expected 'star' or 'polygon'")
797 if svg_shape.match(parent, self, shape):
804 self.
warnwarn(
"Expected shape")
825 lexind = self.
lexerlexer.save()
841 self.
lexerlexer.restore(lexind)
846 g.add_shape(shape_object)
848 if shape_data.stroke
and shape_data.stroke_on_top:
849 g.add_shape(shape_data.stroke)
852 fill = shapes.Fill(shape_data.color)
854 shape_data.define_property(
"color", AnimatableType.Color, [fill.color])
856 if shape_data.stroke
and not shape_data.stroke_on_top:
857 g.add_shape(shape_data.stroke)
859 if shape_data.opacity != 1:
860 g.transform.opacity.value = 100 * shape_data.opacity
862 if "position" in shape_data.properties:
863 center = shape_data.properties[
"position"].get_initial()
865 center = g.bounding_box(0).center()
866 g.transform.position.value = self.
positionposition(g, 0) + center
867 g.transform.anchor_point.value =
NVector(*center)
868 shape_data.define_property(
"position", AnimatableType.Position, [g.transform.position], [
"moves"])
869 shape_data.define_property(
"rotation", AnimatableType.Angle, [g.transform.rotation], [
"rotates"])
873 g.transform.rotation.value = self.
angleangle(0)
875 parent.insert_shape(0, g)
882 def position(self, shape: shapes.Group, time: float):
888 if self.
check_wordscheck_words(
"to",
"in",
"towards",
"on",
"at"):
892 if self.
tokentoken.type != TokenType.Word:
893 self.
warnwarn(
"Expected position")
905 elif self.
check_wordscheck_words(
"center",
"middle"):
915 if px == 0
and py == 0:
916 return shape.transform.position.get_value(time)
918 box = shape.bounding_box(time)
919 center = box.center()
921 right = self.
lottielottie.width - box.width / 2
923 bottom = self.
lottielottie.height - box.height / 2
925 pos = shape.transform.position.get_value(time)
933 dx = right - center.y
938 dy = bottom - center.y
950 return self.
lottielottie.out_point
951 return self.
timetime(time)
953 return self.
timetime(0) + time
963 changing = self.
skip_wordsskip_words(
"changing",
"changes")
965 found_property =
None
969 if possesive
or changing:
970 for property
in shape_data.properties.values():
972 found_property = property
973 if possesive
and not changing:
983 for property
in shape_data.properties.values():
985 found_property = property
989 if not found_property:
990 self.
warnwarn(
"Unknown property")
993 if prop_time
is None:
998 found_property.loop(time)
1003 found_property.add_keyframe(time, value)
1006 cont = self.
skip_wordsskip_words(
"then")
or cont
1011 if property.type == AnimatableType.Angle:
1012 return self.
angleangle(
None)
1013 elif property.type == AnimatableType.Number:
1014 return self.
numbernumber(
None)
1015 elif property.type == AnimatableType.Integer:
1016 return self.
integerinteger(
None)
1017 elif property.type == AnimatableType.Color:
1018 value = self.
colorcolor()
1020 self.
warnwarn(
"Expected color")
1022 elif property.type == AnimatableType.Position:
1023 return self.
position_valueposition_value(property.get_value(time))
1024 elif property.type == AnimatableType.Size:
1035 if value
is not None and relative:
1036 value += property.get_value(time)
1042 if self.
tokentoken.type == TokenType.Punctuation
and self.
tokentoken.value ==
",":
1050 if self.
tokentoken.type == TokenType.Word:
1057 elif self.
check_wordscheck_words(
"up",
"upwards",
"upward"):
1059 elif self.
check_wordscheck_words(
"down",
"downwards",
"downward"):
1062 if direction
is None:
1063 self.
warnwarn(
"Expected direction or position")
1068 return start + direction * self.
numbernumber()
1077 got_color = self.
colorcolor()
1085 width *= 1.5 * quant
1089 width *= 0.6 / quant
1094 if self.
check_wordscheck_words(
"stroke",
"border",
"outline",
"edge",
"borders",
"edges"):
1096 shape_data.stroke = shapes.Stroke(color, width)
1102 for property
in shape_data.properties.values():
1111 size =
NVector(shape_data.extent, shape_data.extent)
1112 round_base = shape_data.extent / 5
1113 shape = shapes.Rect(pos, size, shape_data.roundness * round_base)
1114 shape_data.define_property(
"position", AnimatableType.Position, [shape.position])
1115 shape_data.define_property(
"size", AnimatableType.Size, [shape.position])
1121 size =
NVector(shape_data.extent, shape_data.extent)
1122 shape = shapes.Ellipse(pos, size)
1123 shape_data.define_property(
"position", AnimatableType.Position, [shape.position])
1124 shape_data.define_property(
"size", AnimatableType.Size, [shape.position])
1130 round_base = shape_data.extent / 5
1131 roundness = shape_data.roundness * round_base
1132 shape = shapes.Star()
1133 shape.position.value = pos
1134 shape.inner_roundness.value = roundness
1135 shape.outer_radius.value = shape_data.extent / 2
1136 shape.outer_roundness.value = roundness
1137 shape.star_type = shapes.StarType.Star
1138 shape.points.value = sides
or 5
1145 shape.outer_radius.value = self.
numbernumber(shape.outer_radius.value) / 2
1147 elif self.
tokentoken.type == TokenType.Number:
1149 self.
warnwarn(
"Number of sides already specified")
1150 shape.points.value = self.
integerinteger(shape.points.value)
1151 if self.
require_one_ofrequire_one_of(
"points",
"sides",
"point",
"side"):
1156 shape.inner_radius.value = shape.outer_radius.value / 2
1158 shape_data.define_property(
"position", AnimatableType.Position, [shape.position])
1159 shape_data.define_property(
"outer radius", AnimatableType.Number, [shape.outer_radius])
1160 shape_data.define_property(
"radius", AnimatableType.Number, [shape.outer_radius])
1161 shape_data.define_property(
"inner radius", AnimatableType.Number, [shape.inner_radius])
1162 self.
propertiesproperties(shape_data, callback, [], [
"with",
"of",
"has"])
1167 shape = self.
shape_starshape_star(shape_data, sides)
1168 shape.inner_radius =
None
1169 shape.inner_roundness =
None
1170 shape.star_type = shapes.StarType.Polygon
1188 amount = self.
numbernumber(1)
1193 elif self.
check_wordscheck_words(
"half",
"halfs"):
1195 return amount / 2,
True
1196 elif self.
check_wordscheck_words(
"third",
"thirds"):
1198 return amount / 3,
True
1199 elif self.
check_wordscheck_words(
"quarter",
"quarters"):
1201 return amount / 3,
True
1203 return amount,
False
1208 amount, has_fraction = self.
fractionfraction()
1211 more_frac = self.
fractionfraction()[0]
1213 amount += amount * more_frac
1229 return amount * direction
1232 extent = shape_data.extent
1236 "ratio": math.sqrt(2),
1237 "size_specified":
False
1239 handle_orientation =
True
1241 shape_data.define_property(
"position", AnimatableType.Position, [shape.position])
1242 shape_data.define_property(
"size", AnimatableType.Size, [shape.size])
1252 self.
warnwarn(
"Ratio must be positive")
1254 parse_data[
"ratio"] = ratio
1258 parse_data[
"width"] = self.
numbernumber(0)
1262 parse_data[
"height"] = self.
numbernumber(0)
1265 parse_data[
"size_specified"] =
True
1269 self.
propertiesproperties(shape_data, callback, [], [
"with",
"of",
"has"])
1271 if not parse_data[
"size_specified"]:
1272 width = parse_data[
"width"]
1273 height = parse_data[
"height"]
1274 ratio = parse_data[
"ratio"]
1276 if width
is None and height
is None:
1278 height = width / ratio
1280 width = height * ratio
1281 elif height
is None:
1282 height = width / ratio
1284 handle_orientation =
False
1286 if handle_orientation:
1287 if (width > height
and shape_data.portrait)
or (width < height
and not shape_data.portrait):
1288 width, height = height, width
1290 shape.size.value =
NVector(width, height)
1294 round_base = shape_data.extent / 5
1296 shape = shapes.Rect(pos,
NVector(0, 0), shape_data.roundness * round_base)
1297 shape_data.define_property(
"roundness", AnimatableType.Number, [shape.rounded])
1303 shape = shapes.Ellipse(pos,
NVector(0, 0))
1308 text = self.
stringstring(
"")
1309 font = self.
fontfont.clone()
1310 shape = font.render(text)
1312 box = shape.bounding_box()
1314 center = box.center()
1316 shape.transform.anchor_point.value = anim_center
1317 shape.transform.position.value.y = self.
lottielottie.height - center.y
1318 shape.transform.position.value.x = self.
lottielottie.width - center.x
1320 scale = shape_data.size_multiplitier
1321 if box.width > self.
lottielottie.width > 0:
1322 scale *= self.
lottielottie.width / box.width
1325 wrapper = shapes.Group()
1326 wrapper.transform.position.value = wrapper.transform.anchor_point.value = anim_center
1327 wrapper.transform.scale.value *= scale
1328 wrapper.add_shape(shape)
1339 if filename
in self.
cachecache:
1340 return self.
cachecache[filename]
1343 self.
cachecache[filename] = anim
1356 found = lottie_object.find(layer_name)
1358 objects.append(found)
1360 objects = [lottie_object]
1362 for object
in objects:
1363 for styler
in object.find_all((shapes.Fill, shapes.Stroke)):
1364 if len(self.
colorscolors) == 0
or styler.color.value
in self.
colorscolors:
1368 for styler
in self.
iter_stylersiter_stylers(lottie_object):
1369 styler.color.value = new_color
1373 def __init__(self, file, phrase, feature_map, main_feature, facing_direction, svg_loader: SvgLoader):
1377 if isinstance(main_feature, str):
1384 def callback(self, parser: Parser, shape_data: ShapeData):
1385 lexind = parser.lexer.save()
1386 color = parser.color()
1388 if parser.check_words(*self.
feature_mapfeature_map.keys()):
1389 feature_name = parser.lexer.token.value
1390 shape_data.properties[feature_name].set_initial(color)
1394 parser.lexer.restore(lexind)
1398 def match(self, parent, parser: Parser, shape_data: ShapeData):
1399 if not parser.check_word_sequence(self.
phrasephrase):
1402 shape_data.stroke_on_top =
False
1403 svg_anim =
parse_svg_file(self.
filefile, 0, parser.lottie.out_point, parser.lottie.frame_rate)
1404 layer = svg_anim.layers[0].clone()
1405 group = shapes.Group()
1406 group.name = layer.name
1407 group.shapes = layer.shapes + group.shapes
1408 layer.transform.clone_into(group.transform)
1410 wrapper = shapes.Group()
1411 wrapper.add_shape(group)
1413 delta_ap = group.bounding_box(0).center()
1414 wrapper.transform.anchor_point.value += delta_ap
1415 wrapper.transform.position.value += delta_ap
1416 wrapper.transform.scale.value *= shape_data.size_multiplitier
1418 for name, feature
in self.
feature_mapfeature_map.items():
1419 singular = name[:-1]
if name.endswith(
"s")
else name
1420 shape_data.properties[name] =
AnimatableProperty(singular +
" color",
None, [], AnimatableType.Color)
1421 for styler
in feature.iter_stylers(group):
1422 shape_data.add_property(name, styler.color)
1425 shape_data.define_property(
"color", AnimatableType.Color, [])
1427 for styler
in self.
main_featuremain_feature.iter_stylers(group):
1428 shape_data.add_property(
"color", styler.color)
1430 if shape_data.color
and shape_data.color_explicit:
1431 shape_data.properties[
"color"].set_initial(shape_data.color)
1433 parser.properties(shape_data, self.
callbackcallback, [parser, shape_data], [
"with"])
1435 if self.
facing_directionfacing_direction != 0
and parser.check_words(
"facing",
"looking"):
1437 if parser.skip_words(
"to"):
1438 parser.skip_words(
"the")
1440 if parser.check_words(
"left",
"right"):
1441 direction = -1
if parser.token.value ==
"left" else 1
1443 wrapper.transform.scale.value.x *= -1
1445 parser.warn(
"Missing facing direction")
1449 shape_data.color =
None
1450 parser.add_shape(parent, wrapper, shape_data)
Top level object, describing the animation.
def set_initial(self, value)
def __init__(self, name, phrase, props, AnimatableType type)
def add_keyframe(self, time, value)
def get_value(self, time)
def _new_token(self, Token token)
def check_word_sequence(self, words)
def count(self, default=1)
def string(self, default)
def simple_properties_callback(self, object, properties)
def position(self, shapes.Group shape, float time)
def position_value(self, NVector start)
def animated_property_value(self, AnimatableProperty property, time)
def add_shape(self, parent, shape_object, shape_data)
def get_color_value(self, value, str complete_word)
def shape_common_property(self, ShapeData shape_data)
def rect_properties(self, ShapeData shape_data, shape)
def require_one_of(self, *words)
def shape_ellipse(self, ShapeData shape_data)
def angle_direction(self)
def shape_rectangle(self, ShapeData shape_data)
def shape_polygon(self, ShapeData shape_data, int sides=None)
def check_words(self, *words)
def number(self, default)
def size_multiplitier(self)
def integer(self, default, warn=True)
def layers(self, composition)
def get_color(self, dict word_dict, str complete_word)
def shape_square(self, ShapeData shape_data)
def skip_words(self, *words)
def animated_properties_callback(self, ShapeData shape_data)
def __init__(self, text, Logger logger)
def shape_star(self, ShapeData shape_data, int sides=None)
def shape_circle(self, ShapeData shape_data)
def animated_properties(self, ShapeData shape_data)
def shape_list(self, parent)
def animation_time(self, time, required)
def complete_color(self, dict word_dict, str complete_word)
def layer(self, composition)
def shape_text(self, ShapeData shape_data)
def properties(self, shape_data, callback, callback_args=[], words=["with"])
def animated_property(self, ShapeData shape_data, AnimatableProperty property, time)
def scale(self, multiplier)
def define_property(self, name, type, props, phrase=None)
def add_property(self, name, prop)
def __init__(self, extent)
def process(self, lottie_object, new_color)
def __init__(self, layer_names, colors)
def iter_stylers(self, lottie_object)
def callback(self, Parser parser, ShapeData shape_data)
def match(self, parent, Parser parser, ShapeData shape_data)
def __init__(self, file, phrase, feature_map, main_feature, facing_direction, SvgLoader svg_loader)
def __init__(self, TokenType type, int line, int col, int start, int end, typing.Any value=None)
def parse_svg_file(file, layer_frames=0, *args, **kwargs)