3

I have programmed some filters for python, that I always have to modify according to my problem - for example: I have a version, that reads in all the data and focuses on x directon, one for y direction .. and so on. What I would wish for, would be a simple popup window, that can read in 1-2 variables. Has anyone ever seen or done something like that?

xtlc
  • 1,070
  • 1
  • 15
  • 41

2 Answers2

4

The builtin raw_input python function may be what you need.

value = raw_input('enter your parameter')

In the paraview python environment, it prints the message in the terminal and opens a pop-up for a user input.

UPDATE : on recent versions of paraview using python3, it is now :

value = input('enter your parameter')
Johann Bzh
  • 834
  • 3
  • 10
  • 25
Bertrand Gazanion
  • 705
  • 1
  • 14
  • 19
  • I already have this in use, but multiple times. Which is kind of not so nice. Is there something a little more advanced? – xtlc Sep 22 '15 at 12:59
  • 2
    Just as a remark/update to this question, with python3, `raw_input` is now just `input`. So, in every newer paraview release just use ìnput` as proposed here – David Feb 16 '21 at 08:00
2

You might be interested in using a Programmable Filter and exposing your options in the Properties panel. See this page for details how to do that.

http://www.kitware.com/blog/home/post/534

Cory Quammen
  • 1,243
  • 7
  • 9
  • This seems very useful. Thanks ! – Bertrand Gazanion Sep 24 '15 at 11:20
  • This looks awesome, and exactly like the thing I was looking for - unfortunately even the test.xml on this site cannot be loaded into my paraview 4.3.6 :( – xtlc Sep 28 '15 at 09:49
  • I just tested the TestFilter.xml on the blog post page and it loads in ParaView 4.4. Could you please describe what you did to load the plugin and in what way is it failing? – Cory Quammen Sep 29 '15 at 13:28