# Animate polydata using programmable filter

**URL:** https://discourse.paraview.org/t/animate-polydata-using-programmable-filter/2843
**Category:** ParaView Support
**Created:** [October 25, 2019, 8:52am UTC](https://discourse.paraview.org/t/animate-polydata-using-programmable-filter/2843 "2019-10-25T08:52:27Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Vincent\_Rivola](https://discourse.paraview.org/user_avatar/discourse.paraview.org/vincent_rivola/32/2007_2.png) [@Vincent\_Rivola](https://discourse.paraview.org/u/Vincent_Rivola)
#### Post date: [October 25, 2019, 8:52am UTC](https://discourse.paraview.org/t/animate-polydata-using-programmable-filter/2843/1 "2019-10-25T08:52:27Z")

</div>

Hi everyone,  
I have a CFD solution which contains time steps and that I can animate easily. I would like to load an STL for instance, and make it rotate based on the global time step which will change when I click the play button.

I created a programmable filter with the following script:

```
import vtk
from vtk import *

pdi = self.GetPolyDataInput()
pdo = self.GetPolyDataOutput()

center = pdi.GetCenter()
bounds=pdi.GetBounds()

executive = self.GetExecutive() 
outInfo = executive.GetOutputInformation(0)
ts= outInfo.Get(executive.UPDATE_TIME_STEP())
t=float(ts)
print 't=',t
transform=vtkTransform()
transform.PostMultiply()
transform.Translate(-center[0], -center[1],-center[2])
transform.RotateY(-5*t)
transform.Translate(center[0],center[1],center[2])

transformFilter=vtkTransformPolyDataFilter()
transformFilter.SetTransform(transform)
transformFilter.SetInputData(pdi)
transformFilter.Update()

pdo.ShallowCopy(transformFilter.GetOutput())

```

The geometry gets the expected position when I apply the filter but my problem is that the programmable filter is not updated at each time step and thus I don’t see it rotating. How should I do that if it’s possible?

---

<div class="post-metadata">

### Author: ![Vincent\_Rivola](https://discourse.paraview.org/user_avatar/discourse.paraview.org/vincent_rivola/32/2007_2.png) [@Vincent\_Rivola](https://discourse.paraview.org/u/Vincent_Rivola)
#### Post date: [October 25, 2019, 7:57pm UTC](https://discourse.paraview.org/t/animate-polydata-using-programmable-filter/2843/2 "2019-10-25T19:57:22Z")

</div>

I found a solution. I used multiple inputs and got the timestep from the from the CFD solution using vtkDataObject.DATA\_TIME\_STEP().
