python-lottie  0.6.10+dev4166086
A framework to work with lottie files and telegram animated stickers (tgs)
lottie.objects.composition.Composition Class Reference

Base class for layer holders. More...

Inheritance diagram for lottie.objects.composition.Composition:
[legend]
Collaboration diagram for lottie.objects.composition.Composition:
[legend]

Public Member Functions

def __init__ (self)
 
def layer (self, index)
 
def add_layer (self, Layer layer)
 Appends a layer to the composition. More...
 
def load (cls, lottiedict)
 Loads from a JSON object. More...
 
def insert_layer (self, index, Layer layer)
 Inserts a layer to the composition. More...
 
def prepare_layer (self, Layer layer)
 
def clone (self)
 Returns a copy of the object. More...
 
def remove_layer (self, Layer layer)
 Removes a layer (and all of its children) from this composition. More...
 
- Public Member Functions inherited from lottie.objects.base.LottieObject
def to_dict (self)
 Serializes into a JSON object fit for the Lottie format. More...
 
def find (self, search, propname="name")
 Recursively searches for child objects with a matching property. More...
 
def find_all (self, type, predicate=None, include_self=True)
 Find all child objects that match a predicate. More...
 
def __str__ (self)
 
- Public Member Functions inherited from lottie.objects.base.LottieObjectMeta
def __new__ (cls, name, bases, attr)
 

Public Attributes

 layers
 List of Composition Layers. More...
 

Detailed Description

Base class for layer holders.

Lottie JSON
Lottie name Type Description Attribute
layers list of Layer List of Composition Layers.   layers

Definition at line 6 of file composition.py.

Constructor & Destructor Documentation

◆ __init__()

def lottie.objects.composition.Composition.__init__ (   self)

Definition at line 14 of file composition.py.

Member Function Documentation

◆ add_layer()

def lottie.objects.composition.Composition.add_layer (   self,
Layer  layer 
)

Appends a layer to the composition.

See also
insert_layer

Definition at line 26 of file composition.py.

◆ clone()

def lottie.objects.composition.Composition.clone (   self)

Returns a copy of the object.

Reimplemented from lottie.objects.base.LottieObject.

Definition at line 61 of file composition.py.

◆ insert_layer()

def lottie.objects.composition.Composition.insert_layer (   self,
  index,
Layer  layer 
)

Inserts a layer to the composition.

Note
Layers added first will be rendered on top of later layers

Definition at line 43 of file composition.py.

◆ layer()

def lottie.objects.composition.Composition.layer (   self,
  index 
)

Definition at line 20 of file composition.py.

◆ load()

def lottie.objects.composition.Composition.load (   cls,
  lottiedict 
)

Loads from a JSON object.

Returns
An instance of the class

Reimplemented from lottie.objects.base.LottieObject.

Definition at line 34 of file composition.py.

◆ prepare_layer()

def lottie.objects.composition.Composition.prepare_layer (   self,
Layer  layer 
)

Definition at line 52 of file composition.py.

◆ remove_layer()

def lottie.objects.composition.Composition.remove_layer (   self,
Layer  layer 
)

Removes a layer (and all of its children) from this composition.

Parameters
layerLayer to be removed

Definition at line 66 of file composition.py.

Member Data Documentation

◆ layers

lottie.objects.composition.Composition.layers

List of Composition Layers.

Definition at line 16 of file composition.py.


The documentation for this class was generated from the following file: