timeline_slider
_timeline_slider
¶
Timeline/scrubber widget for DCC applications.
Classes:
| Name | Description |
|---|---|
FXTimelineSlider |
A timeline/scrubber widget perfect for DCC applications. |
Classes¶
FXTimelineSlider
¶
FXTimelineSlider(
parent: Optional[QWidget] = None,
start_frame: int = 1,
end_frame: int = 100,
current_frame: Optional[int] = None,
fps: int = 24,
show_controls: bool = True,
show_spinbox: bool = True,
)
Bases: FXThemeAware, QWidget
flowchart TD
fxgui.fxwidgets._timeline_slider.FXTimelineSlider[FXTimelineSlider]
fxgui.fxstyle.FXThemeAware[FXThemeAware]
fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets._timeline_slider.FXTimelineSlider
click fxgui.fxwidgets._timeline_slider.FXTimelineSlider href "" "fxgui.fxwidgets._timeline_slider.FXTimelineSlider"
click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
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 |
|---|---|---|---|
|
Optional[QWidget]
|
Parent widget. |
None
|
|
int
|
Start frame of the timeline. |
1
|
|
int
|
End frame of the timeline. |
100
|
|
Optional[int]
|
Initial current frame. |
None
|
|
int
|
Frames per second for playback (default 24). |
24
|
|
bool
|
Whether to show playback controls. |
True
|
|
bool
|
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_keyframe |
Add a keyframe marker. |
clear_keyframes |
Remove all keyframe markers. |
go_to_end |
Go to the end frame. |
go_to_start |
Go to the start frame. |
next_frame |
Advance to the next frame. |
play |
Start playback. |
previous_frame |
Go to the previous frame. |
remove_keyframe |
Remove a keyframe marker. |
set_fps |
Set the frames per second. |
set_frame |
Set the current frame. |
set_range |
Set the frame range. |
stop |
Stop playback. |
toggle_playback |
Toggle playback state. |
Attributes:
| Name | Type | Description |
|---|---|---|
current_frame |
int
|
Return the current frame. |
fps |
int
|
Return the current FPS. |
frame_range |
Tuple[int, int]
|
Return the frame range as (start, end). |