omni.timeline
- class omni.timeline.ITimeline
- clear_tentative_time(self: omni.timeline._timeline.ITimeline) None
Clear tentative time of animation in seconds.
Clear/Invalidate the tentative time
- destroy_timeline(self: omni.timeline._timeline.ITimeline, name: str) bool
Destroys the timeline with the given name if nothing references it. Does not release the default timeline.
- Parameters
timeline. (name of the) –
- Returns
True if a timeline was deleted, False otherwise. The latter happens when the timeline does not exist, it is in use, or it is the default timeline.
- forward_one_frame(self: omni.timeline._timeline.ITimeline) None
Forwards the timeline by one frame.
- get_current_tick(self: omni.timeline._timeline.ITimeline) int
Gets the current tick index, starting from zero. Always returns zero when ticks per frame is one.
- Returns
The current tick index.
- get_current_time(self: omni.timeline._timeline.ITimeline) float
Gets current time of animation in seconds.
- Returns
Current time of animation in seconds.
- get_end_time(self: omni.timeline._timeline.ITimeline) float
Gets the end time of animation in seconds.
- Returns
End time of animation in seconds.
- get_fast_mode(self: omni.timeline._timeline.ITimeline) bool
Checks if fast mode is on or off.
- Returns
true is fast mode is on.
- get_start_time(self: omni.timeline._timeline.ITimeline) float
Gets the start time of animation in seconds.
- Returns
Start time of animation in seconds.
- get_target_framerate(self: omni.timeline._timeline.ITimeline) float
Gets the target frame rate, which affects the derived FPS of the runloop in play mode. Exact runloop FPS is usually not the same as this value, as it is always a multiple of get_time_codes_per_seconds.
- Returns
The target frame rate.
- get_tentative_time(self: omni.timeline._timeline.ITimeline) float
Gets tentative time of animation in seconds.
- Returns
Tentative time of animation if it is valid, otherwise return current time
- get_ticks_per_frame(self: omni.timeline._timeline.ITimeline) int
Gets the tick count per frame, i.e. how many times update event is ticked per frame.
- Returns
The tick per frame count.
- get_ticks_per_second(self: omni.timeline._timeline.ITimeline) float
Gets the tick count per seconds, i.e. how many times update event is ticked per second.
- Returns
The tick per second count.
- get_time_codes_per_seconds(self: omni.timeline._timeline.ITimeline) float
Gets timeCodePerSecond metadata from currently opened stage. This is equivalent to calling GetTimeCodesPerSecond on UsdStage.
- Returns
timeCodePerSecond for current UsdStage.
- get_timeline(self: omni.timeline._timeline.ITimeline, name: str = '') omni.timeline._timeline.Timeline
Returns the timeline with the given name or creates a new if it does not exist.
- Parameters
name – The name of the timeline.
- Returns
Timeline object.
- get_timeline_event_stream(self: omni.timeline._timeline.ITimeline) carb.events._events.IEventStream
Gets TimelineEventStream, emitting TimelineEventType.
- Returns
TimelineEventStream.
- is_auto_updating(self: omni.timeline._timeline.ITimeline) bool
Checks if timeline is auto updating.
- Returns
True if timeline is auto updating. False otherwise.
- is_looping(self: omni.timeline._timeline.ITimeline) bool
Checks if animation is looping.
- Returns
True if animation is looping. False otherwise.
- is_playing(self: omni.timeline._timeline.ITimeline) bool
Checks if animation is playing.
- Returns
True if animation is playing. False otherwise.
- is_prerolling(self: omni.timeline._timeline.ITimeline) bool
Checks if timeline is prerolling.
- Returns
True if timeline is prerolling. False otherwise.
- is_stopped(self: omni.timeline._timeline.ITimeline) bool
Checks if animation is stopped, as opposed to paused.
- Returns
True if animation is stopped. False otherwise.
- pause(self: omni.timeline._timeline.ITimeline) None
Pauses animation.
- play(self: omni.timeline._timeline.ITimeline, start_timecode: float = 0, end_timecode: float = 0, looping: bool = True) None
Plays animation with current timeCodePerSecond. if not set session start and end timecode, will play from global start time to end time in stage. :param start_timecode: start timecode of session play, won’t change the global StartTime. :param end_timecode: start timecode of session play, won’t change the global EndTime. :param looping: true to enable session play looping, false to disable, won’t change the global Looping.
- rewind_one_frame(self: omni.timeline._timeline.ITimeline) None
Rewinds the timeline by one frame.
- set_auto_update(self: omni.timeline._timeline.ITimeline, auto_update: bool) None
Turns on/off auto update.
- Parameters
auto_update – True to enable auto update, False to disable.
- set_current_time(self: omni.timeline._timeline.ITimeline, time_in_seconds: float) None
Sets current time of animation in seconds.
- Parameters
seconds. (time_in_seconds Current time of animation in) –
- set_end_time(self: omni.timeline._timeline.ITimeline, end_time: float) None
Sets the end time of animation in seconds. This will write into current opened stage.
- Parameters
end_time – End time of animation in seconds.
- set_fast_mode(self: omni.timeline._timeline.ITimeline, fast_mode: bool) None
Turns fast mode on or off.
- Parameters
mode (fast_mode true to turn on fast) –
off. (false to turn it) –
- set_looping(self: omni.timeline._timeline.ITimeline, looping: bool) None
Sets animation looping mode.
- Parameters
looping – True to enable looping, False to disable.
- set_prerolling(self: omni.timeline._timeline.ITimeline, preroll: bool) None
Turns on/off preroll status.
- Parameters
preroll – True to enable preroll, False to disable.
- set_start_time(self: omni.timeline._timeline.ITimeline, start_time: float) None
Sets the begin time of animation in seconds. This will write into current opened stage.
- Parameters
start_time – Begin time of animation in seconds.
- set_target_framerate(self: omni.timeline._timeline.ITimeline, target_framerate: float) None
Sets the target frame rate, which affects the derived FPS of the runloop in play mode. Exact runloop FPS is usually not the same as this value, as it is always a multiple of get_time_codes_per_seconds.
- Parameters
rate. (target_framerate The target frame) –
- set_tentative_time(self: omni.timeline._timeline.ITimeline, time_in_seconds: float) None
Sets tentative time of animation in seconds.
- Parameters
seconds. (time_in_seconds Tentative time of animation in) –
- set_ticks_per_frame(self: omni.timeline._timeline.ITimeline, ticks_per_frame: int) None
Sets the tick count per frame, i.e. how many times update event is ticked per frame.
- Parameters
ticks_per_frame – The tick per frame count.
- set_time_codes_per_second(self: omni.timeline._timeline.ITimeline, time_codes_per_second: float) None
Sets timeCodePerSecond metadata to currently opened stage. This is equivalent to calling SetTimeCodesPerSecond on UsdStage.
- Parameters
time_codes_per_second – TimeCodePerSecond to set into current stage.
- stop(self: omni.timeline._timeline.ITimeline) None
Stops animation.
- class omni.timeline.Timeline
- clear_tentative_time(self: omni.timeline._timeline.Timeline) None
Clear tentative time of animation in seconds.
Clear/Invalidate the tentative time
- clear_zoom(self: omni.timeline._timeline.Timeline) None
Clears the zoom state, i.e. sets the zoom range to [get_start_time(), get_end_time()].
- commit(self: omni.timeline._timeline.Timeline) None
Applies all pending state changes and invokes all callbacks.
This method is not thread-safe, it should be called only from the main thread.
- commit_silently(self: omni.timeline._timeline.Timeline) None
Applies all pending state changes but does not invoke any callbacks.
This method is thread-safe.
- forward_one_frame(self: omni.timeline._timeline.Timeline) None
Forwards the timeline by one frame.
- get_current_tick(self: omni.timeline._timeline.Timeline) int
Gets the current tick index, starting from zero. Always returns zero when ticks per frame is one.
- Returns
The current tick index.
- get_current_time(self: omni.timeline._timeline.Timeline) float
Gets current time of animation in seconds.
- Returns
Current time of animation in seconds.
- get_director(self: omni.timeline._timeline.Timeline) omni.timeline._timeline.Timeline
Returns the current director Timeline.
- Returns
The director timeline object or None if none is set.
- get_end_time(self: omni.timeline._timeline.Timeline) float
Gets the end time of animation in seconds.
- Returns
End time of animation in seconds.
- get_fast_mode(self: omni.timeline._timeline.Timeline) bool
Checks if fast mode is on or off. Deprecated, same as get_play_every_frame.
- Returns
true is fast mode is on.
- get_play_every_frame(self: omni.timeline._timeline.Timeline) bool
Checks if the timeline sends updates every frame. Same as get_fast_mode.
- Returns
true if the timeline does not skip frames.
- get_start_time(self: omni.timeline._timeline.Timeline) float
Gets the start time of animation in seconds.
- Returns
Start time of animation in seconds.
- get_target_framerate(self: omni.timeline._timeline.Timeline) float
Gets the target frame rate, which affects the derived FPS of the runloop in play mode. Exact runloop FPS is usually not the same as this value, as it is always a multiple of get_time_codes_per_seconds.
- Returns
The target frame rate.
- get_tentative_time(self: omni.timeline._timeline.Timeline) float
Gets tentative time of animation in seconds.
- Returns
Tentative time of animation if it is valid, otherwise return current time
- get_ticks_per_frame(self: omni.timeline._timeline.Timeline) int
Gets the tick count per frame, i.e. how many times update event is ticked per frame.
- Returns
The tick per frame count.
- get_ticks_per_second(self: omni.timeline._timeline.Timeline) float
Gets the tick count per seconds, i.e. how many times update event is ticked per second.
- Returns
The tick per second count.
- get_time_codes_per_seconds(self: omni.timeline._timeline.Timeline) float
Gets timeCodePerSecond metadata from currently opened stage. This is equivalent to calling GetTimeCodesPerSecond on UsdStage.
- Returns
timeCodePerSecond for current UsdStage.
- get_timeline_event_stream(self: omni.timeline._timeline.Timeline) carb.events._events.IEventStream
Gets TimelineEventStream, emitting TimelineEventType.
- Returns
TimelineEventStream.
- get_zoom_end_time(self: omni.timeline._timeline.Timeline) float
Gets the end time of zoomed animation in seconds.
- Returns
End time of zoomed animation in seconds. When no zoom is set, this function returns get_end_time().
- get_zoom_start_time(self: omni.timeline._timeline.Timeline) float
Gets the start time of zoomed animation in seconds.
- Returns
Start time of zoomed animation in seconds. When no zoom is set, this function returns get_start_time().
- is_auto_updating(self: omni.timeline._timeline.Timeline) bool
Checks if timeline is auto updating.
- Returns
True if timeline is auto updating. False otherwise.
- is_looping(self: omni.timeline._timeline.Timeline) bool
Checks if animation is looping.
- Returns
True if animation is looping. False otherwise.
- is_playing(self: omni.timeline._timeline.Timeline) bool
Checks if animation is playing.
- Returns
True if animation is playing. False otherwise.
- is_prerolling(self: omni.timeline._timeline.Timeline) bool
Checks if timeline is prerolling.
- Returns
True if timeline is prerolling. False otherwise.
- is_stopped(self: omni.timeline._timeline.Timeline) bool
Checks if animation is stopped, as opposed to paused.
- Returns
True if animation is stopped. False otherwise.
- is_zoomed(self: omni.timeline._timeline.Timeline) bool
- Returns whether a zoom is set, i.e. whether the zoom range is not the entire
[getStartTime(), getEndTime()] interval.
- Returns
True if get_start_time() < get_zoom_start_time() or get_zoom_end_time() < get_end_time() (note that “<=” always holds). False otherwise.
- pause(self: omni.timeline._timeline.Timeline) None
Pauses animation.
- play(self: omni.timeline._timeline.Timeline, start_timecode: float = 0, end_timecode: float = 0, looping: bool = True) None
Plays animation with current timeCodePerSecond. if not set session start and end timecode, will play from global start time to end time in stage. :param start_timecode: start timecode of session play, won’t change the global StartTime. :param end_timecode: start timecode of session play, won’t change the global EndTime. :param looping: true to enable session play looping, false to disable, won’t change the global Looping.
- rewind_one_frame(self: omni.timeline._timeline.Timeline) None
Rewinds the timeline by one frame.
- set_auto_update(self: omni.timeline._timeline.Timeline, auto_update: bool) None
Turns on/off auto update.
- Parameters
auto_update – True to enable auto update, False to disable.
- set_current_time(self: omni.timeline._timeline.Timeline, time_in_seconds: float) None
Sets current time of animation in seconds.
- Parameters
seconds. (time_in_seconds Current time of animation in) –
- set_director(self: omni.timeline._timeline.Timeline, timeline: omni.timeline._timeline.Timeline) None
Sets a director Timeline.
- When a director is set, the timeline mimics its behavior and any
state changing call from all other sources are ignored.
- Parameters
timeline – The timeline object to be set as the director. Pass None to clear the current director.
- set_end_time(self: omni.timeline._timeline.Timeline, end_time: float) None
Sets the end time of animation in seconds. This will write into current opened stage.
- Parameters
end_time – End time of animation in seconds.
- set_fast_mode(self: omni.timeline._timeline.Timeline, fast_mode: bool) None
Turns fast mode on or off. Deprecated, same as set_play_every_frame.
- Parameters
mode (fast_mode true to turn on fast) –
off. (false to turn it) –
- set_looping(self: omni.timeline._timeline.Timeline, looping: bool) None
Sets animation looping mode.
- Parameters
looping – True to enable looping, False to disable.
- set_play_every_frame(self: omni.timeline._timeline.Timeline, play_every_frame: bool) None
Turns frame skipping off (true) or on (false). Same as set_fast_mode.
- Parameters
off. (play_every_frame true to turn frame skipping) –
- set_prerolling(self: omni.timeline._timeline.Timeline, preroll: bool) None
Turns on/off preroll status.
- Parameters
preroll – True to enable preroll, False to disable.
- set_start_time(self: omni.timeline._timeline.Timeline, start_time: float) None
Sets the begin time of animation in seconds. This will write into current opened stage.
- Parameters
start_time – Begin time of animation in seconds.
- set_target_framerate(self: omni.timeline._timeline.Timeline, target_framerate: float) None
Sets the target frame rate, which affects the derived FPS of the runloop in play mode. Exact runloop FPS is usually not the same as this value, as it is always a multiple of get_time_codes_per_seconds.
- Parameters
rate. (target_framerate The target frame) –
- set_tentative_time(self: omni.timeline._timeline.Timeline, time_in_seconds: float) None
Sets tentative time of animation in seconds.
- Parameters
seconds. (time_in_seconds Tentative time of animation in) –
- set_ticks_per_frame(self: omni.timeline._timeline.Timeline, ticks_per_frame: int) None
Sets the tick count per frame, i.e. how many times update event is ticked per frame.
- Parameters
ticks_per_frame – The tick per frame count.
- set_time_codes_per_second(self: omni.timeline._timeline.Timeline, time_codes_per_second: float) None
Sets timeCodePerSecond metadata to currently opened stage. This is equivalent to calling SetTimeCodesPerSecond on UsdStage.
- Parameters
time_codes_per_second – TimeCodePerSecond to set into current stage.
- set_zoom_range(self: omni.timeline._timeline.Timeline, start_time: float, end_time: float) None
Sets the zoom range, i.e. the playback interval. Values are truncated to the [get_start_time(), get_end_time()] interval, which is also the default range. A minimum of one frame long range is enforced.
- Parameters
start_time – Start time of zoom in seconds. Must be less or equal than end_time.
end_time – End time of zoom in seconds. Must be greater or equal than start_time.
- stop(self: omni.timeline._timeline.Timeline) None
Stops animation.
- time_code_to_time(self: omni.timeline._timeline.Timeline, arg0: float) float
Converts time codes to seconds, w.r.t. the current timeCodesPerSecond setting of the timeline.
- Returns
The converted time code.
- time_to_time_code(self: omni.timeline._timeline.Timeline, arg0: float) float
Converts time in seconds to time codes, w.r.t. the current timeCodesPerSecond setting of the timeline.
- Returns
The converted time code.
- class omni.timeline.TimelineEventType
Timeline event types to be used by TimelineEventStream.
Members:
PLAY
PAUSE
STOP
CURRENT_TIME_CHANGED
CURRENT_TIME_TICKED_PERMANENT
CURRENT_TIME_TICKED
LOOP_MODE_CHANGED
START_TIME_CHANGED
END_TIME_CHANGED
TIME_CODE_PER_SECOND_CHANGED
AUTO_UPDATE_CHANGED
PREROLLING_CHANGED
TENTATIVE_TIME_CHANGED
TICKS_PER_FRAME_CHANGED
FAST_MODE_CHANGED
PLAY_EVERY_FRAME_CHANGED
TARGET_FRAMERATE_CHANGED
DIRECTOR_CHANGED
ZOOM_CHANGED
- AUTO_UPDATE_CHANGED = <TimelineEventType.AUTO_UPDATE_CHANGED: 10>
- CURRENT_TIME_CHANGED = <TimelineEventType.CURRENT_TIME_CHANGED: 3>
- CURRENT_TIME_TICKED = <TimelineEventType.CURRENT_TIME_TICKED: 5>
- CURRENT_TIME_TICKED_PERMANENT = <TimelineEventType.CURRENT_TIME_TICKED_PERMANENT: 4>
- DIRECTOR_CHANGED = <TimelineEventType.DIRECTOR_CHANGED: 16>
- END_TIME_CHANGED = <TimelineEventType.END_TIME_CHANGED: 8>
- FAST_MODE_CHANGED = <TimelineEventType.FAST_MODE_CHANGED: 14>
- LOOP_MODE_CHANGED = <TimelineEventType.LOOP_MODE_CHANGED: 6>
- PAUSE = <TimelineEventType.PAUSE: 1>
- PLAY = <TimelineEventType.PLAY: 0>
- PLAY_EVERY_FRAME_CHANGED = <TimelineEventType.FAST_MODE_CHANGED: 14>
- PREROLLING_CHANGED = <TimelineEventType.PREROLLING_CHANGED: 11>
- START_TIME_CHANGED = <TimelineEventType.START_TIME_CHANGED: 7>
- STOP = <TimelineEventType.STOP: 2>
- TARGET_FRAMERATE_CHANGED = <TimelineEventType.TARGET_FRAMERATE_CHANGED: 15>
- TENTATIVE_TIME_CHANGED = <TimelineEventType.TENTATIVE_TIME_CHANGED: 12>
- TICKS_PER_FRAME_CHANGED = <TimelineEventType.TICKS_PER_FRAME_CHANGED: 13>
- TIME_CODE_PER_SECOND_CHANGED = <TimelineEventType.TIME_CODE_PER_SECOND_CHANGED: 9>
- ZOOM_CHANGED = <TimelineEventType.ZOOM_CHANGED: 17>
- property name
- property value
- omni.timeline.acquire_timeline_interface(plugin_name: str = None, library_path: str = None) omni.timeline._timeline.ITimeline
- omni.timeline.destroy_timeline(timeline_name: str)
Destroys a timeline object with the given name, if it is not the default timeline and it is not in use.
- omni.timeline.get_timeline_interface(timeline_name: str = '') Timeline
Returns the timeline with the given name via cached
omni.timeline.ITimeline
interface
- omni.timeline.release_timeline_interface(arg0: omni.timeline._timeline.ITimeline) None