-# Copyright (C) 2010-2012 CEA/DEN, EDF R&D
+# Copyright (C) 2010-2014 CEA/DEN, EDF R&D
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
from math import sqrt, sin, cos, radians
from string import upper
-import pvsimple as pv
+# Do not use pv as a short name.
+# It is a name of function from numpy and may be redefined implicitly by 'from numpy import *' call.
+# import pvsimple as pv
+import pvsimple as pvs
#try:
# # TODO(MZN): to be removed (issue with Point Sprite texture)
# #import paravisSM as sm
#except:
-# import paraview.simple as pv
+# import paraview.simple as pvs
# import paraview.servermanager as sm
os.makedirs(pic_dir)
# Save picture
- pv.WriteImage(file_name, view=view, Magnification=1)
+ pvs.WriteImage(file_name, view=view, Magnification=1)
def reset_view(view=None):
"""
if not view:
- view = pv.GetRenderView()
+ view = pvs.GetRenderView()
# Camera preferences
view.CameraFocalPoint = [0.0, 0.0, 0.0]
view.CameraParallelProjection = 1
view.ResetCamera()
- pv.Render(view=view)
+ pvs.Render(view=view)
def hide_all(view, to_remove=False):
"""Hide all representations in the view."""
if not view:
- view = pv.GetRenderView()
+ view = pvs.GetRenderView()
rep_list = view.Representations
for rep in rep_list:
rep.Visibility = 0
if to_remove:
view.Representations.remove(rep)
- pv.Render(view=view)
+ pvs.Render(view=view)
def display_only(prs, view=None):
hide_all(view)
if (hasattr(prs, 'Visibility') and prs.Visibility != 1):
prs.Visibility = 1
- pv.Render(view=view)
+ pvs.Render(view=view)
def set_visible_lines(xy_prs, lines):
# Transform vector array to scalar array if possible
nb_components = get_nb_components(proxy, array_entity, array_name)
if (nb_components > 1):
- calculator = pv.Calculator(proxy)
- attribute_mode = "point_data"
+ calculator = pvs.Calculator(proxy)
+ attribute_mode = "Point Data"
if array_entity != EntityType.NODE:
- attribute_mode = "cell_data"
+ attribute_mode = "Cell Data"
calculator.AttributeMode = attribute_mode
if (nb_components == 2):
# Workaroud: calculator unable to compute magnitude
nb_components = get_nb_components(proxy, array_entity, array_name)
if nb_components == 2:
- calculator = pv.Calculator(proxy)
- attribute_mode = "point_data"
+ calculator = pvs.Calculator(proxy)
+ attribute_mode = "Point Data"
if array_entity != EntityType.NODE:
- attribute_mode = "cell_data"
+ attribute_mode = "Cell Data"
calculator.AttributeMode = attribute_mode
expression = "iHat * " + array_name + "_X + jHat * " + array_name + "_Y + kHat * 0"
calculator.Function = expression
types with data for even one field (from available) will be selected.
"""
+ if not hasattr(proxy, 'Entity'):
+ return
+
#all_cell_types = proxy.CellTypes.Available
all_cell_types = proxy.Entity.Available
all_arrays = list(proxy.CellArrays.GetData())
# Extract groups if necessary
if force or (len(groups_to_extract) < len(initial_groups)):
- extract_group = pv.ExtractGroup(proxy)
+ extract_group = pvs.ExtractGroup(proxy)
extract_group.Groups = groups_to_extract
extract_group.UpdatePipeline()
source = extract_group
title = "\n".join([title, vector_mode])
# Create scalar bar
- scalar_bar = pv.CreateScalarBar(Enabled=1)
+ scalar_bar = pvs.CreateScalarBar(Enabled=1)
scalar_bar.Orientation = 'Vertical'
scalar_bar.Title = title
scalar_bar.LookupTable = lookup_table
scalar_bar.LabelShadow = 1
# Add the scalar bar to the view
- pv.GetRenderView().Representations.append(scalar_bar)
+ pvs.GetRenderView().Representations.append(scalar_bar)
# Reassign the current bar
_current_bar = scalar_bar
def get_lookup_table(field_name, nb_components, vector_mode='Magnitude'):
"""Get lookup table for the given field."""
- lookup_table = pv.GetLookupTableForArray(field_name, nb_components)
+ lookup_table = pvs.GetLookupTableForArray(field_name, nb_components)
if vector_mode == 'Magnitude':
lookup_table.VectorMode = vector_mode
def get_time(proxy, timestamp_nb):
"""Get time value by timestamp number."""
# Check timestamp number
- timestamps = proxy.TimestepValues.GetData()
+ timestamps = []
+
+ if (hasattr(proxy, 'TimestepValues')):
+ timestamps = proxy.TimestepValues.GetData()
+ elif (hasattr(proxy.Input, 'TimestepValues')):
+ timestamps = proxy.Input.TimestepValues.GetData()
+
if ((timestamp_nb - 1) not in xrange(len(timestamps))):
- raise ValueError("Timestamp number is out of range: " + timestamp_nb)
+ raise ValueError("Timestamp number is out of range: " + str(timestamp_nb))
# Return time value
return timestamps[timestamp_nb - 1]
time_value = get_time(proxy, timestamp_nb)
# Set timestamp
- pv.GetRenderView().ViewTime = time_value
- pv.UpdatePipeline(time_value, proxy)
+ pvs.GetRenderView().ViewTime = time_value
+ pvs.UpdatePipeline(time_value, proxy)
# Extract only groups with data for the field
new_proxy = extract_groups_for_field(proxy, field_name, entity,
force=True)
# Get Scalar Map representation object
- scalarmap = pv.GetRepresentation(new_proxy)
+ scalarmap = pvs.GetRepresentation(new_proxy)
# Get lookup table
lookup_table = get_lookup_table(field_name, nb_components, vector_mode)
time_value = get_time(proxy, timestamp_nb)
# Set timestamp
- pv.GetRenderView().ViewTime = time_value
- pv.UpdatePipeline(time_value, proxy)
+ pvs.GetRenderView().ViewTime = time_value
+ pvs.UpdatePipeline(time_value, proxy)
# Create slice filter
- slice_filter = pv.Slice(proxy)
+ slice_filter = pvs.Slice(proxy)
slice_filter.SliceType = "Plane"
# Set cut planes normal
slice_filter.SliceOffsetValues = positions
# Get Cut Planes representation object
- cut_planes = pv.GetRepresentation(slice_filter)
+ cut_planes = pvs.GetRepresentation(slice_filter)
# Get lookup table
lookup_table = get_lookup_table(field_name, nb_components, vector_mode)
time_value = get_time(proxy, timestamp_nb)
# Set timestamp
- pv.GetRenderView().ViewTime = time_value
- pv.UpdatePipeline(time_value, proxy)
+ pvs.GetRenderView().ViewTime = time_value
+ pvs.UpdatePipeline(time_value, proxy)
# Create base plane
- base_plane = pv.Slice(proxy)
+ base_plane = pvs.Slice(proxy)
base_plane.SliceType = "Plane"
# Set base plane normal
base_plane = proxy
# Create cutting planes
- cut_planes = pv.Slice(base_plane)
+ cut_planes = pvs.Slice(base_plane)
cut_planes.SliceType = "Plane"
# Set cutting planes normal and get positions
point2 = [bounds[1], bounds[3], bounds[5]]
# Create plot over line filter
- pol = pv.PlotOverLine(cut_planes,
+ pol = pvs.PlotOverLine(cut_planes,
Source="High Resolution Line Source")
- pv.RenameSource('Y' + str(index), pol)
+ pvs.RenameSource('Y' + str(index), pol)
pol.Source.Point1 = point1
pol.Source.Point2 = point2
pol.UpdatePipeline()
cut_planes.UpdatePipeline()
# Get Cut Lines representation object
- cut_lines = pv.GetRepresentation(cut_planes)
+ cut_lines = pvs.GetRepresentation(cut_planes)
# Get lookup table
lookup_table = get_lookup_table(field_name, nb_components, vector_mode)
time_value = get_time(proxy, timestamp_nb)
# Set timestamp
- pv.GetRenderView().ViewTime = time_value
- pv.UpdatePipeline(time_value, proxy)
+ pvs.GetRenderView().ViewTime = time_value
+ pvs.UpdatePipeline(time_value, proxy)
# Create plot over line filter
- pol = pv.PlotOverLine(proxy, Source="High Resolution Line Source")
+ pol = pvs.PlotOverLine(proxy, Source="High Resolution Line Source")
pol.Source.Point1 = point1
pol.Source.Point2 = point2
pol.UpdatePipeline()
# Get Cut Segment representation object
- cut_segment = pv.GetRepresentation(pol)
+ cut_segment = pvs.GetRepresentation(pol)
# Get lookup table
lookup_table = get_lookup_table(field_name, nb_components, vector_mode)
time_value = get_time(proxy, timestamp_nb)
# Set timestamp
- pv.GetRenderView().ViewTime = time_value
- pv.UpdatePipeline(time_value, proxy)
+ pvs.GetRenderView().ViewTime = time_value
+ pvs.UpdatePipeline(time_value, proxy)
# Extract only groups with data for the field
new_proxy = extract_groups_for_field(proxy, field_name, entity)
# Cell centers
if is_data_on_cells(proxy, field_name):
- cell_centers = pv.CellCenters(source)
+ cell_centers = pvs.CellCenters(source)
cell_centers.VertexCells = 1
source = cell_centers
source = calc
# Glyph
- glyph = pv.Glyph(source)
+ glyph = pvs.Glyph(source)
glyph.Vectors = vector_array
glyph.ScaleMode = 'vector'
glyph.MaskPoints = 0
glyph.UpdatePipeline()
# Get Vectors representation object
- vectors = pv.GetRepresentation(glyph)
+ vectors = pvs.GetRepresentation(glyph)
# Get lookup table
lookup_table = get_lookup_table(field_name, nb_components, vector_mode)
time_value = get_time(proxy, timestamp_nb)
# Set timestamp
- pv.GetRenderView().ViewTime = time_value
- pv.UpdatePipeline(time_value, proxy)
+ pvs.GetRenderView().ViewTime = time_value
+ pvs.UpdatePipeline(time_value, proxy)
# Extract only groups with data for the field
new_proxy = extract_groups_for_field(proxy, field_name, entity)
# Do merge
- source = pv.MergeBlocks(new_proxy)
+ source = pvs.MergeBlocks(new_proxy)
# Cell data to point data
if is_data_on_cells(proxy, field_name):
- cell_to_point = pv.CellDatatoPointData()
+ cell_to_point = pvs.CellDatatoPointData()
cell_to_point.PassCellData = 1
source = cell_to_point
source = calc
# Warp by vector
- warp_vector = pv.WarpByVector(source)
+ warp_vector = pvs.WarpByVector(source)
warp_vector.Vectors = [vector_array]
if scale_factor is not None:
warp_vector.ScaleFactor = scale_factor
warp_vector.ScaleFactor = def_scale
# Get Deformed Shape representation object
- defshape = pv.GetRepresentation(warp_vector)
+ defshape = pvs.GetRepresentation(warp_vector)
# Get lookup table
lookup_table = get_lookup_table(field_name, nb_components, vector_mode)
time_value = get_time(proxy, timestamp_nb)
# Set timestamp
- pv.GetRenderView().ViewTime = time_value
- pv.UpdatePipeline(time_value, proxy)
+ pvs.GetRenderView().ViewTime = time_value
+ pvs.UpdatePipeline(time_value, proxy)
# Set scalar field by default
scalar_field_entity = scalar_entity
new_proxy = extract_groups_for_field(proxy, field_name, entity)
# Do merge
- source = pv.MergeBlocks(new_proxy)
+ source = pvs.MergeBlocks(new_proxy)
# Cell data to point data
if is_data_on_cells(proxy, field_name):
- cell_to_point = pv.CellDatatoPointData(source)
+ cell_to_point = pvs.CellDatatoPointData(source)
cell_to_point.PassCellData = 1
source = cell_to_point
source = calc
# Warp by vector
- warp_vector = pv.WarpByVector(source)
+ warp_vector = pvs.WarpByVector(source)
warp_vector.Vectors = [vector_array]
if scale_factor is not None:
warp_vector.ScaleFactor = scale_factor
warp_vector.ScaleFactor = def_scale
# Get Defromed Shape And Scalar Map representation object
- defshapemap = pv.GetRepresentation(warp_vector)
+ defshapemap = pvs.GetRepresentation(warp_vector)
# Get lookup table
lookup_table = get_lookup_table(scalar_field, nb_components, vector_mode)
time_value = get_time(proxy, timestamp_nb)
# Set timestamp
- pv.GetRenderView().ViewTime = time_value
- pv.UpdatePipeline(time_value, proxy)
+ pvs.GetRenderView().ViewTime = time_value
+ pvs.UpdatePipeline(time_value, proxy)
# Extract only groups with data for the field
new_proxy = extract_groups_for_field(proxy, field_name, entity)
# Do merge
- merge_blocks = pv.MergeBlocks(new_proxy)
+ merge_blocks = pvs.MergeBlocks(new_proxy)
merge_blocks.UpdatePipeline()
poly_data = None
radians(angle1), radians(angle2))
# Create slice filter
- slice_filter = pv.Slice(merge_blocks)
+ slice_filter = pvs.Slice(merge_blocks)
slice_filter.SliceType = "Plane"
# Set cutting plane normal
use_normal = 0
# Geometry filter
if not poly_data or poly_data.GetDataInformation().GetNumberOfCells() == 0:
- geometry_filter = pv.GeometryFilter(merge_blocks)
+ geometry_filter = pvs.GeometryFilter(merge_blocks)
poly_data = geometry_filter
use_normal = 1 # TODO(MZN): workaround
if is_data_on_cells(poly_data, field_name):
# Cell data to point data
- cell_to_point = pv.CellDatatoPointData(poly_data)
+ cell_to_point = pvs.CellDatatoPointData(poly_data)
cell_to_point.PassCellData = 1
source = cell_to_point
source = calc
# Warp by scalar
- warp_scalar = pv.WarpByScalar(source)
+ warp_scalar = pvs.WarpByScalar(source)
warp_scalar.Scalars = scalars
warp_scalar.Normal = normal
warp_scalar.UseNormal = use_normal
if (is_contour):
# Contours
- contour = pv.Contour(warp_scalar)
+ contour = pvs.Contour(warp_scalar)
contour.PointMergeMethod = "Uniform Binning"
contour.ContourBy = ['POINTS', field_name]
scalar_range = get_data_range(proxy, entity,
source = contour
# Get Plot 3D representation object
- plot3d = pv.GetRepresentation(source)
+ plot3d = pvs.GetRepresentation(source)
# Get lookup table
lookup_table = get_lookup_table(field_name, nb_components, vector_mode)
time_value = get_time(proxy, timestamp_nb)
# Set timestamp
- pv.GetRenderView().ViewTime = time_value
- pv.UpdatePipeline(time_value, proxy)
+ pvs.GetRenderView().ViewTime = time_value
+ pvs.UpdatePipeline(time_value, proxy)
# Extract only groups with data for the field
new_proxy = extract_groups_for_field(proxy, field_name, entity)
# Do merge
- source = pv.MergeBlocks(new_proxy)
+ source = pvs.MergeBlocks(new_proxy)
# Transform cell data into point data if necessary
if is_data_on_cells(proxy, field_name):
- cell_to_point = pv.CellDatatoPointData(source)
+ cell_to_point = pvs.CellDatatoPointData(source)
cell_to_point.PassCellData = 1
source = cell_to_point
source = calc
# Contour filter settings
- contour = pv.Contour(source)
+ contour = pvs.Contour(source)
contour.ComputeScalars = 1
contour.ContourBy = contour_by
contour.Isosurfaces = surfaces
# Get Iso Surfaces representation object
- isosurfaces = pv.GetRepresentation(contour)
+ isosurfaces = pvs.GetRepresentation(contour)
# Get lookup table
lookup_table = get_lookup_table(field_name, nb_components, vector_mode)
time_value = get_time(proxy, timestamp_nb)
# Set timestamp
- pv.GetRenderView().ViewTime = time_value
+ pvs.GetRenderView().ViewTime = time_value
proxy.UpdatePipeline(time=time_value)
# Extract only groups with data for the field
# If no quadrature point array is passed, use cell centers
if field_name in qp_arrays:
- generate_qp = pv.GenerateQuadraturePoints(source)
+ generate_qp = pvs.GenerateQuadraturePoints(source)
generate_qp.SelectSourceArray = ['CELLS', 'ELGA_Offset']
source = generate_qp
else:
# Cell centers
- cell_centers = pv.CellCenters(source)
+ cell_centers = pvs.CellCenters(source)
cell_centers.VertexCells = 1
source = cell_centers
source = calc
# Warp by vector
- warp_vector = pv.WarpByVector(source)
+ warp_vector = pvs.WarpByVector(source)
warp_vector.Vectors = [vector_array]
if scale_factor is not None:
warp_vector.ScaleFactor = scale_factor
source = warp_vector
# Get Gauss Points representation object
- gausspnt = pv.GetRepresentation(source)
+ gausspnt = pvs.GetRepresentation(source)
# Get lookup table
lookup_table = get_lookup_table(field_name, nb_components, vector_mode)
return gausspnt
+def GaussPointsOnField1(proxy, entity, field_name,
+ timestamp_nb,
+ is_colored=True, color=None,
+ primitive=GaussType.SPHERE,
+ is_proportional=True,
+ max_pixel_size=256,
+ multiplier=None,
+ vector_mode='Magnitude'):
+ """Creates Gauss Points on the given field. Use GaussPoints() Paraview interface.
+
+ Arguments:
+ proxy: the pipeline object, containig data
+ entity: the field entity type from PrsTypeEnum
+ field_name: the field name
+ timestamp_nb: the number of time step (1, 2, ...)
+ is_colored -- defines whether the Gauss Points will be multicolored,
+ using the corresponding data values
+ color: defines the presentation color as [R, G, B] triple. Taken into
+ account only if is_colored is False.
+ primitive: primitive type from GaussType
+ is_proportional: if True, the size of primitives will depends on
+ the gauss point value
+ max_pixel_size: the maximum sizr of the Gauss Points primitive in pixels
+ multiplier: coefficient between data values and the size of primitives
+ If not passed by user, default scale will be computed.
+ vector_mode: the mode of transformation of vector values into
+ scalar values, applicable only if the field contains vector values.
+ Possible modes: 'Magnitude' - vector module;
+ 'X', 'Y', 'Z' - vector components.
+
+ Returns:
+ Gauss Points as representation object.
+
+ """
+ # Get time value
+ time_value = get_time(proxy, timestamp_nb)
+
+ # Set timestamp
+ pvs.GetRenderView().ViewTime = time_value
+ proxy.UpdatePipeline(time=time_value)
+
+ # Create Gauss Points object
+ source = pvs.GaussPoints(proxy)
+ source.UpdatePipeline()
+
+ # Get Gauss Points representation object
+ gausspnt = pvs.GetRepresentation(source)
+
+ # Get lookup table
+ entity_data_info = None
+ point_data_info = source.GetPointDataInformation()
+ if field_name in point_data_info.keys():
+ entity_data_info = point_data_info
+ else:
+ entity_data_info = source.GetCellDataInformation()
+ nb_components = entity_data_info[field_name].GetNumberOfComponents()
+
+ lookup_table = get_lookup_table(field_name, nb_components, vector_mode)
+
+ # Set field range if necessary
+ data_range = get_data_range(proxy, entity,
+ field_name, vector_mode)
+ lookup_table.LockScalarRange = 1
+ lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0]
+
+ # Set display properties
+ if is_colored:
+ gausspnt.ColorAttributeType = EntityType.get_pvtype(entity)
+ gausspnt.ColorArrayName = field_name
+ else:
+ gausspnt.ColorArrayName = ''
+ if color:
+ gausspnt.DiffuseColor = color
+
+ gausspnt.LookupTable = lookup_table
+
+ # Add scalar bar
+ add_scalar_bar(field_name, nb_components,
+ vector_mode, lookup_table, time_value)
+
+ # Set point sprite representation
+ gausspnt.Representation = 'Point Sprite'
+
+ # Point sprite settings
+ gausspnt.InterpolateScalarsBeforeMapping = 0
+ gausspnt.MaxPixelSize = max_pixel_size
+
+ # Render mode
+ gausspnt.RenderMode = GaussType.get_mode(primitive)
+
+ #if primitive == GaussType.SPRITE:
+ # Set texture
+ # TODO(MZN): replace with pvsimple high-level interface
+ # texture = sm.CreateProxy("textures", "SpriteTexture")
+ # alphamprop = texture.GetProperty("AlphaMethod")
+ # alphamprop.SetElement(0, 2) # Clamp
+ # alphatprop = texture.GetProperty("AlphaThreshold")
+ # alphatprop.SetElement(0, 63)
+ # maxprop = texture.GetProperty("Maximum")
+ # maxprop.SetElement(0, 255)
+ # texture.UpdateVTKObjects()
+
+ # gausspnt.Texture = texture
+ #gausspnt.Texture.AlphaMethod = 'Clamp'
+ #gausspnt.Texture.AlphaThreshold = 63
+ #gausspnt.Texture.Maximum= 255
+
+ # Proportional radius
+ gausspnt.RadiusUseScalarRange = 0
+ gausspnt.RadiusIsProportional = 0
+
+ if is_proportional:
+ mult = multiplier
+ if mult is None:
+ mult = abs(0.1 / data_range[1])
+
+ gausspnt.RadiusScalarRange = data_range
+ gausspnt.RadiusTransferFunctionEnabled = 1
+ gausspnt.RadiusMode = 'Scalar'
+ gausspnt.RadiusArray = ['POINTS', field_name]
+ if nb_components > 1:
+ v_comp = get_vector_component(vector_mode)
+ gausspnt.RadiusVectorComponent = v_comp
+ gausspnt.RadiusTransferFunctionMode = 'Table'
+ gausspnt.RadiusScalarRange = data_range
+ gausspnt.RadiusUseScalarRange = 1
+ gausspnt.RadiusIsProportional = 1
+ gausspnt.RadiusProportionalFactor = mult
+ else:
+ gausspnt.RadiusTransferFunctionEnabled = 0
+ gausspnt.RadiusMode = 'Constant'
+ gausspnt.RadiusArray = ['POINTS', 'Constant Radius']
+
+ return gausspnt
def StreamLinesOnField(proxy, entity, field_name, timestamp_nb,
direction='BOTH', is_colored=False, color=None,
time_value = get_time(proxy, timestamp_nb)
# Set timestamp
- pv.GetRenderView().ViewTime = time_value
- pv.UpdatePipeline(time_value, proxy)
+ pvs.GetRenderView().ViewTime = time_value
+ pvs.UpdatePipeline(time_value, proxy)
# Extract only groups with data for the field
new_proxy = extract_groups_for_field(proxy, field_name, entity)
# Do merge
- source = pv.MergeBlocks(new_proxy)
+ source = pvs.MergeBlocks(new_proxy)
# Cell data to point data
if is_data_on_cells(proxy, field_name):
- cell_to_point = pv.CellDatatoPointData(source)
+ cell_to_point = pvs.CellDatatoPointData(source)
cell_to_point.PassCellData = 1
cell_to_point.UpdatePipeline()
source = cell_to_point
source = calc
# Stream Tracer
- stream = pv.StreamTracer(source)
+ stream = pvs.StreamTracer(source)
stream.SeedType = "Point Source"
stream.Vectors = ['POINTS', vector_array]
stream.SeedType = "Point Source"
# Get Stream Lines representation object
if is_empty(stream):
return None
- streamlines = pv.GetRepresentation(stream)
+ streamlines = pvs.GetRepresentation(stream)
# Get lookup table
lookup_table = get_lookup_table(field_name, nb_components, vector_mode)
prs = None
if (proxy.GetDataInformation().GetNumberOfPoints() or
proxy.GetDataInformation().GetNumberOfCells()):
- prs = pv.GetRepresentation(proxy)
+ prs = pvs.GetRepresentation(proxy)
prs.ColorArrayName = ''
return prs
nb_items = proxy.GetDataInformation().GetNumberOfCells()
if nb_items:
- prs = pv.GetRepresentation(proxy)
+ prs = pvs.GetRepresentation(proxy)
prs.ColorArrayName = ''
return prs
try:
paravis_instance.ImportFile(file_name)
- proxy = pv.GetActiveSource()
+ proxy = pvs.GetActiveSource()
if proxy is None:
print "FAILED"
else:
print "FAILED"
else:
# Get view
- view = pv.GetRenderView()
+ view = pvs.GetRenderView()
# Create required presentations for the proxy
CreatePrsForProxy(proxy, view, prs_types,