pvpython layout1.SplitHorizontal

Hello everybody,

I am trying to automate some visualizations with Paraview using pvpython. For some postprocessing routines it works very nicely (I use paraview version 5.10.0-RC2 on a linux machine).

I want to create and save a screenshot of multiple views in one layout. I tracked the steps with the trace and running the script in the paraview python shell works fine and I do get the plot I want.

Running the script with pvpython in a bash shell however, gives me following error:
pvpython GetMapView_Test.py
Traceback (most recent call last):
File “GetMapView_Test.py”, line 357, in
layout1.SplitHorizontal(0, 0.5)
AttributeError: ‘NoneType’ object has no attribute ‘SplitHorizontal’

Thanks for any help!

Best,

Lukas

A little snipped of the Code is below:

disable automatic camera reset on ‘Show’

paraview.simple._DisableFirstRenderCameraReset()

get animation scene

animationScene1 = GetAnimationScene()

update animation scene based on data timesteps

animationScene1.UpdateAnimationUsingDataTimeSteps()

get the material library

materialLibrary1 = GetMaterialLibrary()

Create a new ‘Render View’

renderView1 = CreateView(‘RenderView’)
renderView1.AxesGrid = ‘GridAxes3DActor’
renderView1.StereoType = ‘Crystal Eyes’
renderView1.CameraFocalDisk = 1.0
renderView1.BackEnd = ‘OSPRay raycaster’
renderView1.OSPRayMaterialLibrary = materialLibrary1

show data in view

Display = Show(pvd, renderView1, ‘UniformGridRepresentation’)

get layout

layout1 = GetLayoutByName(“Layout #1”)

add view to a layout so it’s visible in UI

AssignViewToLayout(view=renderView1, layout=layout1, hint=0)

reset view to fit data

renderView1.ResetCamera(False)

update the view to ensure updated data information

renderView1.Update()

set active view

SetActiveView(renderView1)

update the view to ensure updated data information

renderView1.Update()

#print(layout1)

split cell

layout1.SplitHorizontal(0, 0.5)