[Paraview] Python Programmable Filter: Get Filename of Import filter

pat marion pat.marion at kitware.com
Wed Nov 23 16:28:15 EST 2011


Hi Markus,

You can walk up the filter pipeline from the python programmable
filter like this:


filter = self

while filter.GetInput():
  filter = filter.GetInput().GetProducerPort().GetProducer()

print filter.GetClassName()



This is technique is also discouraged :)  Filters should be self
contained algorithms and that do not make assumptions about their
upstream connections.  But, if it works, it works!

Pat

On Wed, Nov 23, 2011 at 2:47 PM, Markus Fuger <m_fuger at hotmail.com> wrote:
> Hello,
>
> it seems if my question formulated in a previous thread
> (http://www.paraview.org/pipermail/paraview/2011-November/023318.html) did
> not really decribe what I needed.
>
> I do like to get the information of the
> ImportFilter.GetPropertyValue('FileNameInfo') in a Programmable Filter,
> namely the filename (and directory) of the recent file in a file series.
> (I believe that I can get to the most upper filter by a while loop. But to
> apply that scheme I would first of all need the filter object of the
> programmable filer)
>
> On the previous thread I was blamed to not follow the seperation of the
> client - server. Due to the fact, that both (at least for the moment) run on
> the same maschine, this should not be the largest problem.
>
> Thank you in advance,
> Markus
>
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.paraview.org/mailman/listinfo/paraview
>
>


More information about the ParaView mailing list