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 size': (circleset, 'circle2.size')  # or (circleset.circle2, size)
}
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.3.tar.gz (30.4 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.3-py3-none-any.whl (22.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qt_animation_timeline-0.1.3.tar.gz
  • Upload date:
  • Size: 30.4 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.3.tar.gz
Algorithm Hash digest
SHA256 037aa1c9336da278a0d9d706c6eff3a189e5338da13beb456e1621c333602e10
MD5 350b40ede3e60c5b947b4161568e89f0
BLAKE2b-256 5c455d0fbdc377e8b54d5892621ed74172fcb1cfe5360f18b2ed7e5e552617ba

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for qt_animation_timeline-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 cb62f09ad9d651f36b047906f6c4ded08a48fc57e04bd719cb0c086eeffd7ed2
MD5 eebd1c0c23e1fc6a89630fe2ea5de1eb
BLAKE2b-256 cee2e18c8ab1929adb1a88cd332832c75a4ead24dcf76ce533ba630c267d8613

See more details on using hashes here.

Provenance

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