New Options when Loading ParaView State Files

When a ParaView state file is saved, it saves the absolute paths to the data files that ParaView has loaded. This has made sharing state files annoying since the person loading the state file has to tell ParaView where to look for each data file. Since sharing state files is something many people want to do, one of the most requested features for ParaView is to be able to load data from a path relative to the state file rather than an absolute path. We have added some new features to loading state files that will make sharing state files much easier.

When you load a state file, ParaView will now give broader options of where to look for the files as shown in this screenshot:

Load State Options dialog with data location dropdown

The new ‘Load State Options’ dialog in ParaView showing the locations to search for data files dropdown options.

Use File Names From State just uses the file locations specified in the state file and errors if they are not found.  This is useful if you are using a state file written out on the same computer.

Search files under specified directory looks for the data files in a specified directory.  ParaView will parse out the filename of each file and look in the given directory to see if that filename exists.  If the file exists it will be used, otherwise it will try the path in the state file.  Since a common use case is sharing state files along with their data, the default directory used by this option is the location of the state file.  Here is what the dialog looks like when using this option:

Load State Options with search under directory option

The Load State Options dialog with the Search files under specified directory option selected

The Choose File Names option is the old default: manually specifying where each data file is located.  This is still useful for running a pipeline on a different dataset than the one it was built with although we expect the other two to be more commonly used.  This option has been improved with the ability to specify environment variables as a part of the filename as shown here:

Load data relative to environment variables

The ParaView Load State Options dialog showing finding data with environment variables in the path

Unlike the old load state file mechanism these options can also be specified from the Python API.  Use the python trace to find the options needed for a given state file.  Here is an example of loading state in a python script that loads a state and uses the Search files under specified directory option.  This was created by using Python Trace while loading the state file used to create the above screenshots, so you can compare the options passed to LoadState to the options in the screenshots above.

These changes are merged into ParaView master and are available in the ParaView 5.4-RC1 binaries which can be obtained here.

Additional details about these options are available in the ParaView Guide in the chapter named Saving Results.

6 Responses to New Options when Loading ParaView State Files

  1. Pingback: Bruno

  2. Pingback: Shawn Waldon

    • Pingback: Bruno

  3. Pingback: Elio

  4. Pingback: Shawn Waldon

  5. Pingback: Benedikt Zier

Questions or comments are always welcome!

X