# Change the time variables in pvpython

**URL:** https://discourse.paraview.org/t/change-the-time-variables-in-pvpython/3600
**Category:** ParaView Support
**Tags:** python
**Created:** [February 19, 2020, 12:44pm UTC](https://discourse.paraview.org/t/change-the-time-variables-in-pvpython/3600 "2020-02-19T12:44:08Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![carl.hughes.cerberus](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/85e7bf/32.png) [@carl.hughes.cerberus](https://discourse.paraview.org/u/carl.hughes.cerberus)
#### Post date: [February 19, 2020, 12:44pm UTC](https://discourse.paraview.org/t/change-the-time-variables-in-pvpython/3600/1 "2020-02-19T12:44:09Z")

</div>

Hello,

So far I have managed to use the GUI to produce an animation successfully. As I want to automated this process, I have used the tracer to generate a python script, but it doesn’t capture the time information.

The setup is quite simple, the only variable that changes is the time, i.e. ramp up to 30 seconds, step another 10s and then ramp up until the end. As the tracer doesn’t seem to be capturing this can anyone else suggest the correct python commands? I have seen a few examples of keyframes and such, but they don’t seem to help.

Thanks!

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 20, 2020, 2:53am UTC](https://discourse.paraview.org/t/change-the-time-variables-in-pvpython/3600/2 "2020-02-20T02:53:29Z")

</div>

Here is a generic example. you are looking for `view.ViewTime`.

```
from paraview.simple import *

reader = ExodusIIReader(FileName="can.ex2")
Show(reader)
Render()
view = GetActiveView()

cam = GetActiveCamera()
cam.SetPosition(10,-30,15)

for cur_time in reader.TimestepValues[:]:
  view.ViewTime = cur_time
  ResetCamera()
  Render()
```

---

<div class="post-metadata">

### Author: ![carl.hughes.cerberus](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/85e7bf/32.png) [@carl.hughes.cerberus](https://discourse.paraview.org/u/carl.hughes.cerberus)
#### Post date: [February 20, 2020, 8:30am UTC](https://discourse.paraview.org/t/change-the-time-variables-in-pvpython/3600/3 "2020-02-20T08:30:40Z")

</div>

Thank you for your reply.

This is essentially what I am after replicating. I am trying to introduce a 10 second pause into a series of time steps. I essentially have a moving source that stops at a detector. There is no need to model the detector stopped at this location, rather just pause the animation for the duration and then continue. When the animation is saved you get this pause. I just can’t figure out how to do this without the need of the GUI.

 ![image](https://discourse.paraview.org/uploads/default/original/2X/d/d219de7ec8a64d0731fdecc99055ed9c8bba694f.png)

Kind Regards,

Carl

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 20, 2020, 8:32am UTC](https://discourse.paraview.org/t/change-the-time-variables-in-pvpython/3600/4 "2020-02-20T08:32:45Z")

</div>

`time.sleep(10)` ?

---

<div class="post-metadata">

### Author: ![carl.hughes.cerberus](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/85e7bf/32.png) [@carl.hughes.cerberus](https://discourse.paraview.org/u/carl.hughes.cerberus)
#### Post date: [February 20, 2020, 9:24am UTC](https://discourse.paraview.org/t/change-the-time-variables-in-pvpython/3600/5 "2020-02-20T09:24:03Z")

</div>

Thanks for your reply, but I think I’ve figured out how to do it as you suggested but by creating my own time line and setting the viewtime equal to that. Then by saving the screenshots instead of saving an animation I can generation an animation externally. As long as it works, it can all be automated. Thanks for your help

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [February 20, 2020, 9:42am UTC](https://discourse.paraview.org/t/change-the-time-variables-in-pvpython/3600/6 "2020-02-20T09:42:56Z")

</div>

Indeed ! Do not use SaveAnimation !
