[Paraview] vtkPVTrivialProducer issues
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Sat Apr 24 10:44:22 EDT 2010
What exactly is the goal with your script? Are you always going to use
sm.Connect() or do you intend to connect to a remote server as well?
Utkarsh
On Sat, Apr 24, 2010 at 12:17 AM, <wastrel at gmail.com> wrote:
> I also tried with Paraview-3.6.2.
>
> Below is the code:
>
> #! /usr/bin/pvpython
>
> from paraview.simple import *
> from paraview.simple import servermanager as sm
> from paraview import vtk
>
> # connect internally
> connection=sm.Connect()
>
>
> # Set the pvpython path
> INPUTFILE="test.vtu"
> OUTPUTFILE="tested.vtu"
>
> # create a reader
> reader=sm.sources.XMLUnstructuredGridReader(FileName=INPUTFILE)
>
> # get the data i.e moves data from the server to the client
> data = sm.Fetch(reader)
>
> ndata=vtk.vtkUnstructuredGrid();
> ndata.CopyStructure(ndata);
> ndata.GetPointData().AddArray(data.GetPointData().GetArray(0));
>
>
> f=open('trivialproducer.xml','r')
> parser=sm.vtkSMXMLParser()
> parser.Parse(f.read())
> parser.ProcessConfiguration(sm.vtkSMObject.GetProxyManager())
>
> # Update the modules
> sm.updateModules()
>
> tp=sm.sources.TrivialProducer()
> obj=tp.GetClientSideObject()
> obj.SetOutput(ndata)
>
>
> writer=sm.writers.XMLUnstructuredGridWriter(DataMode=1,FileName=OUTPUTFILE,Input=obj)
>
> writer.UpdatePipeline()
>
>
> The errors:
>
> paraview version 3.6.2, Date: 2009-05-18
> getting appended
> vtkReductionFilter : [ ...........]
> Traceback (most recent call last):
> File "convert.py", line 83, in <module>
>
> writer=sm.writers.XMLUnstructuredGridWriter(DataMode=1,FileName=OUTPUTFILE,Input=obj)
> File
> "/home/kitware/ParaView3/Utilities/BuildScripts/ParaView-3.6/ParaView3Bin/Utilities/VTKPythonWrapping/paraview/servermanager.py",
> line 186, in __init__
> File
> "/home/kitware/ParaView3/Utilities/BuildScripts/ParaView-3.6/ParaView3Bin/Utilities/VTKPythonWrapping/paraview/servermanager.py",
> line 204, in __setattr__
> File
> "/home/kitware/ParaView3/Utilities/BuildScripts/ParaView-3.6/ParaView3Bin/Utilities/VTKPythonWrapping/paraview/servermanager.py",
> line 2329, in setProperty
> File
> "/home/kitware/ParaView3/Utilities/BuildScripts/ParaView-3.6/ParaView3Bin/Utilities/VTKPythonWrapping/paraview/servermanager.py",
> line 253, in SetPropertyWithName
> File
> "/home/kitware/ParaView3/Utilities/BuildScripts/ParaView-3.6/ParaView3Bin/Utilities/VTKPythonWrapping/paraview/servermanager.py",
> line 1155, in SetData
> AttributeError: SMProxy
>
>
> Any help will be appreciated!
>
More information about the ParaView
mailing list