[Paraview] Python question

Cory Quammen cory.quammen at kitware.com
Sun May 29 10:47:05 EDT 2016


Hi Andrzej,

The problem is in this section:

<StringVectorProperty
    name="Pressure"
    command="SetParameter"
    initial_string="Pressure"
    number_of_elements="5"
    element_types="0 0 0 0 2"
    animateable="1"
    default_values="0 0 0 0 0">

        <ArrayListDomain name="array_list"
                         attribute_type="Scalars"
                         input_domain_name="inputs_array">
          <RequiredProperties>
            <Property name="Input"
                      function="Input" />
          </RequiredProperties>
                  </ArrayListDomain>

<Documentation></Documentation></StringVectorProperty>

The "SetParameter" member function exists in the
vtkPythonProgrammableFilter, but with this declaration, you are saying
the member function takes 5 arguments. The crash occurs with an error
message saying

ERROR: In /Users/cory.quammen/src/paraview/ParaViewCore/ServerImplementation/Core/vtkPVSessionCore.cxx,
line 390
vtkPVSessionCore (0x7fd583c415d0): Object type:
vtkPythonProgrammableFilter, could not find requested method:
"SetParameter"
or the method was called with incorrect arguments.
while processing

Message 0 = Invoke
  Argument 0 = vtk_object_pointer {vtkPythonProgrammableFilter (0x7fd58b623310)}
  Argument 1 = string_value {SetParameter}
  Argument 2 = string_value {Pressure}
  Argument 3 = int32_value {0}
  Argument 4 = int32_value {0}
  Argument 5 = int32_value {0}
  Argument 6 = int32_value {0}
  Argument 7 = string_value {}

Try this XML to replace the problematic XML

The problem is in this section:

<StringVectorProperty
    name="Pressure"
    command="SetParameter"
    initial_string="Pressure"
    number_of_elements="1"
    animateable="1"
    default_values="0">

        <ArrayListDomain name="array_list"
                         attribute_type="Scalars"
                         input_domain_name="inputs_array">
          <RequiredProperties>
            <Property name="Input"
                      function="Input" />
          </RequiredProperties>
                  </ArrayListDomain>

<Documentation>
</Documentation>
</StringVectorProperty>

This works in local tests for me.

HTH,
Cory

On Fri, May 27, 2016 at 6:50 PM, Andrzej Peczak <apeczak at ara.co.uk> wrote:
> One of my colleagues asked me to forward the question he has regarding use of a python script.
>
> Andrzej
>
> From: Andrea Ciarella
> Sent: 25 May 2016 16:10
> To: Andrzej Peczak
> Subject: Support request
>
> Hi,
>
> I create filter in Paraview using the python_filter_generator.py to create an xml file from a python script.
> It works fine but I would like to have the ability to select the required variable from a drop list.
> If I do it the modified xml causes Paraview to crash or the variable(Pressure) is not send to the python script. Do you know what I am getting wrong.
> Please find attached the xml filter I am using
>
> Thank you
> Kind regards
> Andrea Ciarella
> Project Scientist
> Aerodynamics Capability
> Aircraft Research Association Ltd
>
> Tel: +44 (0) 1234 324632
> Email: aciarella at ara.co.uk
>
>
> **********************************************************************
> Please consider the environment. Only print this email if absolutely necessary.
>
> This email contains information that is private and confidential and is intended only for the addressee.
> If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.
> Note: All email sent to or from this address may be accessed by someone other than the recipient, for
> system management and security reasons.
> Aircraft Research Association Ltd.  Registered in England, Registration No 503668 Registered Office:
> Manton Lane, Bedford MK41 7PF England VAT No GB 196351245
>
> **********************************************************************
>
> _______________________________________________
> 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:
> http://public.kitware.com/mailman/listinfo/paraview
>



-- 
Cory Quammen
R&D Engineer
Kitware, Inc.


More information about the ParaView mailing list