How to display a filter option in an animated annotation?

I would like to create an animation of scanning though a static dataset, displaying the cross section and an annotation of the current slice offset, like in the following video:

Unfortunately I can not find a way to include the slice offset (instead I am getting “(error)” in the top middle annotation).

  1. I am not sure how to access previous filter options in an annotation filter.
  2. Alternatively I tried to read out the current time via “t_value” in the PythonAnnotation filter to calculate the current slice offset from it. I was optimistic, since it works with the AnnotateTime filter. However, I am getting the following error:

Failed to evaluate expression ‘“Time: %f” % t_value’. The following exception stack should provide additional developer specific information. This typically implies a malformed expression. Verify that the expression is valid.

Variables in current scope are ['input', 'Normals'] 

Traceback (most recent call last):
  File "C:\Program Files\ParaView 5.10.1-MPI-Windows-Python3.9-msvc2017-AMD64\bin\Lib\site-packages\paraview\detail\", line 95, in execute
    result = calculator.compute(inputs, expression, ns=ns)
  File "C:\Program Files\ParaView 5.10.1-MPI-Windows-Python3.9-msvc2017-AMD64\bin\Lib\site-packages\paraview\detail\", line 146, in compute
    retVal = eval(subEx, globals(), mylocals)
  File "<string>", line 1, in <module>
NameError: name 't_value' is not defined

I am assuming this means that the Annotation filter can only access Point/Cell/Field data created by data sources, but not the time data created by the animation view?

My question is how can I either access the settings in a previous filter to display in the annotation filter or how can I access the time data created in the animation view?

The state file is attached:
static_animation_test.pvsm (889.7 KB)

There is no t_value as you are not animating with time but a property manually.

points[0][2] of the slice contains what you want though.

static_animation_test_kw.pvsm (926.3 KB)

Great! This seems to work!

Am I understanding correctly that this is the z-coordinate of the first point in the slice?

1 Like


1 Like