[Paraview] Custom Python plugin with multiple input ports
Utkarsh Ayachit
utkarsh.ayachit at kitware.com
Fri Jul 15 11:36:19 EDT 2016
Sorry for chiming in late, but here are some things to note:
* Both Dennis and Cory are talking about multiple connections on the
same input port. This is arguably not too well supported since the
order cannot be determined easily.
* Seems to me you want multiple input ports, each with a single
connection. That's supported. Just not by the Python Filter Generator
Script. Once you have the XML for the filter, you can indeed just add
another <InputProperty /> tag to it as follows (note the "port_index"
attribute):
<InputProperty command="SetInputConnection"
name="Input2"
port_index="2">
<!-- fill with relevant domain information -->
</InputProperty>
Then, your python filter code can access data on each input port as:
input1 = self.GetInputDataObject(0, 0)
input2 = self.GetInputDataObject(1, 0)
Here there's no confusion which data is on which input port.
Hope that helps,
Utkarsh
On Fri, Jul 15, 2016 at 7:44 AM, Dennis Conklin
<dennis_conklin at goodyear.com> wrote:
> LB,
>
>
>
> Yes, it is troublesome to not be able to tell which input is which inside
> the Programmable filter. Something I have done in the past is
> differentiate them inside the filter. I have tested for element type to
> tell them apart, for example. Something else I have heard of but have not
> had to use is assigning a unique variable to one input and then testing for
> that inside the filter to determine which input is which.
>
>
>
> None of this may address your general problem, but here’s hoping.
>
>
>
> Dennis
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>
More information about the ParaView
mailing list