simple Module

For generated server-side proxies, please refer to Available readers, sources, writers, filters and animation cues

simple is a module for using paraview server manager in Python. It provides a simple convenience layer to functionality provided by the C++ classes wrapped to Python as well as the servermanager module.

A simple example:

from paraview.simple import *

# Create a new sphere proxy on the active connection and register it
# in the sources group.
sphere = Sphere(ThetaResolution=16, PhiResolution=32)

# Apply a shrink filter
shrink = Shrink(sphere)

# Turn the visibility of the shrink object on.
Show(shrink)

# Render the scene
Render()

Create a camera link between two view proxies. A name must be given so that the link can be referred to by name. If a link with the given name already exists it will be removed first.

Return the link registration name.

paraview.simple.AddLight(view=None)[source]

Makes a new vtkLight and adds it to the designated or active view.

Create a link between two proxies and return its name.

An instance of a vtkSMProxyLink subclass can be given, otherwise a vtkSMProxyLink is created. This does not link proxy properties. See vtkSMProxyLink.LinkProxyPropertyProxies

If linkName is empty, a default one is created for registration. If a link with the given name already exists it will be removed first.

Return the link registration name.

Create a view link between two render view proxies.

It also creates links for the AxesGrid proxy property. By default, cameras are not linked.

If a link with the given name already exists it will be removed first.

Return the link registration name.

Create a selection link between two filters proxies. A name must be given so that the link can be referred to by name. If a link with the given name already exists it will be removed first.

Create a view link between two view proxies.

A view link is an extension of a proxy link, that also do a rendering when a property changes.

Cameras are not linked.

If a link with the given name already exists it will be removed first.

Return the link registration name.

paraview.simple.AnimateReader(reader=None, view=None)[source]

This is a utility function that, given a reader and a view animates over all time steps of the reader.

paraview.simple.AssignLookupTable(arrayInfo, lutName, rangeOveride=[])[source]

Assign a lookup table to an array by lookup table name.

arrayInfo is the information object for the array. The array name and its range is determined using the info object provided.

lutName is the name for the transfer function preset.

rangeOveride is provided as the range to use instead of the range of the array determined using the arrayInfo.

Example usage:

track = GetAnimationTrack("Center", 0, sphere) or
arrayInfo = source.PointData["Temperature"]
AssignLookupTable(arrayInfo, "Cool to Warm")
paraview.simple.AssignViewToLayout(view=None, layout=None, hint=0)[source]

Assigns the view provided (or active view if None) to the layout provided. If layout is None, then either the active layout or an existing layout on the same server will be used. If no layout exists, then a new layout will be created. Returns True on success.

It is an error to assign the same view to multiple layouts.

paraview.simple.ClearSelection(proxy=None)[source]

Clears the selection on the active source.

paraview.simple.ColorBlockBy(rep=None, selector=None, value=None, separate=False)[source]

Set block scalar color. This will automatically setup the color maps and others necessary state for the representations. ‘rep’ must be the display properties proxy i.e. the value returned by GetDisplayProperties() function. If none is provided the display properties for the active source will be used, if possible. Set separate to True in order to use a separate color map for this representation

paraview.simple.ColorBy(rep=None, value=None, separate=False)[source]

Set scalar color. This will automatically setup the color maps and others necessary state for the representations. ‘rep’ must be the display properties proxy i.e. the value returned by GetDisplayProperties() function. If none is provided the display properties for the active source will be used, if possible. Set separate to True in order to use a separate color map for this representation

paraview.simple.Connect(ds_host=None, ds_port=11111, rs_host=None, rs_port=11111, timeout=60)[source]

Creates a connection to a server. Example usage:

> Connect("amber") # Connect to a single server at default port
> Connect("amber", 12345) # Connect to a single server at port 12345
> Connect("amber", 11111, "vis_cluster", 11111) # connect to data server, render server pair
> Connect("amber", timeout=30) # Connect to a single server at default port with a 30s timeout instead of default 60s
> Connect("amber", timeout=-1) # Connect to a single server at default port with no timeout instead of default 60s
> Connect("amber", timeout=0)  # Connect to a single server at default port without retrying instead of retrying for the default 60s
paraview.simple.Create2DRenderView(**params)[source]

Create the standard 3D render view with the 2D interaction mode turned ON. See CreateView for arguments documentation

paraview.simple.CreateBarChartView(**params)[source]

Create Bar Chart view. See CreateView for arguments documentation

paraview.simple.CreateComparativeBarChartView(**params)[source]

Create comparative Bar Chart view. See CreateView for arguments documentation

paraview.simple.CreateComparativeRenderView(**params)[source]

Create Comparative view. See CreateView for arguments documentation

paraview.simple.CreateComparativeXYPlotView(**params)[source]

Create comparative XY plot Chart view. See CreateView for arguments documentation

paraview.simple.CreateExtractor(name, proxy=None, registrationName=None)[source]

Creates a new extractor and returns it.

Parameters
  • name (str) – The type of the extractor to create.

  • proxy – The proxy to generate the extract from. If not specified

GetActiveSource() is used. :type proxy: paraview.servermanager.Proxy, optional :param registrationName: The registration name to use to register the extractor with the ProxyManager. If not specified a unique name will be generated. :type name: str, optional

Returns

The extractor created, on success, else None

Return type

paraview.servermanager.Proxy or None

paraview.simple.CreateLayout(name=None)[source]

Create a new layout with no active view.

paraview.simple.CreateLight()[source]

Makes a new vtkLight, unattached to a view.

paraview.simple.CreateLookupTable(**params)[source]

Create and return a lookup table. Optionally, parameters can be given to assign to the lookup table.

paraview.simple.CreateParallelCoordinatesChartView(**params)[source]

Create Parallele coordinate Chart view. See CreateView for arguments documentation

paraview.simple.CreatePiecewiseFunction(**params)[source]

Create and return a piecewise function. Optionally, parameters can be given to assign to the piecewise function.

paraview.simple.CreateRenderView(**params)[source]

Create standard 3D render view. See CreateView for arguments documentation

paraview.simple.CreateSteerableParameters(steerable_proxy_type_name, steerable_proxy_registration_name='SteeringParameters', result_mesh_name='steerable')[source]
paraview.simple.CreateTexture(filename=None)[source]

Creates and returns a new vtkTexture. The texture is not attached to anything by default but it can be applied to things, for example the view, like so. >>> GetActiveView().UseTexturedBackground = 1 >>> GetActiveView().BackgroundTexture = CreateTexture(“foo.png”)

paraview.simple.CreateView(view_xml_name, **params)[source]

Creates and returns the specified proxy view based on its name/label. Also set params keywords arguments as view properties.

paraview.simple.CreateWriter(filename, proxy=None, **extraArgs)[source]

Creates a writer that can write the data produced by the source proxy in the given file format (identified by the extension). If no source is provided, then the active source is used. This doesn’t actually write the data, it simply creates the writer and returns it.

paraview.simple.CreateXYPlotView(**params)[source]

Create XY plot Chart view. See CreateView for arguments documentation

paraview.simple.CreateXYPointPlotView(**params)[source]

Create XY plot point Chart view. See CreateView for arguments documentation

paraview.simple.Delete(proxy=None)[source]

Deletes the given pipeline object or the active source if no argument is specified.

paraview.simple.Disconnect(ns=None, force=True)[source]

Free the current active session

paraview.simple.ExportTransferFunction(colortransferfunction, opacitytransferfunction, tfname, filename, location=16)[source]

Export transfer function to a file. The file will be saved in the new JSON format. Note that opacitytransferfunction can be None. The tfname is the name that will be given to the transfer function preset when imported back into ParaView. Returns True on success.

paraview.simple.ExportView(filename, view=None, **params)[source]

Export a view to the specified output file.

paraview.simple.ExtendFileSeries(proxy=None)[source]

For a reader proxy that supports reading files series, detect any new files added to the series and update the reader’s filename property. If no proxy is provided, active source is used.

paraview.simple.FetchData(proxy=None, **kwargs)[source]

Fetches data from the specified data producer for processing locally. Use this function with caution since this can cause large amounts of data to be gathered and delivered to the client.

If no producer is specified, the active source is used.

Basic Usage

# to fetch data from port 0 dataMap = FetchData(producer)

# to fetch data from a specific port dataMap = FetchData(OutputPort(producer, 1))

FetchData() does not explicitly update the pipeline. It is expected that the pipeline is already updated. This will simply deliver the current data.

Returns a map where the key is an integer representing a rank and value is the dataset fetched from that rank.

Keyword Parameters

The following keyword parameters can be used to customize the fetchs.

GatherOnAllRanks (bool/int, optional):

This is used only in symmetric batch (or ParaView-Catalyst) mode. If True, then FetchData() will gather the data on all ranks. Default is to only gather the data on the root node.

SourceRanks (list(int), optional):

List of ints to specity explicitly the ranks from which to fetch data. By default, data from all ranks is fetched.

paraview.simple.FindExtractor(registrationName)[source]

Returns an extractor with a specific registrationName.

Parameters

registrationName (str) – Registration name for the extractor.

Returns

The extractor or None

Return type

paraview.servermanager.Proxy or None

paraview.simple.FindSource(name)[source]

Return a proxy base on the name that was used to register it into the ProxyManager. Example usage:

Cone(guiName='MySuperCone')
Show()
Render()
myCone = FindSource('MySuperCone')
paraview.simple.FindView(name)[source]

Return a view proxy on the name that was used to register it into the ProxyManager. Example usage:

CreateRenderView(guiName='RenderView1')
myView = FindSource('RenderView1')
paraview.simple.FindViewOrCreate(name, viewtype)[source]

Returns the view, if a view with the given name exists and is of the the given type, otherwise creates a new view of the requested type. Note, if a new view is created, it will be assigned to a layout by calling AssignViewToLayout.

paraview.simple.GetActiveCamera()[source]

Returns the active camera for the active view. The returned object is an instance of vtkCamera.

paraview.simple.GetActiveSource()[source]

Returns the active source.

paraview.simple.GetActiveView()[source]

Returns the active view.

paraview.simple.GetActiveViewOrCreate(viewtype)[source]

Returns the active view, if the active view is of the given type, otherwise creates a new view of the requested type. Note, if a new view is created, it will be assigned to a layout by calling AssignViewToLayout.

paraview.simple.GetAllSettings()[source]

Get a list of Strings, that return valid Proxies using the GetSettingsProxy function

paraview.simple.GetAnimationScene()[source]

Returns the application-wide animation scene. ParaView has only one global animation scene. This method provides access to that. Users are free to create additional animation scenes directly, but those scenes won’t be shown in the ParaView GUI.

paraview.simple.GetAnimationTrack(propertyname_or_property, index=None, proxy=None)[source]

Returns an animation cue for the property. If one doesn’t exist then a new one will be created. Typical usage:

track = GetAnimationTrack("Center", 0, sphere) or
track = GetAnimationTrack(sphere.GetProperty("Radius")) or

# this returns the track to animate visibility of the active source in
# all views.
track = GetAnimationTrack("Visibility")

For animating properties on implicit planes etc., use the following signatures:

track = GetAnimationTrack(slice.SliceType.GetProperty("Origin"), 0) or
track = GetAnimationTrack("Origin", 0, slice.SliceType)
paraview.simple.GetBlockColorTransferFunction(selector, arrayname, representation=None, separate=False, **params)[source]

Get the color transfer function used to mapping a block data array with the given name to colors. Representation is used to modify the array name when using a separate color transfer function. separate can be used to recover the separate color transfer function even if it is not used currently by the representation. This may create a new color transfer function if none exists, or return an existing one

paraview.simple.GetCameraTrack(view=None)[source]

Returns the camera animation track for the given view. If no view is specified, active view will be used. If no existing camera animation track is found, a new one will be created.

paraview.simple.GetColorTransferFunction(arrayname, representation=None, separate=False, **params)[source]

Get the color transfer function used to mapping a data array with the given name to colors. Representation is used to modify the array name when using a separate color transfer function. separate can be used to recover the separate color transfer function even if it is not used currently by the representation. This may create a new color transfer function if none exists, or return an existing one

paraview.simple.GetDisplayProperties(proxy=None, view=None)[source]

Given a pipeline object and view, returns the corresponding representation object. If pipeline object and/or view are not specified, active objects are used.

paraview.simple.GetDisplayProperty(*arguments, **keywords)[source]

Same as GetProperty, except that if no ‘proxy’ is passed, it will use the active display properties, rather than the active source

paraview.simple.GetExtractors(proxy=None)[source]

Returns a list of extractors associated with the proxy.

Parameters

proxy – The proxy to return the extractors associated with.

If not specified (or is None) then all extractors are returned. :type proxy: paraview.servermanager.Proxy, optional

Returns

List of associated extractors if any. May return an empty

list. :rtype: list of paraview.servermanager.Proxy

paraview.simple.GetLayout(view=None)[source]

Return the layout containing the give view, if any. If no view is specified, active view is used.

paraview.simple.GetLayoutByName(name)[source]

Return the first layout with the given name, if any.

paraview.simple.GetLayouts()[source]

Returns the layout proxies on the active session. Layout proxies are used to place views in a grid.

paraview.simple.GetLight(number, view=None)[source]

Get a handle on a previously added light

paraview.simple.GetLookupTableForArray(arrayname, num_components, **params)[source]

Used to get an existing lookuptable for a array or to create one if none exists. Keyword arguments can be passed in to initialize the LUT if a new one is created. PARAVIEW_DEPRECATED_IN_5_12_0: Use GetColorTransferFunction instead

paraview.simple.GetLookupTableNames()[source]

Returns a list containing the currently available transfer function presets.

paraview.simple.GetMaterialLibrary()[source]

Returns the material library for the active session.

paraview.simple.GetNumberOfCallbackThreads(n)[source]
paraview.simple.GetOpacityTransferFunction(arrayname, representation=None, separate=False, **params)[source]

Get the opacity transfer function used to mapping a data array with the given name to opacity. Representation is used to modify the array name when using a separate opacity transfer function. separate can be used to recover the separate opacity transfer function even if it is not used currently by the representation. This may create a new opacity transfer function if none exists, or return an existing one

paraview.simple.GetOpenGLInformation(location=16)[source]

Recover OpenGL information, by default on the client

paraview.simple.GetParaViewSourceVersion()[source]

Returns the paraview source version string e.g. ‘paraview version x.x.x, Date: YYYY-MM-DD’.

paraview.simple.GetParaViewVersion()[source]

Returns the version of the ParaView build

paraview.simple.GetProperty(*arguments, **keywords)[source]

Get one property of the given pipeline object. If keywords are used, you can set the proxy and the name of the property that you want to get as shown in the following example:

GetProperty({proxy=sphere, name="Radius"})

If arguments are used, then you have two cases:

  • if only one argument is used that argument will be the property name.

  • if two arguments are used then the first one will be the proxy and the second one the property name.

Several example are given below:

GetProperty({name="Radius"})
GetProperty({proxy=sphereProxy, name="Radius"})
GetProperty( sphereProxy, "Radius" )
GetProperty( "Radius" )
paraview.simple.GetRenderView()[source]

Returns the active view if there is one. Else creates and returns a new view.

paraview.simple.GetRenderViews()[source]

Returns all render views as a list.

paraview.simple.GetRepresentation(proxy=None, view=None)[source]

Given a pipeline object and view, returns the corresponding representation object. If pipeline object and view are not specified, active objects are used.

paraview.simple.GetRepresentationAnimationHelper(sourceproxy)[source]

Method that returns the representation animation helper for a source proxy. It creates a new one if none exists.

paraview.simple.GetRepresentations()[source]

Returns all representations (display properties).

paraview.simple.GetScalarBar(ctf, view=None)[source]

Returns the scalar bar for color transfer function in the given view. If view is None, the active view will be used, if possible. This will either return an existing scalar bar or create a new one.

paraview.simple.GetSettingsProxy(type)[source]

Given a type as name returns the Proxy for those settings. For example for type=GeneralSettings

paraview.simple.GetSources()[source]

Given the name of a source, return its Python object.

paraview.simple.GetTimeKeeper()[source]

Returns the time-keeper for the active session. Timekeeper is often used to manage time step information known to the ParaView application.

paraview.simple.GetTimeTrack()[source]

Returns the animation track used to control the time requested from all readers/filters during playback. This is the “TimeKeeper - Time” track shown in ParaView’s ‘Animation View’.

paraview.simple.GetTransferFunction2D(arrayname, array2name=None, representation=None, separate=False, **params)[source]

Get the 2D transfer function used to map either two data arrays or a data array against its gradient to color and opacity. Representation is used to modify the array name when using a separate color transfer function. separate can be used to recover the separate transfer function even if it is not used by the representation. This may create a new 2D transfer function if none exists, or return an existing one

paraview.simple.GetViewForLight(proxy)[source]

Given a light proxy, find which view it belongs to

paraview.simple.GetViewProperties(view=None)[source]

Same as GetActiveView(), this API is provided just for consistency with GetDisplayProperties().

paraview.simple.GetViewProperty(*arguments, **keywords)[source]

Same as GetProperty, except that if no ‘proxy’ is passed, it will use the active view properties, rather than the active source

paraview.simple.GetViews(viewtype=None)[source]

Returns all views. If viewtype is specified, only the views of the specified type are returned

paraview.simple.GetViewsInLayout(layout=None)[source]

Returns a list of views in the given layout. If not layout is specified, the layout for the active view is used, if possible.

paraview.simple.Hide(proxy=None, view=None)[source]

Turns the visibility of a given pipeline object off in the given view. If pipeline object and/or view are not specified, active objects are used.

paraview.simple.HideAll(view=None)[source]

Hide all pipeline sources in the given view. If view is not specified, active view is used.

paraview.simple.HideInteractiveWidgets(proxy=None)[source]

If possible in the current environment, this method will request the application to hide the interactive widget(s) for proxy

paraview.simple.HideScalarBarIfNotNeeded(lut, view=None)[source]

Hides the given scalar bar if it is not used by any of the displayed data.

paraview.simple.HideUnusedScalarBars(view=None)[source]

Hides all unused scalar bars from the view. A scalar bar is used if some data is shown in that view that is coloring using the transfer function shown by the scalar bar.

paraview.simple.ImportPresets(filename, location=16)[source]

Import presets from a file. The file can be in the legacy color map xml format or in the new JSON format. Returns True on success.

paraview.simple.Interact(view=None)[source]

Call this method to start interacting with a view. This method will block till the interaction is done. This method will simply return if the local process cannot support interactions.

paraview.simple.LoadCustomFilters(filename, ns=None)[source]

Loads a custom filter XML file and updates this module with new constructors if any. If you loaded the simple module with from paraview.simple import *, make sure to pass globals() as an argument.

paraview.simple.LoadDistributedPlugin(pluginname, remote=True, ns=None)[source]

Loads a plugin that’s distributed with the executable. This uses the information known about plugins distributed with ParaView to locate the shared library for the plugin to load. Raises a RuntimeError if the plugin was not found.

Note, remote=True has no effect when running in batch mode (or Catalyst) or when the active connection is not a client-server connection.

paraview.simple.LoadLookupTable(fileName)[source]

Load transfer function preset from a file. Both JSON (new) and XML (legacy) preset formats are supported. If the filename ends with a .xml, it’s assumed to be a legacy color map XML and will be converted to the new format before processing.

paraview.simple.LoadPalette(paletteName)[source]

Load a color palette to override the default foreground and background colors used by ParaView views. The current global palette’s colors are set to the colors in the loaded palette.

paraview.simple.LoadPlugin(filename, remote=True, ns=None)[source]

Loads a ParaView plugin and updates this module with new constructors if any. The remote argument (default to True) is to specify whether the plugin will be loaded on client (remote=False) or on server (remote=True). If you loaded the simple module with from paraview.simple import *, make sure to pass globals() as an argument:

LoadPlugin("myplugin", False, globals()) # to load on client
LoadPlugin("myplugin", True, globals())  # to load on server
LoadPlugin("myplugin", ns=globals())     # to load on server

Otherwise, the new functions will not appear in the global namespace.

Note, remote=True has no effect when the connection is not remote.

paraview.simple.LoadPlugins(*args, **kwargs)[source]

Loads ParaView plugins and updates this module with new constructors if any. The remote keword argument (default to True) is to specify whether the plugin will be loaded on client (remote=False) or on server (remote=True). Proxy definition updates are deferred until all plugins have been read, which can be more computationally efficient when multiple plugins are loaded in sequence. If you loaded the simple module with from paraview.simple import *, make sure to pass globals() as a keyword argument:

LoadPlugins("myplugin1", "myplugin2", remote=False, ns=globals()) # to load on client
LoadPlugins("myplugin", "myplugin2", remote=True, ns=globals())  # to load on server
LoadPlugins("myplugin", "myplugin2", ns=globals())     # to load on server

Otherwise, the new functions will not appear in the global namespace.

Note, remote=True has no effect when the connection is not remote.

paraview.simple.LoadState(statefile, data_directory=None, restrict_to_data_directory=False, filenames=None, location=16, *args, **kwargs)[source]

Load PVSM state file.

This will load the state specified in the statefile.

ParaView can update absolute paths for data-files used in the state which can be useful to portably load state file across different systems.

If data_directory is not None, then ParaView searches for files matching those used in the state under the specified directory and if found, replaces the state to use the found files instead. If restrict_to_data_directory is True, if a file is not found under the data_directory, it will raise an error, otherwise it is left unchanged.

Alternatively, filenames can be used to specify a list of updated filesnames explicitly. This must be list of the following form:

[
{

# either ‘name’ or ‘id’ are required. if both are provided, ‘id’ # is checked first. “name” : “[reader name shown in pipeline browser]”, “id” : “[reader id used in the pvsm state file]”,

# all modified filename-like properties on this reader “FileName” : … ….

},

]

Presence of other positional or keyword arguments is used to indicate that this invocation uses the legacy signature of this function and forwards to _LoadStateLegacy.

paraview.simple.LoadXML(xmlstring, ns=None)[source]

Given a server manager XML as a string, parse and process it. If you loaded the simple module with from paraview.simple import *, make sure to pass globals() as the second arguments:

LoadXML(xmlstring, globals())

Otherwise, the new functions will not appear in the global namespace.

paraview.simple.LocateView(displayProperties=None)[source]

Given a displayProperties object i.e. the object returned by GetDisplayProperties() or Show() functions, this function will locate a view to which the displayProperties object corresponds.

paraview.simple.MakeBlueToRedLT(min, max)[source]

Create a LookupTable that go from blue to red using the scalar range provided by the min and max arguments.

paraview.simple.OpenDataFile(filename, **extraArgs)[source]

Creates a reader to read the give file, if possible. This uses extension matching to determine the best reader possible. If a reader cannot be identified, then this returns None.

paraview.simple.ReloadFiles(proxy=None)[source]

Forces the proxy to reload the data files. If no proxy is provided, active source is used.

Remove a camera link with the given name.

paraview.simple.RemoveLayout(proxy=None)[source]

Remove the provided layout, if none is provided, remove the layout containing the active view. If it is the last layout it will create a new one with the same name as the removed one.

paraview.simple.RemoveLight(light)[source]

Removes an existing vtkLight from its view.

Remove a link with the given name.

Remove a selection link with the given name.

paraview.simple.RemoveViewsAndLayouts()[source]
paraview.simple.RenameLayout(newName, proxy=None)[source]

Renames the given layout. If the given proxy is not registered in the layout group this method will have no effect. If no layout is provided, the active layout is used.

paraview.simple.RenameProxy(proxy, group, newName)[source]

Renames the given proxy.

paraview.simple.RenameSource(newName, proxy=None)[source]

Renames the given source. If the given proxy is not registered in the sources group this method will have no effect. If no source is provided, the active source is used.

paraview.simple.RenameView(newName, proxy=None)[source]

Renames the given view. If the given proxy is not registered in the views group this method will have no effect. If no view is provided, the active view is used.

paraview.simple.Render(view=None)[source]

Renders the given view (default value is active view)

paraview.simple.RenderAllViews()[source]

Render all views

paraview.simple.ReplaceReaderFileName(readerProxy, files, propName)[source]

Replaces the readerProxy by a new one given a list of files. PropName should be “FileNames” or “FileName” depending on the property name in the reader.

paraview.simple.ResetCamera(view=None)[source]

Resets the settings of the camera to preserver orientation but include the whole scene. If an argument is not provided, the active view is used.

paraview.simple.ResetCameraToDirection(position, direction, up=None, view=None)[source]

Resets the settings of the camera to the given position and direction

paraview.simple.ResetProperty(propertyName, proxy=None, restoreFromSettings=True)[source]
paraview.simple.ResetSession()[source]

Reset the session to its initial state.

paraview.simple.ReverseConnect(port=11111)[source]

Create a reverse connection to a server. Listens on port and waits for an incoming connection from the server.

paraview.simple.SaveAnimation(filename, viewOrLayout=None, scene=None, location=16, **params)[source]

Save animation as a movie file or series of images.

SaveAnimation is used to save an animation as a movie file (avi or ogv) or a series of images.

Parameters

filename (str)

Name of the output file. The extension is used to determine the type of the output. Supported extensions are png, jpg, tif, bmp, and ppm. Based on platform (and build) configuration, avi and ogv may be supported as well.

viewOrLayout (proxy, optional)

The view or layout to save image from, defaults to None. If None, then the active view is used, if available. To save image from a single view, this must be set to a view, to save an image from all views in a layout, pass the layout.

scene (proxy, optional)

Animation scene to save. If None, then the active scene returned by GetAnimationScene is used.

location (int)

Location where the screenshot should be saved. This can be one of the following values: vtkPVSession.CLIENT, vtkPVSession.DATA_SERVER. The default is vtkPVSession.CLIENT.

Keyword Parameters (optional)

SaveAnimation supports all keyword parameters supported by SaveScreenshot. In addition, the following parameters are supported:

FrameRate (int):

Frame rate in frames per second for the output. This only affects the output when generated movies (avi or ogv), and not when saving the animation out as a series of images.

FrameWindow (tuple(int,int))

To save a part of the animation, provide the range in frames or timesteps index.

In addition, several format-specific keyword parameters can be specified. The format is chosen based on the file extension.

For Image-based file-formats that save series of images e.g. PNG, JPEG, following parameters are available.

SuffixFormat (string):

Format string used to convert the frame number to file name suffix.

FFMPEG avi file format supports following parameters.

Compression (int)

Set to 1 or True to enable compression.

Quality:

When compression is 1 (or True), this specifies the compression quality. 0 is worst quality (smallest file size) and 2 is best quality (largest file size).

VideoForWindows (VFW) avi file format supports following parameters.

Quality:

This specifies the compression quality. 0 is worst quality (smallest file size) and 2 is best quality (largest file size).

OGG/Theora file format supports following parameters.

Quality:

This specifies the compression quality. 0 is worst quality (smallest file size) and 2 is best quality (largest file size).

UseSubsampling:

When set to 1 (or True), the video will be encoded using 4:2:0 subsampling for the color channels.

paraview.simple.SaveData(filename, proxy=None, **extraArgs)[source]

Save data produced by ‘proxy’ in a file. If no proxy is specified the active source is used. Properties to configure the writer can be passed in as keyword arguments. Example usage:

SaveData("sample.pvtp", source0)
SaveData("sample.csv", FieldAssociation="Points")
paraview.simple.SaveExtracts(**kwargs)[source]

Generate extracts. Parameters are forwarded for ‘SaveAnimationExtracts’ Currently, supported keyword parameters are:

Parameters

ExtractsOutputDirectory (str) – root directory for extracts

paraview.simple.SaveExtractsUsingCatalystOptions(options)[source]

Generates extracts using a CatalystOptions object. This is intended for use when a Catalyst analysis script is being run in batch.

paraview.simple.SaveScreenshot(filename, viewOrLayout=None, saveInBackground=False, location=16, **params)[source]

Save screenshot for a view or layout (collection of views) to an image.

SaveScreenshot is used to save the rendering results to an image.

Parameters

filename (str)

Name of the image file to save to. The filename extension is used to determine the type of image file generated. Supported extensions are png, jpg, tif, bmp, and ppm.

viewOrLayout (proxy, optional):

The view or layout to save image from, defaults to None. If None, then the active view is used, if available. To save image from a single view, this must be set to a view, to save an image from all views in a layout, pass the layout.

saveInBackground (bool)

If set to True, the screenshot will be saved by a different thread and run in the background. In such circumstances, one can wait until the file is written by calling WaitForScreenshot(filename).

location (int)

Location where the screenshot should be saved. This can be one of the following values: vtkPVSession.CLIENT, vtkPVSession.DATA_SERVER. The default is vtkPVSession.CLIENT.

Keyword Parameters (optional)

ImageResolution (tuple(int, int))

A 2-tuple to specify the output image resolution in pixels as (width, height). If not specified, the view (or layout) size is used.

FontScaling (str)

Specify whether to scale fonts proportionally (“Scale fonts proportionally”) or not (“Do not scale fonts”). Defaults to “Scale fonts proportionally”.

SeparatorWidth (int)

When saving multiple views in a layout, specify the width (in approximate pixels) for a separator between views in the generated image.

SeparatorColor (tuple(float, float, float))

Specify the color for separator between views, if applicable.

OverrideColorPalette (:obj:str, optional)

Name of the color palette to use, if any. If none specified, current color palette remains unchanged.

StereoMode (str)

Stereo mode to use, if any. Available values are “No stereo”, “Red-Blue”, “Interlaced”, “Left Eye Only”, “Right Eye Only”, “Dresden”, “Anaglyph”, “Checkerboard”, “Side-by-Side Horizontal”, and the default “No change”.

TransparentBackground (int)

Set to 1 (or True) to save an image with background set to alpha=0, if supported by the output image format.

In addition, several format-specific keyword parameters can be specified. The format is chosen based on the file extension.

For JPEG (*.jpg), the following parameters are available (optional)

Quality (int) [0, 100]

Specify the JPEG compression quality. O is low quality (maximum compression) and 100 is high quality (least compression).

Progressive (int):

Set to 1 (or True) to save progressive JPEG.

For PNG (*.png), the following parameters are available (optional)

CompressionLevel (int) [0, 9]

Specify the zlib compression level. 0 is no compression, while 9 is maximum compression.

Legacy Parameters

Prior to ParaView version 5.4, the following parameters were available and are still supported. However, they cannot be used together with other keyword parameters documented earlier.

view (proxy)

Single view to save image from.

layout (proxy)

Layout to save image from.

magnification (int)

Magnification factor to use to save the output image. The current view (or layout) size is scaled by the magnification factor provided.

quality (int)

Output image quality, a number in the range [0, 100].

paraview.simple.SaveState(filename, location=16)[source]
paraview.simple.SelectCells(query=None, proxy=None)[source]

Select cells satisfying the query. If query is None, then all cells are selected. If proxy is None, then the active source is used.

paraview.simple.SelectPoints(query=None, proxy=None)[source]

Select points satisfying the query. If query is None, then all points are selected. If proxy is None, then the active source is used.

paraview.simple.SetActiveConnection(connection=None, ns=None)[source]

Set the active connection. If the process was run without multi-server enabled and this method is called with a non-None argument while an ActiveConnection is present, it will raise a RuntimeError.

paraview.simple.SetActiveSource(source)[source]

Sets the active source.

paraview.simple.SetActiveView(view)[source]

Sets the active view.

paraview.simple.SetDisplayProperties(proxy=None, view=None, **params)[source]

Sets one or more display properties of the given pipeline object. If an argument is not provided, the active source is used. Pass a list of property_name=value pairs to this function to set property values. For example:

SetProperties(Color=[1, 0, 0], LineWidth=2)
paraview.simple.SetNumberOfCallbackThreads(n)[source]

Sets the number of threads used by the threaded callback queue that can be used for saving screenshots.

paraview.simple.SetProperties(proxy=None, **params)[source]

Sets one or more properties of the given pipeline object. If an argument is not provided, the active source is used. Pass a list of property_name=value pairs to this function to set property values. For example:

SetProperties(Center=[1, 2, 3], Radius=3.5)
paraview.simple.SetViewProperties(view=None, **params)[source]

Sets one or more properties of the given view. If an argument is not provided, the active view is used. Pass a list of property_name=value pairs to this function to set property values. For example:

SetProperties(Background=[1, 0, 0], UseImmediateMode=0)
paraview.simple.Show(proxy=None, view=None, representationType=None, **params)[source]

Turns the visibility of a given pipeline object on in the given view. If pipeline object and/or view are not specified, active objects are used.

paraview.simple.ShowAll(view=None)[source]

Show all pipeline sources in the given view. If view is not specified, active view is used.

paraview.simple.ShowInteractiveWidgets(proxy=None)[source]

If possible in the current environment, this method will request the application to show the interactive widget(s) for proxy

paraview.simple.UpdatePipeline(time=None, proxy=None)[source]

Updates (executes) the given pipeline object for the given time as necessary (i.e. if it did not already execute). If no source is provided, the active source is used instead.

paraview.simple.UpdateScalarBars(view=None)[source]

Hides all unused scalar bar and shows used scalar bars. A scalar bar is used if some data is shown in that view that is coloring using the transfer function shown by the scalar bar.

paraview.simple.UpdateScalarBarsComponentTitle(ctf, representation=None)[source]

Update all scalar bars using the provided lookup table. The representation is used to recover the array from which the component title was obtained. If None is provided the representation of the active source in the active view is used.

paraview.simple.UpdateSteerableParameters(steerable_proxy, steerable_source_name)[source]
paraview.simple.WaitForScreenshot(filename=None)[source]

Pause this thread until screenshot named filename has terminated. If no filename is provided, then this thread pauses until all screenshot have been saved.

paraview.simple.WriteAnimationGeometry(filename, view=None)[source]

Save the animation geometry from a specific view to a file specified. The animation geometry is written out as a PVD file. If no view is specified, the active view will be used of possible.

paraview.simple.demo1()[source]

Simple demo that create the following pipeline:

sphere - shrink +
cone            + > append
paraview.simple.demo2(fname='/Users/berk/Work/ParaView/ParaViewData/Data/disk_out_ref.ex2')[source]

This demo shows the use of readers, data information and display properties.