[Paraview] XML PLUGIN RELATIVE PATH

Mathieu Westphal mathieu.westphal at kitware.com
Wed May 2 09:31:33 EDT 2018


Hi Miguel

When using the Python Programmble Filter, the current directory is the one
you have run ParaView from.
You can use relative directory to this one, if that helps you, but I would
not recommend it.

There is currently no way to have a relative path to the xml plugin
directory in the default values of a xml property.

I would simply recommend to put the content of "MY_PLUGIN.py" in the xml of
your plugin.

Best,

Mathieu Westphal

On Mon, Apr 30, 2018 at 10:16 AM, Miguel Aguirre <aguirre.utn at gmail.com>
wrote:

> Hi all,
>
> I am working with Plugins for programmable filters that executes external
> Python scripts. So far, so good.
>
> However, I want to avoid to write the entire path of the Python file on
> the XML file, as you can see highlighted in bold on the XML code down
> below.
>
> Both, the XML and the Python file are in the same folder. Moreover, the
> XML file and the Python file have the same name. So, I wonder if there is a
> way to set up a relative path...do you have any ideas to solve that ?
>
> Thanks in advance !
>
> Miguel Angel AGUIRRE
>
>
>
> <ServerManagerConfiguration>
> <ProxyGroup name="sources">
> <SourceProxy name="MY_PLUGIN"
> class="vtkPythonProgrammableFilter"
> label=" MY_PLUGIN">
>
> <!-- Define the Paraview data set type as vtkPolyData (default value of 0
> means vtkPolyData) -->
> <IntVectorProperty
> name="OutputDataSetType"
> command="SetOutputDataSetType"
> number_of_elements="1"
> default_values="0"
> panel_visibility="never">
> </IntVectorProperty>
>
> <StringVectorProperty
> name="Script"
> command="SetScript"
> number_of_elements="1"
> default_values="*execfile('C:/Users/m.aguirre./.../.../.../ MY_PLUGIN
> .py')*">
> <!--
> <Hints>
> <Widget type="multi_line"/>
> </Hints>
> -->
> </StringVectorProperty>
>
> </SourceProxy>
> </ProxyGroup>
> </ServerManagerConfiguration>
>
>
> _______________________________________________
> 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:
> https://public.kitware.com/mailman/listinfo/paraview
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/paraview/attachments/20180502/662236cc/attachment.html>


More information about the ParaView mailing list