Skip to main content

Package description.

Project description

qt-animation-timeline

License PyPI Python Version CI codecov

A blender-style timeline widget for qt to edit animations.

image

Controls

Action Mouse/Key binding Region
New Keyframe Double click Track
Select Keyframe Click Keyframe
Select multiple Ctrl + Click Keyframe
Select with box Shift + Click Tracks
Delete selected Del -
Move Selected Keyframes Drag Keyframe
Move whole track Drag Track Line
Change easing function Right Click Track Line or Keyframe
Scrub playhead Drag Header
Select play range Shift + Drag Header
Play/Pause animation Space -

Usage

The widget takes a mapping of track names to python objects and attribute names, allowing automatic setting of the interpolated values of such object given the current state of the animation model.

The widget is designed to work with nested dataclass/pydantic style models, but will work just fine with anything else non-nested.

from pydantic import BaseModel
from qt_animation_timeline import AnimationTimelineWidget

class Circle(BaseModel):
    color: tuple[int, int, int] = (255, 0, 0)
    size: float = 10
    filled: bool = True
    other_stuff: str = "thing"

circle = Circle()

# mapping of names of tracks to a tuple of object/attribute
# any time a change in the animation occur, the object's attribute
# will be updated with the new interpolated value.
track_options = {
    'color': (circle, 'color'),
    'size': (circle, 'size')
}

timeline = AnimationTimelineWidget(track_options=track_options)
timeline.show()

This will allow to animate the color and size, updating the model accordingly when the playhead scrubs along the animation.

When a keyframe is created manually, it will inherit the current model value for the given attribute.

Note that this also works for nested models whenever possible:

class CircleSet(BaseModel):
    circle1: Circle = Circle()
    circle2: Circle = Circle()

circleset = CircleSet()

track_options = {
    'circle 1': (circleset, 'circle1'),
    'circle 2': (circleset, 'circle2')
}
timeline = AnimationTimelineWidget(track_options=track_options)
timeline.show()

In this case, the whole model is considered the keyframe value, and all its elements will be interpolated.

Development

The easiest way to get started is to use the github cli and uv:

gh repo fork brisvag/qt-animation-editor/qt-animation-editor --clone
# or just
# gh repo clone brisvag/qt-animation-editor/qt-animation-editor
cd qt-animation-editor
uv sync

Run tests:

uv run pytest

Lint files:

uv run pre-commit run --all-files

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qt_animation_timeline-0.1.0.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qt_animation_timeline-0.1.0-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file qt_animation_timeline-0.1.0.tar.gz.

File metadata

  • Download URL: qt_animation_timeline-0.1.0.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qt_animation_timeline-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6b64ae115659564b874c04697edfbb6dd52d400b38f1bb2bf88c6116332731c1
MD5 50b1202746d52425d0d0cba82a2363e7
BLAKE2b-256 f19c88ab6db602bf812047493da6c308bda5c380f693269ff6d9969d2b153c48

See more details on using hashes here.

Provenance

The following attestation bundles were made for qt_animation_timeline-0.1.0.tar.gz:

Publisher: ci.yml on brisvag/qt-animation-timeline

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qt_animation_timeline-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for qt_animation_timeline-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 393a492f328a825dc7b94e2b88c41ad0fbf9415db8d74292c7bf6cefb52fec7a
MD5 a945a63aed310c80affd042794d6f941
BLAKE2b-256 e5343ad063642f17d706bb95747b18602394ed580f12dfe11241fc35cd08fb47

See more details on using hashes here.

Provenance

The following attestation bundles were made for qt_animation_timeline-0.1.0-py3-none-any.whl:

Publisher: ci.yml on brisvag/qt-animation-timeline

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page