Hello Mathieu,

I realized it crashes when I add a porperty with a "°" symbol. In fact I
have a XML plugin version of the same Python programmable filter. This XML
file contains a Python variable name with a ° simbol (degrees). When I add
this property it crashes (It is available on the attached file). So the
problem was not with the code itself but with the XML file.


On the other hand, when it did not crashed, I could not find the custom
filter simply because the brand new custom filter was on the Sources list
and not on the alphabetical list of filters (sorry for that !!!)

Sometimes the creation procedure was supposed to be ok (no crashes, no
error messages), and i continue to work until a new error apeared (not
related with this issue). When i open Paraview again,  the filter was not
there . With the "Reset Session" you told me, it works fine. So, It seems
to be a good practice to quit the session without errors in order to avoid
to lost the Custom Filter. created earlier


Finally, the autoload of the Custom Filters works fine, but I realized that
the list of cpd files gets empty after a crash happens during the creation
of the custom filter. If the custom filter procedure succeeds, it works as
intended. However if it crashes, all or some of the existing Filters just
desapear.

Thanks again for your support !

PS : i respond also to the Paraview mail list (somebody may have the same
issues)

Best regards,

Miguel Angel AGUIRRE

On Mon, Apr 30, 2018 at 11:30 PM, Mathieu Westphal <
[email protected]> wrote:

> Great !
>
> I would be interested to know how you had a crash though, as it could be
> fixed anyway.
>
> Best regards,
>
> On Mon, 30 Apr 2018, 18:37 Miguel Aguirre, <[email protected]> wrote:
>
>> Hello,
>>
>> Thank you very much. I've followed those steps and worked perfectly. It
>> is not crashing anymore.
>>
>> Thanks again.
>>
>> Miguel
>>
>> On Mon, Apr 30, 2018 at 4:13 PM, Mathieu Westphal <
>> [email protected]> wrote:
>>
>>> Hello Miguel,
>>>
>>> Programmable source are supported and your example seems to work.
>>> Here is exactly how i tested it, with ParaView 5.4.0, 5.4.1 and 5.5, on
>>> linux.
>>>
>>> - Open ParaView
>>> - Load State -> ERROR_pv_5_4_0.pvsm
>>> - Select the source and the filter in the pipeline browser
>>> - Tools->Create Custom Filter
>>> - Write a SourceName
>>> - Next, Next, Finish
>>> - Edit->Reset Session
>>> - *Sources*-> SourceName
>>> - Apply
>>>
>>> no bug, all seems to be working well.
>>>
>>> Custom Filter are already automatically saved and loaded, they should be
>>> available at the next paraview execution (considering ParaView exited
>>> normally).
>>>
>>> Best,
>>>
>>> Mathieu Westphal
>>>
>>> On Fri, Apr 27, 2018 at 2:58 PM, Miguel Aguirre <[email protected]>
>>> wrote:
>>>
>>>> Hello,
>>>>
>>>> It is on Paraview 5.4.0 and it happens also on 5.5.0
>>>>
>>>> I have attached a very simple pvsm file with a programmable source
>>>> followed by a filter. When I try to create a single Custom Filter
>>>> containing this 2 operations (the source+the filter), it crashes. Sometimes
>>>> it does not crashes but the new custom filter is not available on the
>>>> filter alphabetical list. Does the Custom Filter accepts a programmable
>>>> source as input ?
>>>>
>>>> Thanks in advance
>>>>
>>>> PS : i have created several other custom filters but i have to load
>>>> them every time I open a session. is it possible to make an autoload ?
>>>> (something like the autoload of the plugins)
>>>>
>>>> Miguel
>>>>
>>>> On Fri, Apr 27, 2018 at 1:32 PM, Mathieu Westphal <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Miguel,
>>>>>
>>>>> I fail to reproduce with a single source in a custom filter.
>>>>> Could you please precise which version of ParaView you are using and
>>>>> which filter you are putting in a custom filter ?
>>>>>
>>>>> Thanks,
>>>>>
>>>>> Best regards,
>>>>>
>>>>> Mathieu Westphal
>>>>>
>>>>> On Fri, Apr 27, 2018 at 12:54 PM, Miguel Aguirre <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> I would like to know if its possible to create a custom filter
>>>>>> without an input.
>>>>>>
>>>>>> In fact, I would like to use a data source followed by some filters
>>>>>> and then to group all these actions (including the data source) in a 
>>>>>> single
>>>>>> Custom Filter. However Paraview crashes when I click on the "finish" 
>>>>>> button
>>>>>> during the set-up procedure.
>>>>>>
>>>>>> Thanks in advance !
>>>>>>
>>>>>> Miguel
>>>>>>
>>>>>> _______________________________________________
>>>>>> 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
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> *Ing.  Miguel Angel AGUIRRE*
>>>>
>>>>
>>>
>>
>>
>> --
>> *Ing.  Miguel Angel AGUIRRE*
>>
>>


-- 
*Ing.  Miguel Angel AGUIRRE*

Attachment: Epsilon_Axes.py
Description: Binary data

<!-- server manager xml for a Programmable Source that creates the aerodynamic reference axes based on a python script -->
<!-- IMPORTANT : the user must define the Python script file path down below in the line 29 -->

<ServerManagerConfiguration>
	<ProxyGroup name="sources">
		<SourceProxy 	name="EpsilonAxes" 
						class="vtkPythonProgrammableFilter"
						label="Epsilon Axes">
			<Documentation
			long_help="Creates the aerodynamic reference axes using a python script. The user can change the Python script parameters interactively by using the GUI.">
			This source will execute a python script to create the aerodynamic reference axes
			</Documentation>
	  
			<!-- Define the Paraview data set type as vtkPolyData (default value of 0 means vtkPolyData, 4=vtkUnstructuredGrid) -->
			<IntVectorProperty 
				name="OutputDataSetType" 
				command="SetOutputDataSetType" 
				number_of_elements="1"
				default_values="0"
				panel_visibility="never"> 
			</IntVectorProperty>
			
			<!-- Execute the Python script : THE FILE PATH MUST BE EDITED BY THE USER !!!	-->
			<StringVectorProperty 
				name="Script" 
				command="SetScript"
				number_of_elements="1"
				default_values="execfile('C:/Users/m.aguirre.ISAE.FR/Desktop/EPSILON/EPSILON 2D/Epsilon_Axes.py')">
				<!--
				<Hints>
					<Widget type="multi_line"/>
				</Hints>
				-->
			</StringVectorProperty>
			
			<!-- python script references a variable "UpwardAxis". We expose this as a XML property allowing the user to set it on the GUI-->
			<IntVectorProperty
					name="Mesh Upward Axis"
					command="SetParameter"
					initial_string="UpwardAxis"
					number_of_elements="1"
					default_values="0">
				<EnumerationDomain name="enum">
					<Entry value="0" text="Y-axis"/>
					<Entry value="1" text="Z-axis"/>
				</EnumerationDomain>
			</IntVectorProperty>			

			<!-- python script references a variable "Alfa". We expose this as a XML property allowing the user to set it on the GUI-->
			<StringVectorProperty
				name="Angle Of Attack [財"
				command="SetParameter"
				initial_string="Alfa"
				number_of_elements="1"
				default_values="0.0">
			</StringVectorProperty>
			
			<!-- python script references a variable "Size". We expose this as a XML property allowing the user to set it on the GUI-->
			<StringVectorProperty
				name="Vector size [m]"
				command="SetParameter"
				initial_string="Size"
				number_of_elements="1"
				default_values="1.0">
			</StringVectorProperty>
			 			 
			<!-- python script references a variable "X0". We expose this as a XML property allowing the user to set it on the GUI--> 
			<StringVectorProperty
				name="x0 [m]"
				command="SetParameter"
				initial_string="X0"
				number_of_elements="1"
				default_values="0.0">
			</StringVectorProperty>
			 
			<!-- python script references a variable "Y0". We expose this as a XML property allowing the user to set it on the GUI--> 
			<StringVectorProperty
				name="y0 [m]"
				command="SetParameter"
				initial_string="Y0"
				number_of_elements="1"
				default_values="0.0">
			</StringVectorProperty>
			 
			<!-- python script references a variable "Z0". We expose this as a XML property allowing the user to set it on the GUI--> 
			<StringVectorProperty
				name="z0 [m]"
				command="SetParameter"
				initial_string="Z0"
				number_of_elements="1"
				default_values="0.0">
			</StringVectorProperty>
	
			<!-- In this final part we organize the inputs in several groups within the GUI Properties panel -->
			<PropertyGroup label="Aerodynamic Reference Frame Parameters">
				<Property name="Mesh Upward Axis" />
				<Property name="Angle Of Attack [Deg]" />
				<Property name="Vector size [m]" />
				<Property name="x0 [m]" />
				<Property name="y0 [m]" />
				<Property name="z0 [m]" />
			</PropertyGroup>
		 
		</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

Reply via email to