Sample code to create SVG file, using Processing 4.1.1 with Python mode

Recently I’ve moved my “processing-3.5.4” app folder from a Win 8.1 laptop to another 1 w/ Win 10 and it works the same.

However, b/c you also have Processing 4, you’re gonna need to have separate sketchbook folders for both P3 & P4.

Here’s a way to do it on Windows:

  • 1st, close all running Processing instances, so they won’t overwrite the “preferences.txt” file we’re gonna edit later.

  • Go to folder %USERPROFILE%\Documents and create a subfolder named code or another name of your liking.

  • inside subfolder code, create 2 subfolders; 1 for “Processing 3” and another for “Processing 4”.

  • BtW, in my laptop I’ve got 4 subfolders named: P1, P2, P3, P4. B/c I’ve got all Processing versions!

  • Annotate the path of those folders b/c we’ll need them in this next 2nd step.

  • It’s very important to have separate sketchbooks for each of those major versions due to library incompatibility among them.

  • Now go to folder %APPDATA%\Processing and open the “preferences.txt” file there using some text editor, like Notepad.

  • Go to the bottom of “preferences.txt” and try to find these 3 entries:

    1. sketchbook.path=
    2. sketchbook.path.four=
    3. sketchbook.path.three=
  • Those 3 entries represent the paths of our sketchbook folders for Processing versions 2, 4 and 3 respectively.

  • Use the paths you’ve annotated earlier on those config entries and save the file.

If you’ve followed those instructions right, each Processing major version will use its own sketchbook, so libraries installed for 1 major version won’t crash the other.

P.S.: You can move the contents of the sketchbook folder your “Processing 4” was using to its newest folder.

However, only your own sketches, not the subfolders libraries, modes nor tools; b/c it can happen they already contain mixed versions of both Processing 3 & 4 inside them!

3 Likes