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. 

3 Responses to New in ParaView: Python Trace On-the-fly

  1. Hello, I am trying to start trace following steps given above, but after clicking OK, paraview window closes itself and in the command line I see the error:

    ERROR: In /home/buildslave/dashboards/buildbot/paraview-pvbinsdash-linux-shared-release_superbuild/build/superbuild/paraview/src/ParaViewCore/ServerManager/Core/vtkSMTrace.cxx, line 73
    vtkSMTrace (0x588ac90): Failed to import paraview.smtrace module.

    Generic Warning: In /home/buildslave/dashboards/buildbot/paraview-pvbinsdash-linux-shared-release_superbuild/build/superbuild/paraview/src/ParaViewCore/ServerManager/Core/vtkSMTrace.cxx, line 157
    Start not started since required Python modules are missing.

    Please tell me if anything is missing and what is meant by python module? I have already python 2.7.3 installed.

  2. Eric says:

    I get the same error.

    I’m using ParaView 5.01 which I installed with sudo apt-get install paraview on Ubuntu 16.04

Questions or comments are always welcome!

X