{"@attributes":{"version":"2.0"},"channel":{"title":"tabreturn \/\/ blog","description":"A collection of posts covering a blend of technology, design, code, and creativity.","link":"https:\/\/tabreturn.github.io\/","pubDate":"Sat, 11 Mar 2023 22:10:00 +0000","lastBuildDate":"Sat, 11 Mar 2023 22:10:00 +0000","generator":"Jekyll v3.9.3","item":[{"title":"Overview of Tools Combining Processing and Python","description":"<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\u2019s 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\">\u201cpy5, p5py, and now pyp5js\u2026 Is the community trying to get the newbies confused? Because it\u2019s working.\u201d<\/em><\/p> <p><em>\u2013 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 ...","pubDate":"Tue, 02 Aug 2022 00:00:00 +0000","link":"https:\/\/tabreturn.github.io\/code\/processing\/python\/2022\/08\/02\/overview_of_tools_combining_python_and_processing.html","guid":"https:\/\/tabreturn.github.io\/code\/processing\/python\/2022\/08\/02\/overview_of_tools_combining_python_and_processing.html","category":["code","processing","python"]},{"title":"Generative SVG for Pen Plotters using Python","description":"<p>I recently acquired access to a pen plotter, which I\u2019m excited to report makes a fantastic hardware addition to my growing suite of creative coding toys. Python has plenty to offer the plotter enthusiast \u2013 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 \u20183D\u2019 SVG renders, and more.<\/p> <figure> <img src=\"https:\/\/tabreturn.github.io\/img\/gsfppup\/plot-banner.png\" class=\"fullwidth\" \/> <\/figure> <p>I\u2019ve 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 ...","pubDate":"Thu, 03 Feb 2022 00:00:00 +0000","link":"https:\/\/tabreturn.github.io\/code\/python\/svg\/thonny\/2022\/02\/03\/generative_svg_for_pen_plotters_using_python.html","guid":"https:\/\/tabreturn.github.io\/code\/python\/svg\/thonny\/2022\/02\/03\/generative_svg_for_pen_plotters_using_python.html","category":["code","python","svg","thonny"]},{"title":"Portable Thonny and py5","description":"<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\u2019s 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\u2019ve 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 \u2018clone\u2019 of Processing, ...","pubDate":"Mon, 21 Jun 2021 00:00:00 +0000","link":"https:\/\/tabreturn.github.io\/code\/python\/thonny\/2021\/06\/21\/thonny_and_py5.html","guid":"https:\/\/tabreturn.github.io\/code\/python\/thonny\/2021\/06\/21\/thonny_and_py5.html","category":["code","python","thonny"]},{"title":"Processing.py in Ten Lessons \u2013 Resources","description":"<p>I\u2019ve created two new resources to help Processing.py users \u2013 <strong>a website for browsing code examples<\/strong> and a <strong>cheat sheet for beginners<\/strong>. If you\u2019re keen to learn more about Python Mode for Processing, I\u2019ve written a <a href=\"\/#processing-reverse\">series of lessons<\/a>. I\u2019ve 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, ...","pubDate":"Fri, 16 Apr 2021 00:00:00 +0000","link":"https:\/\/tabreturn.github.io\/code\/processing\/python\/2021\/04\/16\/processing.py_in_ten_lessons-resources.html","guid":"https:\/\/tabreturn.github.io\/code\/processing\/python\/2021\/04\/16\/processing.py_in_ten_lessons-resources.html","category":["code","processing","python"]},{"title":"Interactive Animation with SVG and GSAP","description":"<p>In this tutorial, you\u2019ll create an interactive espresso machine using SVG, JavaScript, and the <a href=\"https:\/\/greensock.com\/gsap\/\">GSAP<\/a> library for animation. You\u2019ll draw the espresso machine using SVG code; once that\u2019s complete, you\u2019ll add the JavaScript\/GSAP code to animate it. You\u2019ll learn how to use different SVG elements and attributes to draw with code. I won\u2019t go into much detail about JavaScript\u2014just 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 ...","pubDate":"Wed, 16 Dec 2020 00:00:00 +0000","link":"https:\/\/tabreturn.github.io\/code\/javascript\/svg\/2020\/12\/16\/interactive_animation_with_svg_and_gsap.html","guid":"https:\/\/tabreturn.github.io\/code\/javascript\/svg\/2020\/12\/16\/interactive_animation_with_svg_and_gsap.html","category":["code","javascript","svg"]},{"title":"A Quick Intro to Blender Creative Coding \u2013 part 3 of 3","description":"<p style=\"text-align:right\"> \u00ab <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\u2019ll learn some Blender scripting techniques\u2014like how to address, manipulate, copy, and animate mesh primitives using code. To combine all of those techniques, you\u2019ll create a wavy pattern of cones\u2014a cool-looking animation that you can convert into a looping GIF.<\/p> <p>I\u2019ll 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\u2019ll also touch on how to import code from other Python files, as well as using other code editors to write your Blender code. Of ...","pubDate":"Sun, 01 Nov 2020 00:00:00 +0000","link":"https:\/\/tabreturn.github.io\/code\/blender\/python\/2020\/11\/01\/a_quick_intro_to_blender_creative_coding-part_3_of_3.html","guid":"https:\/\/tabreturn.github.io\/code\/blender\/python\/2020\/11\/01\/a_quick_intro_to_blender_creative_coding-part_3_of_3.html","category":["code","blender","python"]},{"title":"A Quick Intro to Blender Creative Coding \u2013 part 2 of 3","description":"<p style=\"text-align:right\"> \u00ab <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> \u00bb<br \/> <\/p> <p>In this instalment, you\u2019ll learn about some useful Blender features for writing scripts. You\u2019ll use the <em>Info<\/em> editor to glean what Python commands are associated with the different actions you perform using the graphic interface. I\u2019ll also introduce the Blender <em>Console<\/em>, a handy editor for entering line-by-line Python commands that apply immediately to your scene. You\u2019ll 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 ...","pubDate":"Tue, 14 Jul 2020 00:00:00 +0000","link":"https:\/\/tabreturn.github.io\/code\/blender\/python\/2020\/07\/14\/a_quick_intro_to_blender_creative_coding-part_2_of_3.html","guid":"https:\/\/tabreturn.github.io\/code\/blender\/python\/2020\/07\/14\/a_quick_intro_to_blender_creative_coding-part_2_of_3.html","category":["code","blender","python"]},{"title":"A Quick Intro to Blender Creative Coding \u2013 part 1 of 3","description":"<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> \u00bb<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\u2019ll 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 ...","pubDate":"Sat, 06 Jun 2020 00:00:00 +0000","link":"https:\/\/tabreturn.github.io\/code\/blender\/python\/2020\/06\/06\/a_quick_intro_to_blender_creative_coding-part_1_of_3.html","guid":"https:\/\/tabreturn.github.io\/code\/blender\/python\/2020\/06\/06\/a_quick_intro_to_blender_creative_coding-part_1_of_3.html","category":["code","blender","python"]},{"title":"Portable Thonny and p5","description":"<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\u2019d 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\u2019ve 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 ...","pubDate":"Wed, 26 Feb 2020 00:00:00 +0000","link":"https:\/\/tabreturn.github.io\/code\/python\/thonny\/2020\/02\/26\/thonny_and_p5.html","guid":"https:\/\/tabreturn.github.io\/code\/python\/thonny\/2020\/02\/26\/thonny_and_p5.html","category":["code","python","thonny"]},{"title":"Processing.py in Ten Lessons \u2013 8.1: Functions","description":"<p style=\"text-align:right\"> \u00ab <a href=\"\/code\/processing\/python\/2019\/03\/19\/processing.py_in_ten_lessons-7.5-_controlp5.html\"> 7.5: ControlP5<\/a> <\/p> <hr \/> <p>\u00a0<br \/> <strong>I have a new book out titled <em>Learn Python Visually \u2013 Creative Coding with Processing.py<\/em><\/strong>. The book contains a refined and redesigned version of what I\u2019ve 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\u2019ll finish off the remaining lessons (listed below), but cannot say exactly when. You can ...","pubDate":"Fri, 26 Apr 2019 00:00:00 +0000","link":"https:\/\/tabreturn.github.io\/code\/processing\/python\/2019\/04\/26\/processing.py_in_ten_lessons-8.1-_functions.html","guid":"https:\/\/tabreturn.github.io\/code\/processing\/python\/2019\/04\/26\/processing.py_in_ten_lessons-8.1-_functions.html","category":["code","processing","python"]}]}}