Hi all,
I get the following error when loading a python animation script from the state file.
After that, the animation works fine, without errors. Do you have any suggestions?
This is the error:
start cue
Traceback (most recent call last):
File "<string>", line 30, in <module>
File "<string>", line 13, in tick
File "/home/danlipsa/projects/ParaView/build/lib/python3.6/site-packages/paraview/servermanager.py", line 523, in __getattr__
return getattr(self.SMProxy, name)
AttributeError: 'paraview.modules.vtkRemotingAnimation.vtkSMAnimati' object has no attribute 'frameIndex'
end cue
Thanks Utkarsh,
That moved things along, but I am still getting an error because ParaView tries to execute the animation before the view is created. Here is the new error
None
start cue
Traceback (most recent call last):
File "<string>", line 34, in <module>
File "<string>", line 20, in tick
File "/home/danlipsa/projects/ParaView/build/lib/python3.6/site-packages/paraview/simple.py", line 498, in GetDisplayProperties
return GetRepresentation(proxy, view)
File "/home/danlipsa/projects/ParaView/build/lib/python3.6/site-packages/paraview/simple.py", line 483, in GetRepresentation
raise ValueError ("view argument cannot be None.")
ValueError: view argument cannot be None.
0
end cue
And the new script:
from paraview.simple import *
def start_cue(self):
global a
global s
global v
a = GetAnimationScene()
s = FindSource("allFrames.vtp")
v = GetActiveView()
print(v)
SetActiveSource(s)
a.add_attribute("frameIndex", 0)
print("start cue")
def tick(self):
global a
global s
print(a.frameIndex)
dp = GetDisplayProperties(s, v)
if a.frameIndex < 3:
frameArray = s.PointData.keys()[a.frameIndex]
print(frameArray)
ColorBy(dp, ('POINTS', frameArray, 'Magnitude'))
else:
ColorBy(dp, None)
dp.DiffuseColor = [0.7, 0.7, 0.7]
a.frameIndex = a.frameIndex + 1
def end_cue(self):
print("end cue")
sorry, no clue of the top of my head. I’d put guards in the tick to confirm view is present to get around this. I suspect when loading state “tick” may get called before everything is setup.