1 from .base
import LottieObject, Index, LottieProp
2 from .layers
import Layer
8 Base class for layer holders
22 for layer
in self.
layerslayers:
23 if layer.index == index:
25 raise IndexError(
"No layer %s" % index)
29 @brief Appends a layer to the composition
36 obj = super().
load(lottiedict)
41 for layer
in self.
layerslayers:
42 layer.composition = self
46 @brief Inserts a layer to the composition
47 @note Layers added first will be rendered on top of later layers
49 self.
layerslayers.insert(index, layer)
54 layer.composition = self
55 if layer.index
is None:
59 def _on_prepare_layer(self, layer):
60 raise NotImplementedError
69 @brief Removes a layer (and all of its children) from this composition
70 @param layer Layer to be removed
72 if layer.composition
is not self:
75 children = list(layer.children)
77 layer.composition =
None
78 self.
layerslayers.remove(layer)
Simple iterator to generate increasing integers.
Base class for mapping Python classes into Lottie JSON objects.
Lottie <-> Python property mapper.
Base class for layer holders.
def add_layer(self, Layer layer)
Appends a layer to the composition.
def _on_prepare_layer(self, layer)
def clone(self)
Returns a copy of the object.
def prepare_layer(self, Layer layer)
layers
List of Composition Layers.
def remove_layer(self, Layer layer)
Removes a layer (and all of its children) from this composition.
def insert_layer(self, index, Layer layer)
Inserts a layer to the composition.
def load(cls, lottiedict)
Loads from a JSON object.