New in ParaView: Python Trace On-the-fly

Python tracing in ParaView refers to the ability to generate a Python script corresponding to the actions performed in the ParaView UI. It is arguably the most convenient and easiest way for learning how to script ParaView using Python. The Python tracing infrastructure was revamped considerably for the upcoming ParaView 4.2 release. I'll be covering some of the highlights of these enhanced tracing capabilities in this series of blog posts.

Previously (4.1 and earlier), when you started the Python trace (using Tools | Start Trace menu option), you had to wait till you stopped the trace (using Tools | Stop Trace) to inspect the generated trace. As a result, it was difficult to understand which Python commands are needed to mimic a specific action in the UI. Wouldn't it be nice if the script was shown as it was being generated? With the nightly release of ParaView (and starting the upcoming 4.2 release), you can indeed do exactly that.

When you click on the menu option Tools | Start Trace, you'll now get a Trace Options dialog which allows you to customize how the trace is generated.

To enable tracing-as-you-go, simply check the Show trace as it is being generated option and hit OK. Now as you interact with the UI to create filters, change properties etc, you'll have the Script Editor popup and show you the Python script being generated as it is updated.

You always rather have the trace shown as it's generated and not have to check this button each time? Simply click on the Save button that looks like a floppy disk and your selections will be saved for reuse the next time you start tracing.

…and if you're wondering what the other options do, stay tuned for the followup posts. 

Questions or comments are always welcome!