<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><span style="font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13.333333015441895px; background-color: rgb(247, 247, 247);" class="">Dear all,</span></div><span style="font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13.333333015441895px; background-color: rgb(247, 247, 247);" class=""><div class=""><span style="font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13.333333015441895px; background-color: rgb(247, 247, 247);" class=""><br class=""></span></div>I am relatively new to scripting in paraview using vtk wrappers. However one situation I always find myself in is writing a python script to be executed with pvpython and then having to include a miniature python script as an input to programmableFilters. As far as I understand, this allows the manipulation of pipeline data on the server side (so you don't have to retrieve data to the client) inside a tailored script. What I don't understand is why the process has to be so convoluted. At the very least it makes debugging very annoying as you don't know exactly where in the script that you input into the programmable filter a potential error might be. I have an example to illustrate.</span><br style="font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13.333333015441895px;" class=""><br style="font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13.333333015441895px;" class=""><span style="font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13.333333015441895px; background-color: rgb(247, 247, 247);" class="">Below are two pieces of code within an if/else switch where I add some temperature data to a vtkSphereSource. The first uses the programmableFilter approach and the second attempts to do the manipulation on the client side and then "upload/update" the server side. However the second approach does not result in any temperature data when I view it in paraview. What am I missing?</span><br style="font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13.333333015441895px;" class=""><br style="font-family: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 13.333333015441895px;" class=""><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">from paraview.simple import *</div><div class="">paraview.simple._DisableFirstRenderCameraReset()</div><div class="">import math</div><div class="">import vtk</div><div class=""><br class=""></div><div class="">use_prog_filt = False</div><div class=""><br class=""></div><div class=""># What I dont want to be doing:</div><div class="">if use_prog_filt:</div><div class="">    sphereSourceProxy = Sphere()</div><div class="">    renderView1 = GetActiveViewOrCreate('RenderView')</div><div class="">    sphereDisplay = Show(sphereSourceProxy, renderView1)</div><div class="">    sphereDisplay.ColorArrayName = [None, '']</div><div class="">    renderView1.ResetCamera()</div><div class=""><br class=""></div><div class="">    my_script= [</div><div class="">        'pdi = self.GetPolyDataInput()',</div><div class="">        'pdo = self.GetPolyDataOutput()',</div><div class="">        '',</div><div class="">        'temperature= vtk.vtkDoubleArray()',</div><div class="">        'npoints = pdi.GetNumberOfPoints() ',</div><div class="">        'for i in range(npoints):',</div><div class="">        '   x, y, z = pdi.GetPoint(i)',</div><div class="">        '   temperature.InsertNextValue(x)',</div><div class="">        'temperature.SetName("Temperature")',</div><div class="">        'pdo.GetPointData().AddArray(temperature)']</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">    programmableFilter = ProgrammableFilter(Input=sphereSourceProxy)</div><div class="">    programmableFilter.Script = str("\n".join(my_script))</div><div class="">    programmableFilter.RequestInformationScript = ''</div><div class="">    programmableFilter.RequestUpdateExtentScript = ''</div><div class="">    programmableFilter.PythonPath = ''</div><div class=""><br class=""></div><div class="">    programmableFilterDisplay = Show(programmableFilter, renderView1)</div><div class=""><br class=""></div><div class=""># What I want to be doing:</div><div class="">else:</div><div class="">    #sphereSource = vtk.vtkSphereSource()</div><div class="">    #print dir(sphereSource)</div><div class=""><br class=""></div><div class="">    sphereSourceProxy = Sphere()</div><div class="">    renderView1 = GetActiveViewOrCreate('RenderView')</div><div class="">    sphereDisplay = Show(sphereSourceProxy, renderView1)</div><div class="">    sphereDisplay.ColorArrayName = [None, '']</div><div class="">    renderView1.ResetCamera()</div><div class=""><br class=""></div><div class="">    pdi = servermanager.Fetch(input=sphereSourceProxy)</div><div class="">    npoints = pdi.GetNumberOfPoints() </div><div class=""><br class=""></div><div class="">    temperature = vtk.vtkDoubleArray()</div><div class="">    temperature.SetName("Temperature")</div><div class="">    for i in range(npoints):</div><div class="">        x, y, z = pdi.GetPoint(i)</div><div class="">        temperature.InsertNextValue(x)</div><div class="">    pdi.GetPointData().AddArray(temperature)</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">    new_SphereSource = TrivialProducer()</div><div class="">    filt = new_SphereSource.GetClientSideObject()  # filter is a vtkTrivialProducer</div><div class="">    filt.SetOutput(pdi)</div><div class="">    new_SphereSource.UpdatePipeline()</div><div class=""><br class=""></div><div class="">    # The temperature data is available, but not in the paraview renderview...  </div><div class="">    print servermanager.Fetch(input=new_SphereSource)</div></div></body></html>