In a programmable filter, I’d like to be able to get the name of the source that feeds the programmable filter. But I’m having trouble figuring out how to get to the actual source through the filter. If I get the input to the programmable filter, it only has the data object that comes from the source, not the pipeline source.
I’ve tried getting both the “input” and the “inputconnection”, but both are of the data (though are subtly different), and while I’m not quite sure what the difference is, neither seems to allow me to get to the source. I thought perhaps if I used GetSources I could map the input to a source, but that fails as well.
For example, I’ve tried:
sources = paraview.simple.GetSources() reader1 = self.GetInput() source1 = sources.keys()[sources.values().index(reader1)] # the above fails with a no value match reader2 = self.GetInputConnection(0,0) source2 = sources.keys()[sources.values().index(reader2)] # likewise fails with a no value match
My goal is to get the filename of what was read in the source feeding the programmable filter.