PlotAnimeGif command (Create Animation in gif format)#
The structure of this command is completely compatible with PlotAnime command but this command creates a gif file from the recorded steps. Just use PlotAnimeGif instead of PlotAnime. To create an animation or gif of animation:
Using Record() command record each step that are desired to animate.
Using PlotAnime or PlotAnimeGif create the animation.
Attention: The Record() command add the current analyzed step to all previously recorded steps. It is important to remember to use RecordReset() command to reset the recorder and delete the recorded steps for a new animation. Also remeber that generating gif file usually takes long time!
import openseespy.opensees as ops
import BraineryWiz as bz
#...
#codes of creating OpenSees model
#...
numberOfSteps=100 #Imagine the number of steps that want to be recorded are 100 steps
bz.RecorderReset() #Reset the recorder to prevent adding new steps (slides) to previous recorded slides
for i in range(numberOfSteps):
ops.analyze(1,0.01) #One step analysis
bz.Record() #Record the analyzed step
bz.PlotAnimeGif (**kwargs) #Show animation of the recorded steps
Click here
to downlad the created gif file as a sample.
PlotAnimeGif command options#
- **kwargs
Stands for other options that user can use to provide desired changes in the plot. In the following the existing options are described.
- scale_factor Option
- draw_wire_shadow Option
- draw_nodes Option
- show_nodes_tag Option
- show_elemens_tag Option
- onhover_message Option
- title Option
- fig_width and fig_height Options
- vertical_axis Option
- show_constrained and not_show_retained_list and constrained_size Options
- recorderfilename option
- Nodes_Size_tag and Nodes_Size Options
- Nodes_color_tag and Nodes_color Options
- Element_color_tag and Elements_color Options
- Elements_width Option
- supports_size and show_supports_desc Options