The timeline set_auto_update(False) no longer works

As the title says I’m not able to get the set_auto_update() to work again.

I tried

kit = SimulationApp()
timeline = omni.get_timeline_interface()

timeline.stop()
timeline.set_auto_update(False)
timeline.set_end_time(100)
kit.update()
kit.update()
timeline.play()
kit.update() # -> time here is 0.041 (1/24)

and

kit = SimulationApp()
timeline = omni.get_timeline_interface()

timeline.stop()
timeline.set_end_time(100)
kit.update()
kit.update()
timeline.play()
timeline.set_auto_update(False)
kit.update() # -> time here is 0.041 (1/24)

without success.

What happened? this is fundamental since you don’t allow complete rendering with a single call! (i.e. i need to call render 64 times for path tracing and spp 1 totSpp 64)

Hi @marc2002 - Can you try the following code and let us know if you are still having issues.

import omni.timeline.timeline as timeline

# Get the timeline manager
timeline_manager = timeline.get_timeline_manager()

# Disable auto-updates
timeline_manager.set_auto_update(False)

Hi @rthaker
Do I need to do something specific to get those functions? because when I try the import I get an error (omni.timeline has no attriute named timeline) and omni.timeline hs no get_timeline_manager. I searched the other source codes and did not find a reference to that function either.

Hi @marc2002 - I looked at your code/question again.

The set_auto_update() function in the Omniverse Isaac Sim controls whether the timeline should automatically advance when play() is called. If set_auto_update(False) is called, the timeline will not advance automatically, and you will need to manually advance it by calling step_frame() .

In your code, you’re calling play() after set_auto_update(False) , which means the timeline will not advance automatically. Then you’re calling update() on the SimulationApp object, but this does not advance the timeline. That’s why the time remains at 0.041 .

If you want to manually advance the timeline, you should call step_frame() on the timeline object. Here’s how you can do it:

kit = SimulationApp()
timeline = omni.timeline.get_timeline_interface()

timeline.stop()
timeline.set_auto_update(False)
timeline.set_end_time(100)

# Advance the timeline by one frame
timeline.step_frame()

# Now the time should be advanced by one frame
print(timeline.get_current_time())

Remember that step_frame() only advances the timeline by one frame. If you want to advance it by multiple frames, you will need to call step_frame() multiple times.

Hi @rthaker. Yes, that’s the expected behaviour and what I was expecting to happen when I updated my code.

However, when I call update() what happens is that the timeline gets updated anyway and brought forward.

My previous process was similar to what you described

set_sim_time(False)
do stuff
render
do stuff
physics
do stuff
forward/backward_one_frame()

However, now if I do like this the timeline gets updated and advanced every simulation step. Which is wrong.
I’m on my phone and my working PC is occupied by some training so I can’t send you an explanation video and triple check this now, but can you please check this?
I ended up having to keep trace of how many simulations loop I’m doing and manually set the time with set_current_time().

Also, do you have any news for the rendering? When doing multiple renders like that e.g. for path tracing with my code I’m losing cool features like motion vectors (which I found a cool way to get them anyway from the GRADE project) and motion blur. Any plan to get a render call that automatically completely renders the full scene?

Hi @marc2002 - It would be great if you can clarify what exactly you are trying to achieve here. Whether you like the step time or not.

Also, can you let us know who do you query the time? if you do it inside an update callback, it would return the end time of the frame.

Also, regarding the rendering, how are you capturing the sequence in Path Tracing. Are you using the Movie Capture extension?

Hi @rthaker

In v2021.2.1 what happened was the following

sc = SimulationContext(whatever)
timeline = omni.get_timeline_interface()
sc.play()
timeline.set_auto_update(False)

whatever was done from this point onward, the timeline wouldn’t move if not with

timeline.set_current_time/[forward/backward]_one_frame()

or similar.

This means that kit.update(), sc.step(), sc.step(render=False), sc.render(), etc would not move the timeline and therefore the animations. Which is the desired behavior, i.e. the timeline does not auto update.

In the latest version what is happening is what I described above.

kit = SimulationApp()
timeline = omni.timeline.get_timeline_interface()
simulation_context.play()
timeline.set_auto_update(False)
simulation_context.step() # this advances the timeline!
kit.update() # this advances the timeline!
simulation_context.step(render=False) # this does not advance the timeline

i.e. anything involvign rendering does advance and auto update the timeline.

Log Example:

ipdb> timeline.is_playing()
False
ipdb> timeline.is_auto_updating()
True
ipdb> simulation_context.is_playing()
False
ipdb> timeline.get_current_time()
0.0
ipdb> simulation_context.step()
ipdb> simulation_context.step()
ipdb> simulation_context.step()
ipdb> simulation_context.step()
ipdb> timeline.get_current_time()
0.0
ipdb> simulation_context.play()
ipdb> timeline.set_auto_update(False)
ipdb> timeline.is_playing()
True
ipdb> timeline.is_auto_updating()
False
ipdb> simulation_context.is_playing()
True
ipdb> simulation_context.step()
ipdb> simulation_context.step()
ipdb> timeline.get_current_time()
0.06666666666666667
ipdb> simulation_context.step()
ipdb> timeline.get_current_time()
0.1
ipdb> kit.update()
ipdb> timeline.get_current_time()
0.13333333333333333
ipdb> simulation_context.step(render=False)
ipdb> timeline.get_current_time()
0.13333333333333333

Clearly, I can stop the timeline. But that will stop the simulation context, stopping the physics.

Let’s hope I was clearer.


As for the renderer: I capture the sequences either in RTX or Path Tracing. I use a custom loop that renders the scene using the simulation context since I need to control the simulation to move the robot around, and make changes. So I have my python script that runs a loop and a rendering call.