ParaView Trace Options: Controlling trace verbosity
Continuing covering the improvements to Python tracing capabilities in the upcoming ParaView 4.2, in this post, we’ll see how to control the trace verbosity.
Figure 1: Trace Options Dialog
This is the option under General Settings group called ‘Select which properties to save in trace’. There are 3 options:
- all properties
- any modified properties (default)
- only user-modified properties
What this setting basically controls if that when a new traceable module such as a source, reader, filter, view, etc. is to be added to the trace, which properties on this object do you want to trace.
(1) results in all properties being saved to the trace irrespective of whether you actually changed them using the Properties panel or custom user defaults. (2) saves any of the properties that were modified either by your actions in panels, or data specific defaults selected by ParaView (e.g. automatically selected arrays for processing), as well as changes you make on the Properties panel. This is a good default since it generally ends up saving properites that you would care about. (3) is more restrictive option than (2), where only the properties that you modify on the Properties panel will be saved, none of the custom defaults or auto-detected values.
To see the difference, let’s take a simple use-case:
- Sphere -> Apply
- Clip -> Change Normal to “Y Normal” -> Apply
And I’ve changed my custom user defaults for Sphere to use Phi and Theta resolutions of 80 instead of the default 8.
Option 1: Trace all properties (editied to remove display properties for better readability online)
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# create a new 'Sphere'
sphere1 = Sphere()
sphere1.Center = [0.0, 0.0, 0.0]
sphere1.Radius = 0.5
sphere1.ThetaResolution = 80
sphere1.StartTheta = 0.0
sphere1.EndTheta = 360.0
sphere1.PhiResolution = 80
sphere1.StartPhi = 0.0
sphere1.EndPhi = 180.0
# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
# uncomment following to set a specific view size
# renderView1.ViewSize = [910, 796]
# show data in view
sphere1Display = Show(sphere1, renderView1)
# trace defaults for the display properties.
sphere1Display.Representation = 'Surface'
sphere1Display.Ambient = 0.0
sphere1Display.AmbientColor = [1.0, 1.0, 1.0]
sphere1Display.ColorArrayName = [None, '']
# <-- SNIP: removed tons more for brevity -->
# reset view to fit data
renderView1.ResetCamera()
# create a new 'Clip'
clip1 = Clip(Input=sphere1)
clip1.ClipType = 'Plane'
clip1.Scalars = [None, '']
clip1.Value = 0.0
clip1.InsideOut = 0
clip1.Crinkleclip = 0
# init the 'Plane' selected for 'ClipType'
clip1.ClipType.Origin = [0.0, 0.0, 0.0]
clip1.ClipType.Normal = [1.0, 0.0, 0.0]
clip1.ClipType.Offset = 0.0
# Properties modified on clip1
clip1.Scalars = ['POINTS', '']
# Properties modified on clip1.ClipType
clip1.ClipType.Normal = [0.0, 1.0, 0.0]
# show data in view
clip1Display = Show(clip1, renderView1)
# trace defaults for the display properties.
clip1Display.Representation = 'Surface'
clip1Display.Ambient = 0.0
clip1Display.AmbientColor = [1.0, 1.0, 1.0]
# <-- SNIP: removed tons more for brevity -->
# hide data in view
Hide(sphere1, renderView1)
Option 2: Trace any modified properites
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# create a new 'Sphere'
sphere1 = Sphere()
sphere1.ThetaResolution = 80
sphere1.PhiResolution = 80
# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
# uncomment following to set a specific view size
# renderView1.ViewSize = [910, 796]
# show data in view
sphere1Display = Show(sphere1, renderView1)
# trace defaults for the display properties.
sphere1Display.ColorArrayName = [None, '']
# reset view to fit data
renderView1.ResetCamera()
# create a new 'Clip'
clip1 = Clip(Input=sphere1)
clip1.ClipType = 'Plane'
clip1.Scalars = [None, '']
# Properties modified on clip1
clip1.Scalars = ['POINTS', '']
# Properties modified on clip1.ClipType
clip1.ClipType.Normal = [0.0, 1.0, 0.0]
# show data in view
clip1Display = Show(clip1, renderView1)
# trace defaults for the display properties.
clip1Display.ColorArrayName = [None, '']
clip1Display.ScalarOpacityUnitDistance = 0.079845308687414
# hide data in view
Hide(sphere1, renderView1)
Options 3: Trace only user-modified properites
#### import the simple module from the paraview
from paraview.simple import *
#### disable automatic camera reset on 'Show'
paraview.simple._DisableFirstRenderCameraReset()
# create a new 'Sphere'
sphere1 = Sphere()
# get active view
renderView1 = GetActiveViewOrCreate('RenderView')
# uncomment following to set a specific view size
# renderView1.ViewSize = [910, 796]
# show data in view
sphere1Display = Show(sphere1, renderView1)
# reset view to fit data
renderView1.ResetCamera()
# create a new 'Clip'
clip1 = Clip(Input=sphere1)
# Properties modified on clip1
clip1.Scalars = ['POINTS', '']
# Properties modified on clip1.ClipType
clip1.ClipType.Normal = [0.0, 1.0, 0.0]
# show data in view
clip1Display = Show(clip1, renderView1)
# hide data in view
Hide(sphere1, renderView1)
That should hopefull help understand the difference. I had to trim down the trace produced by Option 1 a little to make it readable. BTW, that comments are indeed added by the trace and not manually inserted afterwords!