Timeline Slider¶
A timeline slider with markers for frame-based or time-based navigation.
Preview
FXTimelineSlider
¶
Bases: ,
A timeline/scrubber widget perfect for DCC applications.
This widget provides a timeline slider with: - Frame range display - Keyframe markers - Current frame indicator - Optional playback controls
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
|
Parent widget. |
None
|
|
|
Start frame of the timeline. |
1
|
|
|
End frame of the timeline. |
100
|
|
|
Initial current frame. |
None
|
|
|
Frames per second for playback (default 24). |
24
|
|
|
Whether to show playback controls. |
True
|
|
|
Whether to show the frame spinbox. |
True
|
Signals
frame_changed: Emitted when the current frame changes. playback_started: Emitted when playback starts. playback_stopped: Emitted when playback stops.
Examples:
>>> timeline = FXTimelineSlider(start_frame=1, end_frame=100)
>>> timeline.frame_changed.connect(lambda f: print(f"Frame: {f}"))
>>> timeline.add_keyframe(10)
>>> timeline.add_keyframe(50)
Methods:
| Name | Description |
|---|---|
|
Add a keyframe marker. |
|
Remove all keyframe markers. |
|
Go to the end frame. |
|
Go to the start frame. |
|
Advance to the next frame. |
|
Start playback. |
|
Go to the previous frame. |
|
Remove a keyframe marker. |
|
Set the frames per second. |
|
Set the current frame. |
|
Set the frame range. |
|
Stop playback. |
|
Toggle playback state. |
Attributes:
| Name | Type | Description |
|---|---|---|
|
|
Return the current frame. |
|
|
Return the current FPS. |
|
|
Return the frame range as (start, end). |
add_keyframe
¶
Add a keyframe marker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
|
The frame number to mark. |
required |
remove_keyframe
¶
Remove a keyframe marker.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
|
The frame number to remove. |
required |
set_fps
¶
Set the frames per second.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
|
Frames per second for playback. |
required |