<html><head><style>body{font-family:Helvetica,Arial;font-size:14px}</style></head><body style="word-wrap:break-word;line-break:after-white-space"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:14px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><span style="font-family:"helvetica Neue",helvetica">Utkarsh,</span></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:14px;color:rgba(0,0,0,1.0);margin:0px;line-height:auto"><span style="font-family:"helvetica Neue",helvetica"><br></span></div><div id="bloop_customfont" style="font-size:14px;color:rgb(0,0,0);margin:0px"><font face="helvetica Neue, helvetica">Using the </font><span style="font-family:"helvetica Neue",helvetica"> </span><span style="font-family:"helvetica Neue",helvetica">`input_ports="2"` attribute did the trick!</span></div><div id="bloop_customfont" style="font-size:14px;color:rgb(0,0,0);margin:0px"><span style="font-family:"helvetica Neue",helvetica"><br></span></div><div id="bloop_customfont" style="margin:0px"><font face="helvetica Neue, helvetica">The changes in your merge request have me really excited! Would this make it possible to make a class like `</font>class PythonSuperquadricSource(VTKPythonAlgorithmBase)` in a .py file and load that as a plugin at runtime? If so AWESOME!<br></div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">Thank you for you help,</div><div id="bloop_customfont" style="margin:0px"><br></div><div id="bloop_customfont" style="margin:0px">Bane</div> <div id="bloop_sign_1528477445063871744" class="bloop_sign"></div> <br><p class="airmail_on">On June 8, 2018 at 6:19:53 AM, Utkarsh Ayachit (<a href="mailto:utkarsh.ayachit@kitware.com">utkarsh.ayachit@kitware.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div><div></div><div>Bane,
<br>
<br>In your XML, instead of using `post_creation` and `argument`
<br>attributes, just add a `input_ports="2"` attribute.
<br>
<br>BTW, on-going work on Python algorithm will make this much easier. In
<br>this example [1], one could simply pass in `nInputPorts=2` to require
<br>two input ports. I plan to add example with multiple input ports
<br>before this MR [2] gets merged.
<br>
<br>Utkarsh
<br>
<br>[1] <a href="https://gitlab.kitware.com/paraview/paraview/merge_requests/2501/diffs#10631fdaabfeaf00bdc465f8bb442c9aa862eae7_0_22">https://gitlab.kitware.com/paraview/paraview/merge_requests/2501/diffs#10631fdaabfeaf00bdc465f8bb442c9aa862eae7_0_22</a>
<br>[2] <a href="https://gitlab.kitware.com/paraview/paraview/merge_requests/2501">https://gitlab.kitware.com/paraview/paraview/merge_requests/2501</a>
<br>On Fri, Jun 8, 2018 at 12:20 AM Bane Sullivan <<a href="mailto:banesulli@gmail.com">banesulli@gmail.com</a>> wrote:
<br>>
<br>> Hi Gaël,
<br>>
<br>> Thank you for your help! I was aware of this way to add multiple inputs to a programmable filter and FYI if you would like to have a dialog appear in the PV GUI to select the inputs in a non-arbitrary order then try making several InputProperty attributes in the XML rather than using the multiple_input variable.
<br>>
<br>> Unfortunately, this still does not address my original issue. I need the inputs to each be on their own port rather than multiple connections on a single port. This is because I will implement the ability to select input arrays from each port via drop down menus.
<br>>
<br>> Does anyone know how to give the vtkPythonProgrammableFilter multiple input ports or a means to select input arrays to process when having multiple connections on one port? I have a robust means of selecting input arrays for just one input but I cannot get it to work for more than one input.
<br>>
<br>> Thank you,
<br>>
<br>> Bane
<br>>
<br>> On June 1, 2018 at 1:33:02 AM, Gaël Grail (<a href="mailto:gael.grail@gmail.com">gael.grail@gmail.com</a>) wrote:
<br>>
<br>> Hi Bane,
<br>>
<br>> I'm using the binary version of Paraview available in Kitware's website, so I don't know much about what should be written in the C code.
<br>> But in the xml, I'm using this and it works perfectly:
<br>>
<br>> <ServerManagerConfiguration>
<br>>   <ProxyGroup name="filters">
<br>>     <SourceProxy class="vtkPythonProgrammableFilter"
<br>>                  label="toto"
<br>>                  name="To To">
<br>>   <InputProperty clean_command="RemoveAllInputs"
<br>>                      command="AddInputConnection"
<br>>                      multiple_input="2"
<br>>                      name="Inputs">
<br>> <ProxyGroupDomain name="groups">
<br>> <Group name="sources" />
<br>> <Group name="filters" />
<br>>   </ProxyGroupDomain>
<br>>   </InputProperty>
<br>> ...
<br>>
<br>> Hope this helps,
<br>>
<br>> Gaël
<br>>
<br>> 2018-06-01 2:40 GMT+02:00 Bane Sullivan <<a href="mailto:banesulli@gmail.com">banesulli@gmail.com</a>>:
<br>>>
<br>>> Hi there,
<br>>>
<br>>> I see an old thread here: <a href="https://paraview.markmail.org/thread/z7cy73444s7fjadk">https://paraview.markmail.org/thread/z7cy73444s7fjadk</a> about setting multiple input ports for python programmable filters but I cannot get this to work.
<br>>>
<br>>> I want to declare multiple input ports in a ServerManagerConfiguration XML plugin but I have been unable to successfully add more than one input port to the vtkPythonProgrammableFilter.
<br>>>
<br>>> I see that in `paraview/ParaViewCore/ClientServerCore/Core/vtkPythonProgrammableFilter.h` the following is declared:
<br>>>
<br>>>   /**
<br>>>    * Set the number of input ports
<br>>>    * This function is explicitly exposed to enable a vtkClientServerInterpreter to call it
<br>>>    */
<br>>>   void SetNumberOfInputPorts(int numberOfInputPorts) VTK_OVERRIDE
<br>>>   {
<br>>>     this->Superclass::SetNumberOfInputPorts(numberOfInputPorts);
<br>>>   }
<br>>>
<br>>>
<br>>> This leads me to believe that the functionality is there, but how exactly would I set the number of input ports from an XML plugin for a Programmable Filter? I have tried the following with no luck:
<br>>>
<br>>> <ServerManagerConfiguration>
<br>>>  <ProxyGroup name="filters">
<br>>>    <SourceProxy
<br>>> name="TestMuliPort”
<br>>> class="vtkPythonProgrammableFilter”
<br>>> label=“TestMuliPort”
<br>>> post_creation=“SetNumberOfInputPorts"
<br>>> arguments="2”>
<br>>> ……..
<br>>>
<br>>>
<br>>> I get the following ERROR:
<br>>>
<br>>> ERROR: In /Users/kitware/dashboards/buildbot-slave/8275bd07/build/superbuild/paraview/src/ParaViewCore/ServerImplementation/Core/vtkPVSessionCore.cxx, line 371
<br>>> vtkPVSessionCore (0x60c0000d4510): Object type: vtkPythonProgrammableFilter, could not find requested method: "SetNumberOfInputPorts"
<br>>> or the method was called with incorrect arguments.
<br>>>
<br>>> while processing
<br>>> Message 0 = Invoke
<br>>>   Argument 0 = vtk_object_pointer {vtkPythonProgrammableFilter (0x60c0003abde0)}
<br>>>   Argument 1 = string_value {SetNumberOfInputPorts}
<br>>>
<br>>>
<br>>>
<br>>> Any help would be greatly appreciated,
<br>>>
<br>>> Bane
<br>>>
<br>>>
<br>>>
<br>>> _______________________________________________
<br>>> Powered by <a href="http://www.kitware.com">www.kitware.com</a>
<br>>>
<br>>> ParaView discussion is moving! Please visit <a href="https://discourse.paraview.org/">https://discourse.paraview.org/</a> for future posts.
<br>>>
<br>>> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
<br>>>
<br>>> Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a>
<br>>>
<br>>> Search the list archives at: <a href="http://markmail.org/search/?q=ParaView">http://markmail.org/search/?q=ParaView</a>
<br>>>
<br>>> Follow this link to subscribe/unsubscribe:
<br>>> <a href="https://public.kitware.com/mailman/listinfo/paraview">https://public.kitware.com/mailman/listinfo/paraview</a>
<br>>>
<br>>
<br>> _______________________________________________
<br>> Powered by <a href="http://www.kitware.com">www.kitware.com</a>
<br>>
<br>> ParaView discussion is moving! Please visit <a href="https://discourse.paraview.org/">https://discourse.paraview.org/</a> for future posts.
<br>>
<br>> Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a>
<br>>
<br>> Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a>
<br>>
<br>> Search the list archives at: <a href="http://markmail.org/search/?q=ParaView">http://markmail.org/search/?q=ParaView</a>
<br>>
<br>> Follow this link to subscribe/unsubscribe:
<br>> <a href="https://public.kitware.com/mailman/listinfo/paraview">https://public.kitware.com/mailman/listinfo/paraview</a>
<br></div></div></span></blockquote></body></html>