Code Monkey home page Code Monkey logo

processing-sketch-slideshow-python-script-for-windows's Introduction

Processing Sketch Slideshow Python Script for Windows

About the project

I'm a volunteer at the Idea Fab Labs maker/hacker/artspace here in Santa Cruz, and when I came in for my shift today, I was surprised to see a giant (six feet tall? I should have measured) glossy black monolith, with most of the front being a giant display, and with a Windows computer somehow built into it. I don't know where it came from, or what it had been doing in a previous life, but I was asked to write a script for it that would continuously cycle through and display all the Processing graphics and animations sketches in a sketchbook network folder, joining the Raspberry Pi Instagram Slideshow and Slide and Video Show installations I had previously done in providing cool giant video displays for IFL open houses and other events, and making it easy for members to add their artworks to the slideshow by copying their sketches into the sketchbook.

BTW, I had never used/run Processing before this (though I had heard of it), and now I want to do at least one sketch of my own to copy into the IFL sketchbook next week, so I can have some art in the slideshow myself. :-)

What you need to do to run the script

The script as-is requires Windows

I tested the script on systems running Windows 7 and Windows 10, but the operative word here is Windows. If you're running on another OS the general idea should be the same, but you'll need to look up and modify the commands it uses both to launch Processing with a sketch at the command line, and to terminate that process after moving on to the next sketch.

And it requires Python

What can I say, it's a Python script ... it will work with either Python 2 or Python 3, so if you don't already have at least one of them installed on your computer, you should pay a visit to https://www.python.org/downloads/.

It also requires Processing

Because this script is starting and closing instances of Processing to display sketches, if you don't already have Processing installed on your computer, you will need to install it, by visiting https://processing.org/download/.

Copy the processing_slideshow.py script to your Processing directory

Copy the script processing_slideshow.py from this repo to your Processing directory -- the directory that has the files processing.exe and processing-java.exe (among others) in it.

Configure the script with the location of your sketchbook

Run Processing.exe and select Preferences in the File pull-down menu to copy the location of your sketchbook. Then replace "your sketchbook location here" in this line in the script -- SKETCHBOOK_DIRECTORY = "your sketchbook location here" -- with your sketchbook location. Use "/" "forward slashes" in the path as in this example -- "F:/processing-3.3.7/sketchbook" -- not "\" "backslashes".

Configure the sketch display order, if you like

By default the script displays sketches in random order (good both for variety in general, and also for if you have a bunch of sketches with similar names that are variations of each other), but if you like you can set the DISPLAY_ORDER variable to SORT_ALPHABETICAL_ORDER instead.

Try running the Processing sketch slideshow script at the command line

Open up a terminal window, navigate to your Processing directory, and enter

python processing_slideshow.py

at the command line. The slideshow will start once Processing starts and runs the first sketch in your sketchbook. Or if you like you can make a desktop shortcut or Windows menu entry to automatically run python processing_slideshow.py from your Processing directory when you click or select it.

You'll probably want to edit your sketches to make them full screen if they aren't already

IMHO randomly-sized sketches popping up doesn't make for the greatest-looking slideshow. What you would want to do about that depends on whether an individual sketch is using a 2D or 3D renderer:

  • For a 2D renderer, the first line below the line void setup() { in your sketch should be fullScreen();, and you should comment out your size line.
  • For a 3D renderer (your size statement will have P3D after the width and height values), you can't use fullScreen(), but you can set the size width and height values to match your screen resolution.

You might want to move your not-yet-working sketches temporarily out of your sketchbook

If you have any sketches you've started working on, but that just give error messages when you try to run them, yeah, you may want to temporarily move them out of your sketchbook, because that won't look very good in the slideshow. Ditto for any that haven't moved beyond the, say, white rectangle on a gray background level yet. :-)

processing-sketch-slideshow-python-script-for-windows's People

Contributors

tachyonlabs avatar

Stargazers

Alexandre B A Villares avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.