tabreturn // blog A collection of posts covering a blend of technology, design, code, and creativity. https://tabreturn.github.io/ Sat, 11 Mar 2023 22:10:00 +0000 Sat, 11 Mar 2023 22:10:00 +0000 Jekyll v3.9.3 Overview of Tools Combining Processing and Python <p>A while ago, I was reading over (and responding to) a post on the <a href="https://discourse.processing.org">Processing forums</a>. The thread discussed the future of Processing <a href="https://py.processing.org/">Python Mode / Processing.py</a>, but that’s not exactly what this blog post is about. What inspired me was one particular comment from <em>Setsuna</em> that read:</p> <p><em style="font-size:1.5em; line-height:1.5em">“py5, p5py, and now pyp5js… Is the community trying to get the newbies confused? Because it’s working.”</em></p> <p><em>– Setsuna, from the <a href="https://discourse.processing.org/t/what-is-the-future-of-processing-python-mode/35009/20">Processing forums</a></em></p> <p>Setsuna makes a valid point. People involved in developing Python implementations of Processing should take note. <a href="https://py.processing.org/">Processing.py</a>, <a href="https://py5.ixora.io/">py5</a>, <a href="https://p5.readthedocs.io/">p5py</a>, and <a ... Tue, 02 Aug 2022 00:00:00 +0000 https://tabreturn.github.io/code/processing/python/2022/08/02/overview_of_tools_combining_python_and_processing.html https://tabreturn.github.io/code/processing/python/2022/08/02/overview_of_tools_combining_python_and_processing.html code processing python Generative SVG for Pen Plotters using Python <p>I recently acquired access to a pen plotter, which I’m excited to report makes a fantastic hardware addition to my growing suite of creative coding toys. Python has plenty to offer the plotter enthusiast – from powerful SVG optimisation tools like <a href="https://github.com/abey79/vpype">vpype</a> to <a href="https://docs.blender.org/manual/en/latest/advanced/scripting/index.html">Blender scripting</a> for ‘3D’ SVG renders, and more.</p> <figure> <img src="https://tabreturn.github.io/img/gsfppup/plot-banner.png" class="fullwidth" /> </figure> <p>I’ve been working extensively with <a href="http://py5.ixora.io/">py5</a> for generative art projects and investigating it seriously as a tool for learning &amp; teaching to code in a more visual context. I recently delivered a <a href="https://ccfest.rocks/">CC Fest</a> presentation on my SVG+plotter adventures ... Thu, 03 Feb 2022 00:00:00 +0000 https://tabreturn.github.io/code/python/svg/thonny/2022/02/03/generative_svg_for_pen_plotters_using_python.html https://tabreturn.github.io/code/python/svg/thonny/2022/02/03/generative_svg_for_pen_plotters_using_python.html code python svg thonny Portable Thonny and py5 <p>I very recently stumbled upon <a href="http://py5.ixora.io/">py5</a>, a Python version of Processing for Python 3.8+ that uses Processing’s core libraries under the hood (thanks to some <a href="http://www.jpype.org">JPype</a> magic).</p> <p style="border:3px solid rgba(255,255,255,0.5); outline:1px solid black; margin:-0.5em 0 1.5em 0; padding:1em"> <em>I’ve begun working on a Thonny plug-in, <a href="https://pypi.org/project/thonny-py5mode/">thonny-py5mode</a>, that automates the installation steps I cover in this post. You can check out the <a href="https://github.com/tabreturn/thonny-py5mode">project repo</a> to track how work on the plug-in is progressing</em>. </p> <p>Previously, I wrote a post on <a href="/code/python/thonny/2020/02/26/thonny_and_p5.html">combining the Thonny editor and p5</a>. <em>p5</em> is a sort of Python ‘clone’ of Processing, ... Mon, 21 Jun 2021 00:00:00 +0000 https://tabreturn.github.io/code/python/thonny/2021/06/21/thonny_and_py5.html https://tabreturn.github.io/code/python/thonny/2021/06/21/thonny_and_py5.html code python thonny Processing.py in Ten Lessons – Resources <p>I’ve created two new resources to help Processing.py users – <strong>a website for browsing code examples</strong> and a <strong>cheat sheet for beginners</strong>. If you’re keen to learn more about Python Mode for Processing, I’ve written a <a href="/#processing-reverse">series of lessons</a>. I’ve also got a book out, <a href="https://nostarch.com/Learn-Python-Visually">Learn Python Visually</a>, published by No Starch Press.</p> <h2 id="1-a-website-for-browsing-code-examples">1. A Website for Browsing Code Examples</h2> <p><a href="http://pyde.org/">PYDE.ORG</a> hosts a collection of short, prototypical programs exploring the basics of programming with Processing.py.</p> <figure> <img class="fullwidth" style="outline:1px solid #BBB" src="https://raw.githubusercontent.com/tabreturn/pyde.org/master/screenshot.png" /> <figcaption> The PYDE.ORG landing page displaying the examples listing </figcaption> </figure> <p>So far, ... Fri, 16 Apr 2021 00:00:00 +0000 https://tabreturn.github.io/code/processing/python/2021/04/16/processing.py_in_ten_lessons-resources.html https://tabreturn.github.io/code/processing/python/2021/04/16/processing.py_in_ten_lessons-resources.html code processing python Interactive Animation with SVG and GSAP <p>In this tutorial, you’ll create an interactive espresso machine using SVG, JavaScript, and the <a href="https://greensock.com/gsap/">GSAP</a> library for animation. You’ll draw the espresso machine using SVG code; once that’s complete, you’ll add the JavaScript/GSAP code to animate it. You’ll learn how to use different SVG elements and attributes to draw with code. I won’t go into much detail about JavaScript—just enough to add some event listeners and manipulate SVG elements with GSAP. The tutorial assumes that you possess a decent grasp of how HTML and CSS work.</p> <p>The final result is a three-step, interactive animation (Figure 1). Click the object ... Wed, 16 Dec 2020 00:00:00 +0000 https://tabreturn.github.io/code/javascript/svg/2020/12/16/interactive_animation_with_svg_and_gsap.html https://tabreturn.github.io/code/javascript/svg/2020/12/16/interactive_animation_with_svg_and_gsap.html code javascript svg A Quick Intro to Blender Creative Coding – part 3 of 3 <p style="text-align:right"> « <a href="/code/blender/python/2020/07/14/a_quick_intro_to_blender_creative_coding-part_2_of_3.html"> part 2 of 3</a> </p> <p>In this final part, you’ll learn some Blender scripting techniques—like how to address, manipulate, copy, and animate mesh primitives using code. To combine all of those techniques, you’ll create a wavy pattern of cones—a cool-looking animation that you can convert into a looping GIF.</p> <p>I’ll review the all-important <code class="language-plaintext highlighter-rouge">bpy</code> library using a selection of attributes and methods from the <code class="language-plaintext highlighter-rouge">bpy.data</code> module. I’ll also touch on how to import code from other Python files, as well as using other code editors to write your Blender code. Of ... Sun, 01 Nov 2020 00:00:00 +0000 https://tabreturn.github.io/code/blender/python/2020/11/01/a_quick_intro_to_blender_creative_coding-part_3_of_3.html https://tabreturn.github.io/code/blender/python/2020/11/01/a_quick_intro_to_blender_creative_coding-part_3_of_3.html code blender python A Quick Intro to Blender Creative Coding – part 2 of 3 <p style="text-align:right"> « <a href="/code/blender/python/2020/06/06/a_quick_intro_to_blender_creative_coding-part_1_of_3.html"> part 1 of 3</a> | <a href="/code/blender/python/2020/11/01/a_quick_intro_to_blender_creative_coding-part_3_of_3.html"> part 3 of 3</a> »<br /> </p> <p>In this instalment, you’ll learn about some useful Blender features for writing scripts. You’ll use the <em>Info</em> editor to glean what Python commands are associated with the different actions you perform using the graphic interface. I’ll also introduce the Blender <em>Console</em>, a handy editor for entering line-by-line Python commands that apply immediately to your scene. You’ll use the Console to execute operations that you might otherwise perform with mouse clicks and keyboard shortcuts.</p> <p>Before proceeding, open Blender (using the <a href="/code/blender/python/2020/06/06/a_quick_intro_to_blender_creative_coding-part_1_of_3.html#launching-blender-using-the-command-line">command ... Tue, 14 Jul 2020 00:00:00 +0000 https://tabreturn.github.io/code/blender/python/2020/07/14/a_quick_intro_to_blender_creative_coding-part_2_of_3.html https://tabreturn.github.io/code/blender/python/2020/07/14/a_quick_intro_to_blender_creative_coding-part_2_of_3.html code blender python A Quick Intro to Blender Creative Coding – part 1 of 3 <p style="text-align:right"> <a href="/code/blender/python/2020/07/14/a_quick_intro_to_blender_creative_coding-part_2_of_3.html"> part 2 of 3</a> »<br /> </p> <p><em>At the time of writing, Blender is on release 2.83; this is also a long term support release (<a href="https://www.blender.org/download/lts/">LTS</a>).</em></p> <p>In this series of tutorials, I’ll introduce Blender as a tool for creative coding. <a href="https://www.blender.org/">Blender</a> is open-source software for 3D modelling and animation that can also handle compositing, video editing, and 2D animation. Artists and animators operate Blender using a graphic user interface (Figure 1.1), but it also features a Python API that can do everything the GUI can and more. That means you can use Python code ... Sat, 06 Jun 2020 00:00:00 +0000 https://tabreturn.github.io/code/blender/python/2020/06/06/a_quick_intro_to_blender_creative_coding-part_1_of_3.html https://tabreturn.github.io/code/blender/python/2020/06/06/a_quick_intro_to_blender_creative_coding-part_1_of_3.html code blender python Portable Thonny and p5 <p>You can combine <em>Thonny</em> and <em>p5</em> for a Processing-esque, Python 3 development environment that runs off a USB drive. There are situations where you may prefer to use p5 over Processing Python Mode / Processing.py, which I discuss in this post. This Thonny-p5 combo is also handy for teaching programming in computer labs where students cannot install software, or any situation where you’d prefer to run an application in a portable fashion.</p> <p style="border:3px solid rgba(255,255,255,0.5); outline:1px solid black; margin:-0.5em 0 1.5em 0; padding:1em"> <em>I’ve written a more recent post on combining <a href="/code/python/thonny/2021/06/21/thonny_and_py5.html">Thonny and <strong>py5</strong></a>. This is quite different ... Wed, 26 Feb 2020 00:00:00 +0000 https://tabreturn.github.io/code/python/thonny/2020/02/26/thonny_and_p5.html https://tabreturn.github.io/code/python/thonny/2020/02/26/thonny_and_p5.html code python thonny Processing.py in Ten Lessons – 8.1: Functions <p style="text-align:right"> « <a href="/code/processing/python/2019/03/19/processing.py_in_ten_lessons-7.5-_controlp5.html"> 7.5: ControlP5</a> </p> <hr /> <p> <br /> <strong>I have a new book out titled <em>Learn Python Visually – Creative Coding with Processing.py</em></strong>. The book contains a refined and redesigned version of what I’ve provided online, printed in full colour with new chapters and nice margins to scrawl in. You can order a copy from the <a href="https://nostarch.com/Learn-Python-Visually">No Starch website</a> or <a href="https://www.amazon.com/Learn-Python-Visually-Tristan-Bunn-ebook/dp/B08JKNHDWN/">Amazon</a>.</p> <p><img class="fullwidth" src="http://portfolio.tabreturn.com/images/learn-python-visually.png" /></p> <p>The <em>functions</em> chapter is available as a free sample download here:<br /> <a href="https://nostarch.com/download/samples/LearnPythonVisually_sampleChapter.pdf">https://nostarch.com/download/samples/LearnPythonVisually_sampleChapter.pdf</a></p> <p>I’ll finish off the remaining lessons (listed below), but cannot say exactly when. You can ... Fri, 26 Apr 2019 00:00:00 +0000 https://tabreturn.github.io/code/processing/python/2019/04/26/processing.py_in_ten_lessons-8.1-_functions.html https://tabreturn.github.io/code/processing/python/2019/04/26/processing.py_in_ten_lessons-8.1-_functions.html code processing python