Save Animation via command line
I would like to know how to control ParaView via command line to perform the following tasks:
- Load a 3d model file (like *.stl)
- Set camera to "orbit"
- Save the animation to ogv
I simply want to create a rotating animation from a 3d model to show in a webbrowser.
If I guess correctly I have to use python to accomplish this task?
Thanks in advance
Greetings paraJim and welcome to the forum!
I'm short on time, so I'm only able to give the following hints:
thanks for the fast response.
What I have tried so far:
I opened up ParaView, loaded a STL file and executed the following code in the python shell of ParaView:
Which actually creates an avi file.
What I didn't figure out is:
- How to load any 3d Model into the script?
- How to add the animation to the script? I want that the camera orbits around the object.
Here seems to be a solution for setting up the camera to orbit in python but i can't download the python script. http://www.paraview.org/pipermail/pa...ch/011400.html
I think I am getting closer.
Sorry, I was so focused on the command line that I forgot to mention that you can use the "Python Trace" to help you generate the script that loads the files and so forth: http://www.paraview.org/Wiki/Python_GUI_Tools
thanks for your response.
My script is almost finished. This is what I have got so far:
One problem still exists:
- How can I load a file to the python script if I don't know the file type?
If I have a vtk file I need to run:
reader = servermanager.sources.LegacyVTKReader(FileNames='m yFile.vtk')
If I have a stl file I need to run:
reader = STLReader( FileNames=['myFile.stl'] )
Is there a "generic" reader that can read everything?
Not that I'm aware of. You'll probably have to use if statements: http://www.tutorialspoint.com/python/python_if_else.htm
I found another way in the documentation:
Alternatively, starting with ParaView 3.8, you can use OpenDataFile() function to let ParaView pick a reader using the extension of the file.
>>> reader = OpenDataFile(“.../can.ex2”)Thank you very much for your help.
Do you know how to suppress the preview dialog when running the script with pvpython.exe or pvbatch.exe?
Not sure how it will work on Windows...
|All times are GMT -4. The time now is 08:08.|