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?