AnimPro is a Python-based animation programming toolkit focused on vector graphics and SVG manipulations. The library is structured to support the creation, animation, and rendering of graphical scenes, and includes tools for defining geometric objects, applying animations, and exporting video sequences.
- Define and manipulate geometric objects (lines, rectangles, circles, polygons, text, etc.)
- Apply transformations and animations (move, rotate, zoom, fade, stroke, etc.)
- Render scenes to SVG frames and compile those into video
- Utility functions for vector math and transformations
-
AnimPro.py
Main entry point for scene creation and animation rendering.- Defines the
Sceneclass for managing frames and rendering to video. - Functions for generating screens (
genScreen) and saving frames (saveframes).
- Defines the
-
Objects.py
Contains definitions for geometric primitives and their behaviors.BaseElementis the core class for graphical objects.- Derived classes include:
Line,Rect,Circle,Ellipse,Polygon,PolyLine,Text.
-
Operations.py
Animation operations and transformations.Animateclass allows for zoom, rotate, flip, move, fade, and other animations on objects.
-
utils.py
Utility functions for mathematical operations and coordinate manipulations.- Rotation matrices, distance calculations, style utilities, etc.
Requires Python 3, FFMPEG, svgwrite, and tqdm.
pip install svgwrite tqdmfrom AnimPro import Scene
from Objects import Rect, Circle
from Operations import Animate
# Create a scene
scene = Scene(800, 600, background="white")
# Make objects
rect = Rect((100, 100), (200, 150), scene.screen)
circ = Circle((400, 300), 50, scene.screen)
# Animate objects
anim = Animate(rect)
frames = list(anim.move((300, 300), frame=30))
# Render frames
scene.render(frames)
scene.render_video("output.mp4")- Define objects using classes from
Objects.py. - Animate them with
Operations.py. - Render and export using
AnimPro.py.