WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

B-R-P/AnimPro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnimPro

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.

Features

  • 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

File Overview

  • AnimPro.py
    Main entry point for scene creation and animation rendering.

    • Defines the Scene class for managing frames and rendering to video.
    • Functions for generating screens (genScreen) and saving frames (saveframes).
  • Objects.py
    Contains definitions for geometric primitives and their behaviors.

    • BaseElement is the core class for graphical objects.
    • Derived classes include: Line, Rect, Circle, Ellipse, Polygon, PolyLine, Text.
  • Operations.py
    Animation operations and transformations.

    • Animate class 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.

Getting Started

Install dependencies

Requires Python 3, FFMPEG, svgwrite, and tqdm.

pip install svgwrite tqdm

Example Usage

from 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")

Usage Example

  • Define objects using classes from Objects.py.
  • Animate them with Operations.py.
  • Render and export using AnimPro.py.

About

Manim inspired animation library

Topics

Resources

Stars

Watchers

Forks

Languages