I simplified the code and tried it on Paraview3.8.0. It reads in a vtu file, fetch the data and then write it back to a new file. But still got errors as follow.<br><br>Script:<br><br clear="all">from paraview.simple import *<br>
from paraview.simple import servermanager as sm<br>from paraview import vtk<br><br># connect internally<br>connection=sm.Connect()<br><br># Set the pvpython path<br>INPUTFILE="test.vtu"<br>OUTPUTFILE="tested.vtu"<br>
<br># create a reader<br>reader=sm.sources.XMLUnstructuredGridReader(FileName=INPUTFILE)<br><br># get the data i.e moves data from the server to the client<br>data=sm.Fetch(reader)<br><br>tp=sm.sources.TrivialProducer()<br>
obj=tp.GetClientSideObject()<br>obj.SetOutput(data)<br><br>writer=sm.writers.XMLUnstructuredGridWriter(DataMode=2,FileName=OUTPUTFILE,Input=obj)<br><br>writer.UpdatePipeline()<br><br>
<br>Errors:<br><br>getting appended<br>vtkReductionFilter : [ ...........]<br>Traceback (most recent call last):<br> File "convert.py", line 88, in <module><br> writer=sm.writers.XMLUnstructuredGridWriter(DataMode=2,FileName=OUTPUTFILE,Input=obj)<br>
File "/home/kitware/ParaView-3-8/ParaView-3.8/ParaView3Bin/Utilities/VTKPythonWrapping/paraview/servermanager.py", line 186, in __init__<br> File "/home/kitware/ParaView-3-8/ParaView-3.8/ParaView3Bin/Utilities/VTKPythonWrapping/paraview/servermanager.py", line 204, in __setattr__<br>
File "/home/kitware/ParaView-3-8/ParaView-3.8/ParaView3Bin/Utilities/VTKPythonWrapping/paraview/servermanager.py", line 2361, in setProperty<br> File "/home/kitware/ParaView-3-8/ParaView-3.8/ParaView3Bin/Utilities/VTKPythonWrapping/paraview/servermanager.py", line 253, in SetPropertyWithName<br>
File "/home/kitware/ParaView-3-8/ParaView-3.8/ParaView3Bin/Utilities/VTKPythonWrapping/paraview/servermanager.py", line 1162, in SetData<br>AttributeError: SMProxy<br><br><br><br>Any clues?<br><br><br><div class="gmail_quote">
On Sat, Apr 24, 2010 at 9:41 AM, Utkarsh Ayachit <span dir="ltr"><<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Here are my results from 3.7 (consequently 3.8 or git master should<br>
work as well).<br>
<br>
>>> from paraview.simple import *<br>
paraview version 3.7.0, Date: 2010-03-27<br>
>>> TrivialProducer()<br>
<paraview.servermanager.TrivialProducer object at 0x121587e90><br>
>>> servermanager.sources.TrivialProducer()<br>
<paraview.servermanager.TrivialProducer object at 0x121587d50><br>
<font color="#888888"><br>
Utkarsh<br>
</font><div class="im"><br>
On Fri, Apr 23, 2010 at 5:44 PM, Utkarsh Ayachit<br>
<<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>> wrote:<br>
</div><div><div></div><div class="h5">> You no longer need the initial part for loading the XML. You can directly use:<br>
><br>
> tp = sm.sources.TrivialProducer()<br>
><br>
> and that should work.<br>
><br>
> Utkarsh<br>
><br>
> On Fri, Apr 23, 2010 at 5:09 PM, <<a href="mailto:wastrel@gmail.com">wastrel@gmail.com</a>> wrote:<br>
>> I used the the following snippet to generate data on the client side but<br>
>> ended up with errors:<br>
>><br>
>> Code:<br>
>> sm = servermanager<br>
>> f = open('trivialproducer.xml', 'r')<br>
>> parser = sm.vtkSMXMLParser()<br>
>> parser.Parse(f.read())<br>
>> parser.ProcessConfiguration(sm.vtkSMObject.GetProxyManager())<br>
>> # Update the modules<br>
>> sm._updateModules()<br>
>><br>
>> tp = sm.sources.TrivialProducer()<br>
>> obj = tp.GetClientSideObject()<br>
>> obj.SetOutput(pd)<br>
>><br>
>> # use tp as any other source proxy<br>
>><br>
>><br>
>> trivialproducer.xml:<br>
>><br>
>> <ServerManagerConfiguration><br>
>> <ProxyGroup name="sources"><br>
>><br>
>> <SourceProxy name="TrivialProducer"<br>
>> class="vtkPVTrivialProducer"><br>
>> </SourceProxy><br>
>> </ProxyGroup><br>
>><br>
>><br>
>> Errors:<br>
>> ERROR: In<br>
>> /home/berk/Work/ReleaseBuilds/ParaView3/Servers/Common/vtkProcessModule.cxx,<br>
>> line 1001<br>
>> vtkProcessModule (0x807b790): Cannot create object of type<br>
>> "vtkPVTrivialProducer".<br>
>> while processing<br>
>> Message 0 = New<br>
>> Argument 0 = string_value {vtkPVTrivialProducer}<br>
>> Argument 1 = id_value {40}<br>
>><br>
>><br>
>> ERROR: In<br>
>> /home/berk/Work/ReleaseBuilds/ParaView3/Servers/Common/vtkProcessModule.cxx,<br>
>> line 1002<br>
>> vtkProcessModule (0x807b790): Aborting execution for debugging purposes.<br>
>><br>
>> Abort<br>
>><br>
>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the ParaView Wiki at:<br>
>> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
>><br>
>><br>
><br>
</div></div></blockquote></div><br>