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-timeline --clone
# or just
# gh repo clone brisvag/qt-animation-timeline
cd qt-animation-timeline
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.1.tar.gz (29.8 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.1-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qt_animation_timeline-0.1.1.tar.gz
  • Upload date:
  • Size: 29.8 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.1.tar.gz
Algorithm Hash digest
SHA256 477cb5992bdc13382622d99b2568f949e4d5cb1acda87721aefba1694bfef79e
MD5 41cdaee8db08d2cdba7aa125de447c9d
BLAKE2b-256 840d2b66b96f76199371ab7dadbadc92b30e090fd32d82774067163a85bdf3c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for qt_animation_timeline-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for qt_animation_timeline-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3181ddc148d6743f6ebc4050be3806cd7883e62469a5ffaeaec67faded3b0c97
MD5 20fe8e007eefd7ec8aff8d009ef2efbc
BLAKE2b-256 7ae8a6957b499fc47f254a91cfce0e3b6b86725e621fadeb0a8c96159641a49c

See more details on using hashes here.

Provenance

The following attestation bundles were made for qt_animation_timeline-0.1.1-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