# Problem with updating the Animationscene

**URL:** https://discourse.paraview.org/t/problem-with-updating-the-animationscene/13830
**Category:** Development
**Tags:** python
**Created:** [January 30, 2024, 5:32pm UTC](https://discourse.paraview.org/t/problem-with-updating-the-animationscene/13830 "2024-01-30T17:32:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ibrahim\_Bandi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ibrahim_bandi/32/13512_2.png) [@Ibrahim\_Bandi](https://discourse.paraview.org/u/Ibrahim_Bandi)
#### Post date: [January 30, 2024, 5:32pm UTC](https://discourse.paraview.org/t/problem-with-updating-the-animationscene/13830/1 "2024-01-30T17:32:34Z")

</div>

Hello everyone, I am facing a problem with updating my animation scene. I am trying iterate over a number of frames and exporting csv file files but I am just getting csv files with same values, which means the spreadsheet doesnt update. I would be really thankful if someone can help because I am in trouble. Here is the part of my code where the problem is :

```python
    particle_tracer.ForceReinjectionEveryNSteps = 0
    input_directory= path_for_video
    frames=from_sec_to_timesteps(pvd_path, sim_time)
    animation_scene = GetAnimationScene()
    animation_scene.NumberOfFrames = frames
    spreadSheetView1 = CreateView('SpreadSheetView')
    i = 0

    for frame in range(frames):
        
        temporalParticlesToPathlines1 = TemporalParticlesToPathlines(
            registrationName='TemporalParticlesToPathlines1',
            Input=calculator1, Selection=None)
        temporalParticlesToPathlines1.MaskPoints = 1
        temporalParticlesToPathlines1.MaxTrackLength = 10000
        temporalParticlesToPathlines1.MaxStepDistance = [1000.0, 1000.0, 1000.0]

        Show(temporalParticlesToPathlines1, spreadSheetView1, 'SpreadSheetRepresentation')
        spreadSheetView1.HiddenColumnLabels = ['Point ID', 'AngularVelocity', 'ErrorCode', 'InjectedPointId',
                                               'InjectionStepId', 'NormShearRate [1/s]',
                                               'ParticleAge', 'ParticleSourceId', 'Points', 'Points_Magnitude',
                                               'Pressure [bar]', 'Rotation', 'Screw', 'Shell', 'Temperature [C]',
                                               'TrackLength', 'TrailId', 'Velocity [m/s]',
                                               'Velocity [m/s]_Magnitude',
                                               'Viscosity [Pa s]',
                                               'Vorticity', 'vel', 'vel_Magnitude', 'Block Number']

        input_file_path = os.path.join(input_directory, f'Timestep_{i}.csv')
        ExportView(input_file_path, view=spreadSheetView1, RealNumberNotation='Fixed')

        animation_scene.GoToNext()
        animation_scene.UpdateAnimationUsingDataTimeSteps()
        i += 1

```

---

<div class="post-metadata">

### Author: ![nicolas.vuaille](https://discourse.paraview.org/user_avatar/discourse.paraview.org/nicolas.vuaille/32/5873_2.png) [@nicolas.vuaille](https://discourse.paraview.org/u/nicolas.vuaille)
#### Post date: [January 31, 2024, 9:54am UTC](https://discourse.paraview.org/t/problem-with-updating-the-animationscene/13830/2 "2024-01-31T09:54:44Z")

</div>

I think you should use the `CSV` extractor instead, and then call `Save Extracts` in your script, instead of using animation scene, spreadsheet and a loop.

### Rationale

Extractor are writers that will be called at each timesteps when you call `Save Extracts`.

ParaView pipeline should mainly not be created in a temporal loop. It is intended to be created once, then executed for each timestep.

Spreadsheet is a view, not a data type. So it is not required to save csv files.

You may choose the arrays to write with `Pass Arrays` filter before the extractor.
