Code or API to set up 'Scene End' which in Sequencer

Dose someone know the code of setting the ‘Scene End’ value in the lower right corner in the Sequencer extension ??
I only use the Curve Editor to run animation.After I done my animation,I need to manual modify the end frame to correspond animation.

Thanks

@kevin2.wu i think there are at least two ways:

if you want to specify the end time in frames:

import omni.timeline

timeline = omni.timeline.get_timeline_interface()
fps = timeline.get_time_codes_per_seconds()

# specify the desired scene end frame #
duration_in_frame = 150 
# convert frames into seconds based on current fps
duration_in_sec = duration_in_frame/fps

end_time = timeline.set_end_time(end_time = duration_in_sec)

or…if you want to specify in seconds:

import omni.timeline

timeline = omni.timeline.get_timeline_interface()
fps = timeline.get_time_codes_per_seconds()

# specify the desired scene end in seconds
duration_in_sec = 4

end_time = timeline.set_end_time(end_time = duration_in_sec)

here’s the omni.timeline API should you need anything else - omni.timeline — kit-sdk 105.0.2 documentation

1 Like

Thank you very much !!
I’ll study more about timeline doc.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.