[Paraview] Export python programmable filters ?
Peter Brady
petertbrady at gmail.com
Sat Jan 24 12:25:21 EST 2009
Hi Pierre,
I do most of my python processing via pvpython. At the top of my
processing script I simply have something like:
filterfile = open('prog_filter.py', 'r')
filterString = filterfile.read()
filterfile.close()
where the file: 'prog_filter.py' is my programmable filter. To use it:
deform = servermanager.filters.ProgrammableFilter(Input=someInput)
deform.Script = filterString
deform.UpdatePipeline()
It's the 'quick and dirty' way but not particularly elegant. I don't
think this approach would work from the GUI though. For that you
would need to implement David's suggestion about the customFilter.
Hope that helps,
Peter.
On Sat, Jan 24, 2009 at 5:02 AM, Pierre JUILLARD
<pierre.juillard at gmail.com> wrote:
> Hi Peter,
>
> Tank you for your help.
> What do you mean exactly with "read it into a string at the the beginning of
> the script".
> Is it related to the way you make use of python programmable filters in
> batch mode (in this case, I guess that you start ParaView with a python
> script)?
> Could you explain me what script does your comment refer to?
>
> I thank you in advance for your help.
>
> Regards,
>
> Pierre
>
>
> 2009/1/24 Peter Brady <petertbrady at gmail.com>
>>
>> My solution (not particularly eloquent) is to store the programmable
>> filter in a file and read it into a string at the the beginning of the
>> my script.
>>
>> On Fri, Jan 23, 2009 at 6:33 PM, Pierre JUILLARD
>> <pierre.juillard at gmail.com> wrote:
>> >
>> > Hi all,
>> >
>> > Can a python programmable filter be saved?
>> >
>> > As described on this wiki page, it is possible to export cutom
>> > programmable
>> > filters (last part: "Managing custom filters"):
>> > http://www.paraview.org/Wiki/Custom_Filters
>> >
>> > Is a similar mechanism available for python programmable filter?
>> > It would be very interesting:
>> > - having at hand, as soon as Paraview is started ones own usual scripts.
>> > - having the possibility to execute them in a ParaView batch job (as I
>> > understand it, once created, they are not currently saved with other
>> > ParaView settings).
>> > - easing the python programmable filter sharing between different
>> > paraview
>> > installations.
>> >
>> > Please, could you indicate me if such a feature is available?
>> > It doesn't appear so in:
>> > http://www.paraview.org/Wiki/Python_Programmable_Filter
>> >
>> > I thank you in advance for your help.
>> >
>> > Cheers,
>> >
>> > Pierre
>> >
>> > _______________________________________________
>> > ParaView mailing list
>> > ParaView at paraview.org
>> > http://www.paraview.org/mailman/listinfo/paraview
>> >
>> >
>
>
More information about the ParaView
mailing list