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.

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

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

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.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(detachedFromLayout=False, **params)[source]

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

paraview.simple.CreateBarChartView(detachedFromLayout=False, **params)[source]

“Create Bar Chart view. See CreateView for arguments documentation

paraview.simple.CreateComparativeBarChartView(detachedFromLayout=False, **params)[source]

“Create comparative Bar Chart view. See CreateView for arguments documentation

paraview.simple.CreateComparativeRenderView(detachedFromLayout=False, **params)[source]

“Create Comparative view. See CreateView for arguments documentation

paraview.simple.CreateComparativeXYPlotView(detachedFromLayout=False, **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(detachedFromLayout=False, **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(detachedFromLayout=False, **params)[source]

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

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

Create and return a scalar bar widget. The returned widget may be added to a render view by appending it to the view’s representations The widget must have a valid lookup table before it is added to a view. It is possible to pass the lookup table (and other properties) as arguments to this method:

lt = MakeBlueToRedLt(3.5, 7.5)
bar = CreateScalarBar(LookupTable=lt, Title="Velocity")
GetRenderView().Representations.append(bar)

By default the returned widget is selectable and resizable.

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, detachedFromLayout=None, **params)[source]

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

detachedFromLayout has been deprecated in ParaView 5.7 as it is no longer needed. All views are created detached by default.

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(detachedFromLayout=False, **params)[source]

Create XY plot Chart view. See CreateView for arguments documentation

paraview.simple.CreateXYPointPlotView(detachedFromLayout=False, **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)[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.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.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. * DEPRECATED *: 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.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.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.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.Hide3DWidgets(proxy=None)[source]

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

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.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.ImportCinema(filename, view=None)[source]

::deprecated:: 5.9

Cinema import capabilities are no longer supported in this version.

paraview.simple.ImportPresets(filename)[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(filename, connection=None, **extraArgs)[source]
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.

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.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, **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.

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.

Obsolete Parameters

DisconnectAndSave (int):

This mode is no longer supported as of ParaView 5.5, and will be ignored.

ImageQuality (int)

For ParaView 5.4, the following parameters were available, however it is ignored starting with ParaView 5.5. Instead, it is recommended to use format-specific quality parameters based on the file format being used.

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, **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.

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].

ImageQuality (int)

For ParaView 5.4, the following parameters were available, however it is ignored starting with ParaView 5.5. Instead, it is recommended to use format-specific quality parameters based on the file format being used.

paraview.simple.SaveState(filename)[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.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.Show3DWidgets(proxy=None)[source]

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

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.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.WriteAnimation(filename, **params)[source]

::deprecated:: 5.3 Use SaveAnimation() instead.

This function can still be used to save an animation, but using :func: SaveAnimation is strongly recommended as it provides more flexibility.

The following parameters are currently supported.

Parameters

filename (str)

Name of the output file.

Keyword Parameters (optional)

Magnification (int):

Magnification factor for the saved animation.

Quality (int)

int in range [0,2].

FrameRate (int)

Frame rate.

The following parameters are no longer supported and are ignored: Subsampling, BackgroundColor, FrameRate, StartFileCount, PlaybackTimeWindow

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.WriteImage(filename, view=None, **params)[source]

::deprecated:: 4.2 Use SaveScreenshot() instead.

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.