tadd option to additionally render animation in reverse - Granular.jl - Julia package for granular dynamics simulation
 (HTM) git clone git://src.adamsgaard.dk/Granular.jl
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit a48448c33e150c60f6050172db30191e3b455c84
 (DIR) parent 9a9b60a1002b70c52cbcd5451b687840aa9867af
 (HTM) Author: Anders Damsgaard <andersd@riseup.net>
       Date:   Wed,  1 Nov 2017 14:00:40 -0400
       
       add option to additionally render animation in reverse
       
       Diffstat:
         M examples/logo.jl                    |       2 +-
         M src/io.jl                           |       9 ++++++++-
       
       2 files changed, 9 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/examples/logo.jl b/examples/logo.jl
       t@@ -166,4 +166,4 @@ Granular.setOutputFileInterval!(sim, .1)
        Granular.removeSimulationFiles(sim)
        Granular.run!(sim, verbose=verbose)
        
       -Granular.render(sim, images=true, animation=false)
       +Granular.render(sim, images=true, animation=false, reverse=true)
 (DIR) diff --git a/src/io.jl b/src/io.jl
       t@@ -924,7 +924,8 @@ from the shell using the supplied `pvpython` argument.
        """
        function render(simulation::Simulation; pvpython::String="pvpython",
                        images::Bool=true,
       -                animation::Bool=false)
       +                animation::Bool=false,
       +                reverse::Bool=false)
        
            writeParaviewPythonScript(simulation, save_animation=animation,
                                      save_images=images, verbose=false)
       t@@ -937,6 +938,12 @@ function render(simulation::Simulation; pvpython::String="pvpython",
                        run(`convert -trim +repage -delay 10 -transparent-color white 
                            -loop 0 $(simulation.id)/$(simulation.id).'*'.png 
                            $(simulation.id)/$(simulation.id).gif`)
       +                if reverse
       +                    run(`convert -trim +repage -delay 10 -transparent-color white 
       +                        -loop 0 -reverse
       +                        $(simulation.id)/$(simulation.id).'*'.png 
       +                        $(simulation.id)/$(simulation.id)-reverse.gif`)
       +                end
                    catch return_signal
                        if isa(return_signal, Base.UVError)
                            info("Skipping gif merge since `convert` was not found.")