Animate in Drawbot, without exporting .gif …



  • Hello everyone,

    I had a look at various drawbot animation examples and I wondered if it’s somehow possible to test the animation in drawbot before exporting single frames to a .gif file …

    Thank you very much!



  • Think of this as setup(), update(), and draw() in Processing and p5js, or openFrameworks.


  • admin

    I dont see the difference between showing the animation and generating, those are basically the same 🙂

    DrawBot has a workflow and originated from pdf with pages. The idea to glue pages as frames to form an animation is a nice artefact.

    you can actually script your own setup(), update() and draw() callbacks.

    def setup():
       # setup 
    
    def draw():
       # draw here
    
    setup()
    draw()
    

    good luck!!



  • Thank you, @frederik … but I fear I don’t quite understand what you mean. Please let me elaborate on this.

    For example, there’s this beautiful variable animation piece of code by @rutherfordcraze.

    How would I achieve to see this animation in the canvas, i.e. to update the drawn page with a newly generated one?


  • admin

    The 'preview' view only shows the pdf. The animation is generated from the pdf where pages are frames.

    You can preview/open the animation at the end of your script with:

    # draw something
    
    path = "path/to/my/animation.gir"
    saveImage(path)
    
    # open the animation
    import os
    os.system(f"open -a Safari {path}")
    


  • Thank you, @frederik! I’ll try to get used to this.



  • While I'm working on an animation I run the script once to save the .gif file to the disk, then I select the file and hit the space bar to open it in Quick Look to preview the animation. I leave this preview window open in the Finder while I continue to work on editing the script in DrawBot — every time the file gets updated with a newly saved .gif it will automatically start previewing the new version. Kind of a strange technique but it works!


Log in to reply