u-anurag / OpenSeesPy

OpenSeesPy-Visualization: This branch is to work on Plotting commands to Python-based visualization of OpenSees models.
https://openseespydoc.readthedocs.io/en/latest/src/Plotting_Development_Guide.html
5 stars 2 forks source link

Additional arguments to animation #57

Closed u-anurag closed 4 years ago

u-anurag commented 4 years ago
u-anurag commented 4 years ago

@cslotboom I have added optional arguments to animation function. Users can select start and end times if the ground motion is too long. Also, I tried to add a code to save the animation to .mp4 file and it worked on Jupyter Notebooks but couldn't make it work on the command line. I had to install ffmpeg writer to do that. Let me know if you have time to solve it.

if Movie!="none": ........Movfile = Movie + '.mp4' ........ani.save(Movfile)

cslotboom commented 4 years ago

Okay, that should be fine. My impression is that you will always need a ffmpeg writer to save the output - the user will have to have one before they can save. I will look into it though.

u-anurag commented 4 years ago

I added a function to save the animation. It works for both cmd and Jupyter notebooks. For Spyder, the users will need to change the backend to Qt4 or Qt5 in the Preferences tab.

cslotboom commented 4 years ago

That is good to hear - I assume a ffmpeg writer is it packaged with Anaconda then?

u-anurag commented 4 years ago

I am not using Anaconda. I use pure Python and installed ffmpeg writer to my system Path. We can always change how we save animation in the future. The input argument Movie will be there.