pvbatch: first screenshot empty, second is as it should be

I am using Paraview 5.13.3 (on Windows 11) to generate a large number of plots with pvbatch. All work fine, except a limited set of plots. In the script, the first plots is empty (except for a color bar), the second is ok, and the third is empty again. I have no idea why this is happening and how to fix it. I tried Render(), .UpdatePipeline() but to no avail.

I made a simplified version of the script that reproduces the problem, but now with two plots. The first one fails, the second one is ok. Only thing in between is that I set a display option (to a value that it already had). Why is this happening, and is this an error on my side, or a bug?



I tried several alternatives, but it seems the only work-around is to save the screenshot twice. In the current script, it works if a Render() is inserted before the SaveScreenshot, but in my original (more complicated script) that did not help.

I provide the script with one of the geometries I try to plot through the link below. The script can be executed from within a Terminal with: pvbatch mwe.py.

link to script: MARIN (expires 2025-10-17)