Scale Scalar Value in Animation

I want to animate the deformation of a mesh, containing also a scalar value for each cell.
Basically, I want to scale the deformation as well as the scalar value from 0 to 1 times the value.
As an extra difficulty, I need to scale the scalar value actually by the square of the scale factor.

The animation of the deformation is straight forward using the Warp by Vector filter and using the Scale factor in the animation pane.
However, for the scalar value I have not found a solution yet. I know I can scale it using the Calculator filter, but how can I set a scaling factor that can be used in the animation pane?
I noticed there is this “Replacement Value”, I can also use in the animation, but how does this work?

I can probably write a script that creates several files that contain “timesteps” where this scalar value is scaled. But is there no other way to animate that directly in paraview?

You can just animate it using the AnimationView.

But how? As said, the warp by vector is trivial.
But what about scaling a scalar value?
What I want is that while the deformation gets larger and larger, also the scalar value (which is used to colorize the mesh elements) gets larger and larger, i.e., the color should change accordingly.

Since you want to change the “Function” property on the Calculator filter, you are better off using the “Python” animation track.

In the Animation View,add a new Python track by choosing “Python” in the combo-box next to the + and use the following script as guide:

def start_cue(self): pass

def tick(self):
  from paraview.simple import FindSource
  t = self.GetAnimationTime()
  cal = FindSource('Calculator1') # XXX: update to match the name of your Calculator filter
  cal.Function = f'DISPL_X*{t}' # XXX: adjust function as appropriate

def end_cue(self): pass
1 Like

ahhh I see! Thank you so much, that works perfectly!