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.2.tar.gz (30.3 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.2-py3-none-any.whl (22.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qt_animation_timeline-0.1.2.tar.gz
  • Upload date:
  • Size: 30.3 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.2.tar.gz
Algorithm Hash digest
SHA256 bb29c07ebc97922d7e449b6594ede251daeae2b708726687d1d06fe6b4c984e9
MD5 805f003a9e79d09732a464ed5a5f80aa
BLAKE2b-256 a08771e91d281fc0b60bb0401600a3a32956ff3b631b681e967ec2adf4594b4e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for qt_animation_timeline-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cff9563d7b08f3d9c025bf1fa5968ee84ddf4a18bb9040b2dee907d07d26be72
MD5 5d84434b4cb36c7cae2d3764542ed43a
BLAKE2b-256 db9e18d6dcea267297c499c8569be37d8886b14b8fa00cbdb4cfc4d5ff97f3dc

See more details on using hashes here.

Provenance

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