[Paraview] Problem: Apply Transformation Filter in pybatch

Tobias Froebel tfroebel at gmx.de
Thu Aug 14 07:09:41 EDT 2008


Hello everybody,

I'm really a paraview newbie so please excuse my simple questions.

I want to run paraview with python batch mode to perform off-screen
post-processing. That's why I include the servermanger python module in
the following python script:

#!/usr/bin/python
# -*- coding: utf-8 -*

import sys
sys.path.insert(0 ,"/usr/lib/paraview-3.3")
from paraview import servermanager

sm=servermanager
sm.Connect()

#create simple cone
cone = sm.sources.ConeSource()

#create transform filter
transF = sm.filters.TransformFilter( Input = cone)

#debug
print transF.Transform
print type(transF.Transform)

Actually the transform filter  doesn't d o anything  since  the
proxyProperty transF.Transform has no value.
I tried to set a sm.vtk.vtkTransform -object  to  the  transF.Transform
Property but unfortunately it does not work:

>>> trafo = sm.vtk.vtkTransform()
>>> transF.Transform = trafo
Traceback (innermost last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/paraview-3.3/paraview/servermanager.py", line 1503, in
setProperty
    return self.SetPropertyWithName(propName, value)
  File "/usr/lib/paraview-3.3/paraview/servermanager.py", line 163, in
SetPropertyWithName
    prop.SetData(arg)
  File "/usr/lib/paraview-3.3/paraview/servermanager.py", line 487, in
SetData
    self.SMProperty.AddProxy(value_proxy)
TypeError: function takes exactly 2 arguments (1 given)

I guess the types  of  both  objects do not match.

Maybe anybody knows how to set an appropriate transform value to the
TransformFilter's Property Transform.

Thanks a lot  for  your attention, Tobias




More information about the ParaView mailing list