ITimeline#

class omni.timeline.ITimeline#

Bases: pybind11_object

Factory class for creating Timeline instances.

Timeline control, setter and getter methods are all deprecated and forwarded to the default Timeline. These must be accessed through a Timeline instance:

import omni.timeline
timeline = omni.timeline.get_timeline_interface()
timeline.play()

Methods

__init__(*args, **kwargs)

clear_tentative_time(self)

Clear tentative time of animation in seconds.

destroy_timeline(self, name)

Destroys the timeline with the given name if nothing references it.

forward_one_frame(self)

Forwards the timeline by one frame.

get_current_tick(self)

Gets the current tick index, starting from zero.

get_current_time(self)

Gets current time of animation in seconds.

get_end_time(self)

Gets the end time of animation in seconds.

get_fast_mode(self)

Checks if fast mode is on or off.

get_start_time(self)

Gets the start time of animation in seconds.

get_target_framerate(self)

Gets the target frame rate, which affects the derived FPS of the runloop in play mode.

get_tentative_time(self)

Gets tentative time of animation in seconds.

get_ticks_per_frame(self)

Gets the tick count per frame, i.e. how many times update event is ticked per frame.

get_ticks_per_second(self)

Gets the tick count per seconds, i.e. how many times update event is ticked per second.

get_time_codes_per_second(self)

Gets timeCodePerSecond metadata from currently opened stage.

get_time_codes_per_seconds(self)

Gets timeCodePerSecond metadata from currently opened stage.

get_timeline(self[, name])

Returns the timeline with the given name or creates a new if it does not exist.

get_timeline_event_stream(self)

Gets TimelineEventStream, emitting TimelineEventType.

is_auto_updating(self)

Checks if timeline is auto updating.

is_looping(self)

Checks if animation is looping.

is_playing(self)

Checks if animation is playing.

is_prerolling(self)

Checks if timeline is prerolling.

is_stopped(self)

Checks if animation is stopped, as opposed to paused.

pause(self)

Pauses animation.

play(self[, start_timecode, end_timecode, ...])

Plays animation with current timeCodePerSecond.

rewind_one_frame(self)

Rewinds the timeline by one frame.

set_auto_update(self, auto_update)

Turns on/off auto update.

set_current_time(self, time_in_seconds)

Sets current time of animation in seconds.

set_end_time(self, end_time)

Sets the end time of animation in seconds.

set_fast_mode(self, fast_mode)

Turns fast mode on or off.

set_looping(self, looping)

Sets animation looping mode.

set_prerolling(self, preroll)

Turns on/off preroll status.

set_start_time(self, start_time)

Sets the begin time of animation in seconds.

set_target_framerate(self, target_framerate)

Sets the target frame rate, which affects the derived FPS of the runloop in play mode.

set_tentative_time(self, time_in_seconds)

Sets tentative time of animation in seconds.

set_ticks_per_frame(self, ticks_per_frame)

Sets the tick count per frame, i.e. how many times update event is ticked per frame.

set_time_codes_per_second(self, ...)

Sets timeCodePerSecond metadata to currently opened stage.

stop(self)

Stops animation.

__init__(*args, **kwargs)#
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_second(
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_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.

This function is same as get_time_codes_per_second but incorrectly named. Kept for backwards compatibility.

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::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.

Parameters:
  • start_timecode – start timecode of session play, won’t change the global StartTime.

  • end_timecode – start timecode of session play, won’t change the global EndTime.

  • 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.