Paraview 以编程方式转到给定时间步

Paraview programmatically go to a given time step

我的数据中有一系列帧(时间步长)。 在 GUI 中,我可以在顶行的小框中输入我感兴趣的时间步长,然后点击 enter,我就在那里。

如何以编程方式显示给定的时间步长?

我找不到执行此操作的方法,因为:

  1. 使用 Start Trace,上面的操作不会产生任何结果。
  2. 对于 animationScene(例如,animationScene1 = GetAnimationScene()) 我只找到命令 animationScene1.GoToFirst(), animationScene1.GoToLast(), animationScene1.GoToPrevious(), animationScene1.GoToNext(), 但无法设置特定的框架。

尝试

animationScene.AnimationTime = time

其中 time 是您想要的时间步长。请注意,这是 "real" 时间,而不是帧数。

要获取可用时间步的列表,请使用

animationScene.TimeKeeper.TimestepValues

我无法根据其索引 istep 显示特定帧,但我可以使用其实时显示特定帧 tstep

animationScene1.AnimationTime = tstep

从一些测试来看,它似乎运行良好。

要获取时间步长列表,animationScene1.TimeKeeper.TimestepValues 在大多数情况下似乎都可以。