pvbatch script for saving animations modifing each frame
Hi all.
I'd like to have your inputs on a problem that is puzzling me from days. I want to save an animation starting from a series of vtk. Apart from the rendering of a point field, I need a line source to be superimposed. The coordinates of the two points defining the line have to be read from a text file (two points for each vtk). I managed to create an image sequence, that is to export each single frame of my animation. Now I'd like to have only an .ogv as output of my python script. I tried something like the script here, but I wasn't successful: ----------------------------------------------------------- ERROR: In /root/ParaView-v4.0.1-source/ParaViewCore/ClientServerCore/Rendering/vtkPVCameraCueManipulator.cxx, line 94 vtkPVCameraCueManipulator (0x1ed8d550): No camera to animate. ./video3.sh: line 5: 25353 Segmentation fault /share/paraview-4.0.1-MESA/bin/pvbatch --use-offscreen-rendering screen3.py ----------------------------------------------------------- Of course the error comes from the fact that I'm not animating the camera. Another hint is here, where the suggestion is to put the rendering instructions into a "Python script to be called on every timestep" using the "Python Animation Cue". Nonetheless I couldn't find any reference/example on internet. Any suggestion? PS: the rendering instructions are those I could register using the GUI tracing tool PPS: I'm using Paraview 4.0.1 with MESA support on a Linux machine |
Minimal script
Just to give some more background, here's a minimal version of my script:
Code:
import math Is there a way to save an .ogv starting from those frames? Any comments on the script are extremely welcome! :D |
Greetings Gaetano,
:eek: Wow, that's some heavy duty coding you want to perform! And for pvbatch, to top it off! Personally, I prefer to use GUI first for testing. And ParaView has got a marvellous feature in the "Tools" menu, namely "Start/Stop Trace". This allows us to register most of the commands we executed graphically and when we stop tracing, we get a script which most of the times gives a good code to start with. Problem is when it doesn't give us all of the code we need :( But in this case, I did a quick test, and the following pearls of wisdom it gave me were (with ParaView 3.12.0):
As for saving to OGV... on ParaView 4.0.1 I got this from the Python trace feature: Quote:
Bruno |
Quote:
Quote:
Quote:
For future reference (and my 2 cents for the community), here's how I did it: Code:
try: paraview.simple Regards, Gaetano |
Errata corrige: my script seems to put the line at the previous instant into the current instant photogram. There is still something wrong, so be careful if you're going to use it.
Regards, Gaetano |
All times are GMT -4. The time now is 13:03. |