Background issues in exported image with headless pvpython
When building Paraview (headless) with the non-default options listed below, the following issues occur in some background properties when running a pvpython
script that exports an image:
-
Background()
method is ignored, i.e. the setting the color of the background does not work. -
TransparentBackground=1
parameter inSaveScreenshot()
is ignored, i.e. background is not exported transparently.
Building Paraview 5.9.1 is done on a Linux Mint Xfce 20.2 machine with installed packages libosmesa6-dev
libgl1-mesa-dev
and libxt-dev
, which succeeds with 116 warnings and no errors, with the following cmake options set:
PARAVIEW_USE_PYTHON=ON
PARAVIEW_USE_QT=OFF
PARAVIEW_USE_QTHELP=OFF
PARAVIEW_USE_VTKM=OFF
VTK_USE_X=OFF
VTK_OPENGL_HAS_OSMESA=ON
Steps to reproduce:
- Build paraview with the options above
- Download the two attached files
- Run the following code with pvpython (replacing the 2nd and last line if necessary):
from paraview.simple import *
xdmf = XDMFReader(FileNames=[online_solution_y.xdmf'])
renderView1 = GetActiveViewOrCreate('RenderView')
xdmfDisplay = Show(xdmf, renderView1)
renderView1.ResetCamera()
renderView1.Background = [0.8333333333333, 0.6666666666666666, 0.0]
renderView1.Update()
SaveScreenshot('image.png', renderView1, ImageResolution=[594, 519], TransparentBackground=0)
Now:
- Check if the background is orange.
- Set
TransparentBackground=1
in the code above and rerun, check that the background is transparent.
Can you reproduce either non-orange background or non-transparent background or both, in the last two steps?
Edited by Argonaut-J