Attached is an example script. "Transform" property on the TransformFilter is a proxy property that takes either the (transforms, Transform) or (transforms, Transform2) proxy. These proxies have properties to affect the transform as illustrated in the attached script.
Utkarsh On Wed, Jan 14, 2009 at 2:27 AM, Jérôme <jerome.ve...@gmail.com> wrote: > Hi, > > Just an idea: It seems that the error message warns about typo... Are > you sure it is "translation" and not "Translation" ? > > regards, > > Jerome > > 2009/1/13 Jorge Mario Mazo <jmm.mecan...@gmail.com>: >> I'm trying to use the TransformFilter >> >> but I do not know how to set the paramater for the filter >> >> help(servermanager.filters.TransformFilter) >> >> did not say much >> >> just >> ################################ >> SetPropertyWithName(self, pname, arg) >> | Generic method for setting the value of a property. >> ############################################# >> >> fig.ListProperties() >> ['Input', 'Transform'] >> >> fig.GetProperty('Transform') >> Property name= Transform value = None >> >> >> I tried >> fig.SetPropertyWithName('translation', [1,0,0]) >> >>>>> fig.SetPropertyWithName('translation',[1,0,0]) >> Traceback (most recent call last): >> File "<console>", line 1, in <module> >> File >> "/Users/jmazo/ParaView-3.4.0/Build/Utilities/VTKPythonWrapping/paraview/servermanager.py", >> line 162, in SetPropertyWithName >> raise exceptions.RuntimeError, "Property %s does not exist. Please >> check the property name for typos." % pname >> RuntimeError: Property translation does not exist. Please check the >> property name for typos. >> >> >> >> same happened for rotation, scaling >> >> So i'm totally lost >> >> >> thanks in advance! >> _______________________________________________ >> ParaView mailing list >> ParaView@paraview.org >> http://www.paraview.org/mailman/listinfo/paraview >> > _______________________________________________ > ParaView mailing list > ParaView@paraview.org > http://www.paraview.org/mailman/listinfo/paraview >
from paraview import servermanager servermanager.Connect() sphere = servermanager.sources.SphereSource() view = servermanager.CreateRenderView() tf = servermanager.filters.TransformFilter(Input = sphere) # This is needed since the "Transform" and "Transform2" proxies are under the # "transforms" group and it hasn't been exposed in the python module yet. transforms = servermanager.createModule("transforms") # You can either use Transform2 if you want to set Scale/Position/Rotation or # use Transform if you want to set the transformation matrix. transform = transforms.Transform2() transform.Scale = [2, 1, 1] tf.Transform = transform repr = servermanager.CreateRepresentation(tf, view) view.ResetCamera() view.StillRender() raw_input ("Enter: ")
_______________________________________________ ParaView mailing list ParaView@paraview.org http://www.paraview.org/mailman/listinfo/paraview