CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[General] How can I use python script to generate animation from 2000 frames of vtk datasets

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Flowkersma

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 7, 2016, 18:40
Default How can I use python script to generate animation from 2000 frames of vtk datasets
  #1
New Member
 
Lieyu Shi
Join Date: Mar 2016
Posts: 3
Rep Power: 6
LieyuShi is on a distinguished road
Hi,
I'm a beginner in Paraview. I just generated 2000 frames of vtk data for fluid simulation. I have separately uploaded files in Paraview and was able to see the image. I have two concerns
1. How can I use shell script to automatically generate animation from these datasets? Can Paraview achieve that with some piece of python code?
2. If the answer for above is no, can I write a script to automatically upload and save screenshots of each dataset respectively? I could only manually save screenshots from GUI.

Can somebody kindly help me with that? I was still learning Python script and searched materials online for that. Attached is one of my manually generated figure for fluid.

Attached Images
File Type: jpg frame404.jpg (44.1 KB, 16 views)
LieyuShi is offline   Reply With Quote

Old   March 10, 2016, 10:02
Default
  #2
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 238
Rep Power: 9
Flowkersma is on a distinguished road
Hi,

I think the easiest way is to rename the files such that they are foo0001.vtk, foo0002.vtk, foo0003.vtk, ..., foo2000.vtk and move all files to same directory. Then from ParaView GUI press Open and browse to the directory and you should see a filename called foo..vtk which loads all the timesteps. Now, you should be able to create an animation by pressing "Save Animation".

Regards,
Mikko

Quote:
Originally Posted by LieyuShi View Post
Hi,
I'm a beginner in Paraview. I just generated 2000 frames of vtk data for fluid simulation. I have separately uploaded files in Paraview and was able to see the image. I have two concerns
1. How can I use shell script to automatically generate animation from these datasets? Can Paraview achieve that with some piece of python code?
2. If the answer for above is no, can I write a script to automatically upload and save screenshots of each dataset respectively? I could only manually save screenshots from GUI.

Can somebody kindly help me with that? I was still learning Python script and searched materials online for that. Attached is one of my manually generated figure for fluid.

LieyuShi likes this.
Flowkersma is offline   Reply With Quote

Old   March 10, 2016, 14:28
Default
  #3
New Member
 
Lieyu Shi
Join Date: Mar 2016
Posts: 3
Rep Power: 6
LieyuShi is on a distinguished road
Hi,
Thanks for your kind reply. It really works!!! I never image it can that easy to create an animation... Actually I spent a long time writing script and trying to make it work... Thanks greatly

Last edited by LieyuShi; March 10, 2016 at 14:35. Reason: want to delete
LieyuShi is offline   Reply With Quote

Old   March 10, 2016, 14:37
Default
  #4
New Member
 
Lieyu Shi
Join Date: Mar 2016
Posts: 3
Rep Power: 6
LieyuShi is on a distinguished road
Hi,
Thanks greatly. I never imagine it to be this easy. Actually I spent days in writing the script file to manage load, transformation and save.. Thanks man

Best

Lieyu
Quote:
Originally Posted by Flowkersma View Post
Hi,

I think the easiest way is to rename the files such that they are foo0001.vtk, foo0002.vtk, foo0003.vtk, ..., foo2000.vtk and move all files to same directory. Then from ParaView GUI press Open and browse to the directory and you should see a filename called foo..vtk which loads all the timesteps. Now, you should be able to create an animation by pressing "Save Animation".

Regards,
Mikko
LieyuShi is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[General] Generating isosurface from vtk file with python script Leios ParaView 1 March 26, 2018 13:33
[General] Paraview.simple python module and loading legacy vtk file timeseries awa5114 ParaView 2 July 17, 2017 09:40
[OpenFOAM] Python script to export animation images mahyarv14 ParaView 10 August 16, 2014 12:11
[General] VTK API: Working with values inside the python shell Thoma ParaView 4 January 10, 2013 15:35
CentFOAM Python Script Installation: Error socon009 OpenFOAM Installation 2 May 26, 2012 10:36


All times are GMT -4. The time now is 21:34.