python-lottie  0.6.10+dev42a5126
A framework to work with lottie files and telegram animated stickers (tgs)
lottie.objects.animation.Animation Class Reference

Top level object, describing the animation. More...

Inheritance diagram for lottie.objects.animation.Animation:
[legend]
Collaboration diagram for lottie.objects.animation.Animation:
[legend]

Public Member Functions

def __init__ (self, n_frames=60, framerate=60)
 
def precomp (self, name)
 
def to_precomp (self)
 Turns the main comp into a precomp. More...
 
def scale (self, width, height)
 Scales the animation so it fits in width/height. More...
 
def tgs_sanitize (self)
 Cleans up some things to ensure it works as a telegram sticker. More...
 
def __str__ (self)
 
- Public Member Functions inherited from lottie.objects.composition.Composition
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 clone_into (self, other)
 
- Public Member Functions inherited from lottie.objects.base.LottieObjectMeta
def __new__ (cls, name, bases, attr)
 
- Public Member Functions inherited from lottie.objects.helpers.VisualObject
def __init__ (self)
 

Public Attributes

 in_point
 The time when the composition work area begins, in frames. More...
 
 out_point
 The time when the composition work area ends. More...
 
 frame_rate
 Frames per second. More...
 
 width
 Composition Width. More...
 
 threedimensional
 Composition has 3-D layers. More...
 
 height
 Composition Height. More...
 
 version
 Bodymovin Version. More...
 
 assets
 source items that can be used in multiple places. More...
 
 chars
 source chars for text layers More...
 
 fonts
 Available fonts. More...
 
 metadata
 
 motion_blur
 
 markers
 
 layers
 
- Public Attributes inherited from lottie.objects.composition.Composition
 layers
 List of Composition Layers. More...
 
- Public Attributes inherited from lottie.objects.helpers.VisualObject
 name
 
 match_name
 

Detailed Description

Top level object, describing the animation.

See also
http://docs.aenhancers.com/items/compitem/
Lottie JSON
Lottie name Type Description Attribute
layers list of Layer   layers
nm str   name
mn str   match_name
v str Bodymovin Version.   version
fr float Frames per second.   frame_rate
ip float The time when the composition work area begins, in frames.   in_point
op float The time when the composition work area ends.   out_point
w int Composition Width.   width
h int Composition Height.   height
ddd 0-1 int Composition has 3-D layers.   threedimensional
assets list of Asset source items that can be used in multiple places.   assets
fonts FontList Available fonts.   fonts
chars list of Chars source chars for text layers   chars
markers list of Marker   markers
mb MotionBlur   motion_blur
meta Metadata   metadata

Definition at line 62 of file animation.py.

Constructor & Destructor Documentation

◆ __init__()

def lottie.objects.animation.Animation.__init__ (   self,
  n_frames = 60,
  framerate = 60 
)

Definition at line 86 of file animation.py.

Member Function Documentation

◆ __str__()

def lottie.objects.animation.Animation.__str__ (   self)

Reimplemented from lottie.objects.base.LottieObject.

Definition at line 191 of file animation.py.

◆ precomp()

def lottie.objects.animation.Animation.precomp (   self,
  name 
)

Definition at line 113 of file animation.py.

◆ scale()

def lottie.objects.animation.Animation.scale (   self,
  width,
  height 
)

Scales the animation so it fits in width/height.

Definition at line 159 of file animation.py.

◆ tgs_sanitize()

def lottie.objects.animation.Animation.tgs_sanitize (   self)

Cleans up some things to ensure it works as a telegram sticker.

Definition at line 172 of file animation.py.

◆ to_precomp()

def lottie.objects.animation.Animation.to_precomp (   self)

Turns the main comp into a precomp.

Definition at line 125 of file animation.py.

Member Data Documentation

◆ assets

lottie.objects.animation.Animation.assets

source items that can be used in multiple places.

Comps and Images for now.

Definition at line 104 of file animation.py.

◆ chars

lottie.objects.animation.Animation.chars

source chars for text layers

Definition at line 106 of file animation.py.

◆ fonts

lottie.objects.animation.Animation.fonts

Available fonts.

Definition at line 108 of file animation.py.

◆ frame_rate

lottie.objects.animation.Animation.frame_rate

Frames per second.

Definition at line 94 of file animation.py.

◆ height

lottie.objects.animation.Animation.height

Composition Height.

Definition at line 100 of file animation.py.

◆ in_point

lottie.objects.animation.Animation.in_point

The time when the composition work area begins, in frames.

Definition at line 89 of file animation.py.

◆ layers

lottie.objects.animation.Animation.layers

Definition at line 156 of file animation.py.

◆ markers

lottie.objects.animation.Animation.markers

Definition at line 111 of file animation.py.

◆ metadata

lottie.objects.animation.Animation.metadata

Definition at line 109 of file animation.py.

◆ motion_blur

lottie.objects.animation.Animation.motion_blur

Definition at line 110 of file animation.py.

◆ out_point

lottie.objects.animation.Animation.out_point

The time when the composition work area ends.

Sets the final Frame of the animation

Definition at line 92 of file animation.py.

◆ threedimensional

lottie.objects.animation.Animation.threedimensional

Composition has 3-D layers.

Definition at line 98 of file animation.py.

◆ version

lottie.objects.animation.Animation.version

Bodymovin Version.

Definition at line 102 of file animation.py.

◆ width

lottie.objects.animation.Animation.width

Composition Width.

Definition at line 96 of file animation.py.


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